Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; simpler movement
- lda keydown,x
- and #15
- tay
- lda TargetAngles,y
- bmi ExitToNotCar ; not a valid angle to target
- sta target ; target = target
- lda PlayerShootAngle,x
- sta current
- sub target
- bpl :+ ; absolute value
- eor #255
- add #1
- : sta difference ; difference = the absolute value of the difference
- beq ExitToNotCar ; difference = target? don't turn
- cmp #16 ; turning 180 degrees? just instantly flip
- bne :+
- lda PlayerShootAngle,x
- add #16
- sta PlayerShootAngle,x
- jmp ExitToNotCar
- :
- cmp #16
- bcs :+
- lda current
- cmp target
- bcc :+
- dec PlayerShootAngle,x
- jmp ExitToNotCar
- :
- lda difference
- cmp #16
- bcc :+
- lda current
- cmp target
- bcs :+
- dec PlayerShootAngle,x
- jmp ExitToNotCar
- :
- inc PlayerShootAngle,x
- ExitToNotCar:
- lda PlayerShootAngle,x ; restrict to the range of target-31
- and #31
- sta PlayerShootAngle,x
- jmp NotRacecar
- TargetAngles: ;up, down, left, right
- .byt <-1, 0, 16, <-1, 8, 4, 12, <-1
- .byt 24, 28, 20, <-1, <-1, <-1, <-1, <-1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement