Hello.
I've set up a room so that when the player is surfing, he automatically goes downwards. Here's a crude diagram of what I'm trying to convey:
PW
WW
WW
XX
where P is the player facing right, W is water, and X is dry land. When the player gets on his pokemon and surfs, he'll initially go right as normally, but then he'll be forced downward on the blue path until he reaches the red X, as if by a current. I've gotten that part down, but I have two problems that I cannot solve:
1. Here's an excerpt of the script that forces the player downward when sloping:
LD A, ($C45C) ; check tile under player
CP $14 ; is it water?
JP NZ, $3219 ; if not, then jump away to address irrelevant for this question
LD A, $80 ; down
LD ($CCD3), A ; simulated joypad states end
LD A, $01 ; one simulated button press
LD ($CD38), A ; simulated joypad states index
CALL $3486 ; start simulating joypad states
He'll go down automatically, but if I hold any other button, he'll go in that direction as well. This is a similar effect to what happens in the Cycling Road. How do I make sure that he'll always go down and only down when he's surfing, no matter what buttons are pressed?
EDIT (2/10/16, 2:38 PM): RESOLVED.
2. The player will eventually reach land and will stop, but the game still thinks he's surfing, i.e. 0xD700 is set to $02. If the player goes further inland, the game then realizes he's walking and goes back to normal. I want the player to stop surfing and begin walking as soon as he reaches land, without having a button being pressed. How do I do that?
EDIT (2/10/16, 6:23 PM): RESOLVED.
Thanks in advance for any help you give.
I've set up a room so that when the player is surfing, he automatically goes downwards. Here's a crude diagram of what I'm trying to convey:
PW
WW
WW
XX
where P is the player facing right, W is water, and X is dry land. When the player gets on his pokemon and surfs, he'll initially go right as normally, but then he'll be forced downward on the blue path until he reaches the red X, as if by a current. I've gotten that part down, but I have two problems that I cannot solve:
LD A, ($C45C) ; check tile under player
CP $14 ; is it water?
JP NZ, $3219 ; if not, then jump away to address irrelevant for this question
LD A, $80 ; down
LD ($CCD3), A ; simulated joypad states end
LD A, $01 ; one simulated button press
LD ($CD38), A ; simulated joypad states index
CALL $3486 ; start simulating joypad states
He'll go down automatically, but if I hold any other button, he'll go in that direction as well. This is a similar effect to what happens in the Cycling Road. How do I make sure that he'll always go down and only down when he's surfing, no matter what buttons are pressed?
EDIT (2/10/16, 2:38 PM): RESOLVED.
EDIT (2/10/16, 6:23 PM): RESOLVED.
Thanks in advance for any help you give.
Last edited: