Advertisement
NovaYoshi

two enemy implementations

Jan 9th, 2016
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .proc ObjectGoomba
  2.   jsr EnemyFall
  3.   lda #$10
  4.   jsr EnemyWalk
  5.   jsr EnemyAutoBump
  6. ;  jsr EnemyPlayerTouchHurt
  7.  
  8.   ; cycle between four frames
  9.   lda retraces
  10.   lsr
  11.   lsr
  12.   lsr
  13.   and #3
  14.   tay
  15.   lda Frames,y
  16.   ldy #OAM_COLOR_2
  17.   jsr DispEnemyWide
  18.  
  19.   ; check if the player is touching the Goomba and whether to hurt the player or flatten
  20.   jsr EnemyPlayerTouch
  21.   bcc NoTouch
  22.   lda PlayerDrawY
  23.   add #8
  24.   cmp O_RAM::OBJ_DRAWY
  25.   bcc FlattenGoomba
  26.   jsr HurtPlayer
  27.   jsr EnemyTurnAround
  28. NoTouch:
  29.   rts
  30. Frames:
  31.   .byt $0c, $10, $14, $10
  32. .endproc
  33.  
  34. .proc ObjectOwl
  35.   lda #$10
  36.   jsr EnemyWalkOnPlatform
  37.  
  38.   ; cycle between two frames
  39.   lda retraces
  40.   and #4
  41.   add #$18
  42.   ldy #OAM_COLOR_2
  43.   jsr DispEnemyWide
  44.   jmp EnemyPlayerTouchHurt
  45. .endproc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement