Gamestudio Links
Zorro Links
Newest Posts
Removing outliers from files
by jcl. 11/04/26 10:30
[MED] Import from FBX (2010) missing!!!
by rayp. 11/03/26 14:33
What are you working on?
by rayp. 11/02/26 13:57
No connection to MT4
by JeyKey II. 10/29/26 09:34
Zorro plugin for Hyperliquid.xyz
by opm. 10/28/26 13:50
Icon "OP"
by JeyKey II. 10/27/26 07:03
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (EW_bytes, 1 invisible), 11,430 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
dabolong, MaliceTheMaker, Haitao_Ren, JimSimons, julienp
19249 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Moving a 2D sprite step by step #330699
06/29/10 11:57
06/29/10 11:57
Joined: Jun 2007
Posts: 15
Norway
G
Gastara Offline OP
Newbie
Gastara  Offline OP
Newbie
G

Joined: Jun 2007
Posts: 15
Norway
Hi!

I try to figure out how to move a 2d player sprite forward in just one step each time the forward key is pressed.
The player needs to press the forward key each time when moving the player sprite.
Every time it moves forward, it moves for example 60 pixels at a time.
Then you need to press the key again to move to the next step. So the idea is to move the sprite step by step.
Someone who knows a solution for this?

Re: Moving a 2D sprite step by step [Re: Gastara] #330700
06/29/10 12:13
06/29/10 12:13
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
Code:
var move_lock = 0;
...

while(1)
{
	if(key_cuu && (!move_lock))
	{
		move_lock = 1;
		... // move your sprite
	}
	if(!key_cuu) move_lock = 0;
	wait(1);
}



Re: Moving a 2D sprite step by step [Re: Lukas] #330701
06/29/10 12:24
06/29/10 12:24
Joined: Jun 2007
Posts: 15
Norway
G
Gastara Offline OP
Newbie
Gastara  Offline OP
Newbie
G

Joined: Jun 2007
Posts: 15
Norway

Nice, thank u very much.smile


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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