プレイ日記
Diom thexzambie
I cant figure out what's wrong!!! Every time I press up on the d-pad, the sprite goes to the top-left of the screen. PLEASE HELP!!!
1そうだね
プレイ済み
返信[1]
親投稿
Aaron Krondelo
Why you have Y-20, that may be whats causing that.
1そうだね
プレイ済み
返信[2]
親投稿
mystman12 mystman12
Are you actually changing the X and Y variables? Those are going to control the sprite's location the way you have this programmed.
2そうだね
プレイ済み
返信[3]
親投稿
Aaron Krondelo
Oh yeah what mystman12 said, for example, you need X=X+1 when you push right and X=X-1 when you push left.
1そうだね
プレイ済み
返信[4]
親投稿
Diom thexzambie
I'm still stumped. Where would I put those?
0そうだね
プレイ済み
返信[5]
親投稿
mystman12 mystman12
You would put those in the same place as the rest of the movement code. For example, for moving up you would put Y=Y-1 underneath @MVUP. The X and Y variables should be used to keep track of the player's coordinates. For example, if X=128 and Y=64, you (probably) want the sprite to be at those coordinates. By changing these values, you can easily control the player's location.
1そうだね
プレイ済み
返信[6]
親投稿
Aaron Krondelo
B=BUTTON(2) IF B AND #UP THEN Y=Y-1 VSYNC 1 ENDIF IF B AND #DOWN THEN Y+Y+1 VSYNC 1 ENDIF
1そうだね
プレイ済み