Moving Left and Right

Previous topic - Next topic

Lockdown

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.

Kitty Hello

[url]http://www.glbasic.com/forum/viewtopic.php?id=304[/rul]

See Reply #3

Lockdown

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.

Kitty Hello

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?