Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (Grant, TipmyPip, AndrewAMD), 12,724 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
keymapping issue? #272611
06/18/09 22:59
06/18/09 22:59
Joined: May 2009
Posts: 19
Oklahoma, USA
Zodiac Offline OP
Newbie
Zodiac  Offline OP
Newbie

Joined: May 2009
Posts: 19
Oklahoma, USA
I'm really new to this so try not to get annoyed with me right off the bat.

I'm trying to write a function that runs once when I press the 'a' key, but only once and only if the panel connected to it is between 1 and 578 on the y axis. I tried;

if(p_blocka.pos_y>1<578){on_a = score_keeper;}

but I seem to be way off there since it did nothing. Currently the function will run whenever I hit the 'a' after it has been called once, even if the panel isn't on screen.

What is the correct way to set this up? Here is the complete function as well as the one it calls so you can see if I've made errors there that are messing me up.

function score_keeper()
{
score +=5;
correct+=1;
if(correct==10){level_swap2();}
}
///////////////////////////////////////////////
function dropblock_a()
{
p_blocka.pos_x = random(559);
while (p_blocka.pos_y < 580)
{
p_blocka.pos_y += speed;
wait(5);
on_a = score_keeper;/// ///////Issue
if(key_a==1){break;}
if(p_blocka.pos_y>579){missed_block();}
}
p_blocka.pos_y = -95;
wait (1);
roller =1;
}

Any suggestions are greatly appreciated.


If everything seems to be going well, you have obviously overlooked something.
Re: keymapping issue? [Re: Zodiac] #272615
06/18/09 23:32
06/18/09 23:32
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
if(p_blocka.pos_y>1 && p_blocka.pos_y<578 && key_a){ score_keeper();}


3333333333
Re: keymapping issue? [Re: Quad] #272634
06/19/09 02:24
06/19/09 02:24
Joined: May 2009
Posts: 19
Oklahoma, USA
Zodiac Offline OP
Newbie
Zodiac  Offline OP
Newbie

Joined: May 2009
Posts: 19
Oklahoma, USA
Perfect!

Thanks Quadraxas, it works great now.


If everything seems to be going well, you have obviously overlooked something.

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1