Log In  

Please help me write the correct code.
I would like something like that

if dir d_up then y=player.y+8,
if dir d_down then y=player.y+1,
if dir d_none or d_left or d_right then y=player.y+5

P#144819 2024-03-28 11:30

Hi. I'm not sure of your code basis but the idea goes like...

IF (BTN(0)) THEN X=X-1 END
IF (BTN(1)) THEN X=X+1 END
IF (BTN(2)) THEN Y=Y-1 END
IF (BTN(3)) THEN Y=Y+1 END

P#144829 2024-03-28 12:15

What kind of movement are you trying to achieve?
It is hard to tell from what you provided because everyting you do seems to move the player down, just by different amounts.
Do you want the player to move up or down as long as a button is pressed or does it need to stay in a position for as long as a button is pressed?
It is easier to help if we know what kind of game you are trying to make.

P#145099 2024-03-30 09:20

[Please log in to post a comment]