Skip to content

Instantly share code, notes, and snippets.

@undergroundmonorail
Last active January 7, 2017 22:06
Show Gist options
  • Select an option

  • Save undergroundmonorail/2ae51ae8aa5a2bc64103abb930ae9847 to your computer and use it in GitHub Desktop.

Select an option

Save undergroundmonorail/2ae51ae8aa5a2bc64103abb930ae9847 to your computer and use it in GitHub Desktop.
; before
.ballHorizontal
ld a,[BallXVector]
ld b,a
ld a,[BallXAddr]
add b
.rightWall
cp $98
jr z,.xFlip
.leftWall
cp $10
jr nz,.ballVertical
.xFlip
...
.ballVertical
...
; after
.ballHorizontal
ld a,[BallXVector]
ld b,a
ld a,[BallXAddr]
add b
.rightWall
cp $98
jr z,.xFlip
jr c,.leftWall
sub $99
cpl
add $98
jr z,.xFlip
.leftWall
cp $10
jr z,.xFlip
jr nc,.doneXCollision
sub $10
cpl
add $11
.doneXCollision
ld [BallXAddr],a
.xFlip
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment