Need Monster Actions for "Move Up" and "Move Down"...

Icon-Ninja

New member
Been looking through the forums for days, but can't really find a solution, and I haven't been successful on my own, but I need "Move Up" and "Move Down" actions for an enemy in my game. I know there's the "Move Random UD" action, but I don't need it to be random, I need to be able to arbitrarily make the enemy move up or down based on its animation state (a "flap wings when going up, glide when going down" kind of logic). I tried simply copying from the "Move Left" action step script and just change the bit for which axis to move on and which accumulator value to look at, but it seems to break everything when I try it that way. It doesn't make much sense to me that there are action steps for "Move Left" and "Move Right" but not "Move Up" or "Move Down" (in 3.1.5). Any of you ASM heroes have a suggestion? Thanks.
 

dale_coop

Moderator
Staff member
You could try those scripts...

AI "MoveUp" script:
Code:
    LDA #%00000100 ;;up
    TAY
    LDA DirectionMovementTable,y
    STA temp
    TYA ;; the 0-7 value for direction
    ORA temp
    STA Object_movement,x

AI "MoveDown" script:
Code:
    LDA #%00000000 ;; down
    TAY
    LDA DirectionMovementTable,y
    STA temp
    TYA ;; the 0-7 value for direction
    ORA temp
    STA Object_movement,x


PS: If your game is a platformer, don't forget to fix the "Ignore Gravity" (in the Community Tutorials section)
 

Icon-Ninja

New member
dale_coop said:
You could try those scripts...

AI "MoveUp" script:
Code:
    LDA #%00000100 ;;up
    TAY
    LDA DirectionMovementTable,y
    STA temp
    TYA ;; the 0-7 value for direction
    ORA temp
    STA Object_movement,x

AI "MoveDown" script:
Code:
    LDA #%00000000 ;; down
    TAY
    LDA DirectionMovementTable,y
    STA temp
    TYA ;; the 0-7 value for direction
    ORA temp
    STA Object_movement,x


PS: If your game is a platformer, don't forget to fix the "Ignore Gravity" (in the Community Tutorials section)

Thanks, Dale. Will give these a try (and yeah, I did the gravity fix some time ago). ;)
 
Top Bottom