GLBasic forum

Main forum => GLBasic - en => Topic started by: Lockdown on 2006-Jul-20

Title: Moving Left and Right
Post by: Lockdown on 2006-Jul-20
I want to be able to move my character left and right with the arrow keys. Whats the code? By left and right I mean like a side scroller game.
Title: Moving Left and Right
Post by: Kitty Hello on 2006-Jul-20
[url]http://www.glbasic.com/forum/viewtopic.php?id=304[/rul]

See Reply #3
Title: Moving Left and Right
Post by: Lockdown on 2006-Jul-20
Yeah I watched that and it doesn't tell you how to make your character move left and right, not up and down with jumping.
Title: Moving Left and Right
Post by: Kitty Hello on 2006-Jul-21
If you look at the source code and understand it, it would be easy for you to find out the keycodes for left-right and insert somethins like:

Code (glbasic) Select
plx = 320
...
dx = 0
dx = dx + KEY(right)
dx = dy - KEY(left)

plx = plx + dx
SPRITE number, plx, ply
Got the picture?