Gamestudio Links
Zorro Links
Newest Posts
MRC.c and WFO
by 11honza11. 11/18/25 15:22
webGL
by Ice2642. 11/17/25 21:27
Camera always moves upwards?
by NeoDumont. 11/17/25 09:56
Future of ZorroHFT
by TipmyPip. 11/16/25 13:52
COT Download with Quandl does not work
by Petra. 11/15/25 09:35
Training with the R bridge does not work
by Petra. 11/15/25 09:31
Zorro 2.70
by jcl. 11/15/25 08:43
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (AndrewAMD, Quad), 32,974 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
SkinnyApe, tritom, sheliepaley, Blueguy, blobplayintennis
19179 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 Online
Senior Expert
Quad  Online
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