Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char_jump:
- ld a,(charJ) ;get the switch for if char is jumping
- or a ;check if it is
- ret nz ;if it is return
- ld a,(charT+1) ;get y
- inc a ;get y+1
- inc a ;get y+2
- ld e,a
- ld a,(charT) ;get x
- ld d,a
- call Tile_value ;get tile properties of (x,y+2)
- call TileType
- jr z,_ ;if solid test position
- cp 10 ;if ladder
- jr z,_ ;test position
- inc d ;check x+1
- call Tile_value ;get tile properties of (x+1,y-1)
- call TileType
- jr z,++_ ;if solid test x position
- cp 10 ;if ladder
- jr z,_ ;test x position
- ret ;otherwise do normal stuff
- _ ;test position
- dec e ;decrease y back to characters tile
- getoffsetE ;get tiles edge
- ld e,a ;store it back to d
- getY ;get the characters edge
- add a,16
- cp e ;compare
- jr nc,++_ ;if it is more then one past then it is right up against the edge, or it is in the tile
- _ ;test x position
- getoffsetD ;get tiles edge
- ld d,a ;store it back to d
- getX ;get the characters edge
- add a,8
- cp d ;compare
- ret z ;if it is more then one past then it is right up against the edge, or it is in the tile
- _ ld a,(BlackMageStats+hover) ;get jump pleteu value
- ld (charJ),a ;store it
- ld a,(BlackMageStats+jump) ;store jump stats to a
- ld (charJ+1),a ;store that value to the jump counter
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement