summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2015-03-25 21:03:45 -0700
committerMarcus Huderle <huderlem@gmail.com>2015-03-25 21:03:45 -0700
commitcdb764e220019ec5137e7d25f57babaa7f852975 (patch)
treeee5b4d5e522e690a7a6177629a58791cb3117f51
parente4809fed486ee722437268014f4c6d28e1ea749f (diff)
Gravity routine.
-rwxr-xr-xmain.asm17
1 files changed, 16 insertions, 1 deletions
diff --git a/main.asm b/main.asm
index 157a706..7ea3ce3 100755
--- a/main.asm
+++ b/main.asm
@@ -3802,7 +3802,22 @@ Func_208c: ; 0x208c
scf
ret
-INCBIN "baserom.gbc",$20ab,$219c - $20ab
+INCBIN "baserom.gbc",$20ab,$216d - $20ab
+
+Func_216d: ; 0x216d
+ ld de, $000b ; gravity added to y velocity every frame
+ ld hl, wBallYVelocity
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ add hl, de
+ ld a, l
+ ld [wBallYVelocity], a
+ ld a, h
+ ld [$d4be], a
+ ret
+
+INCBIN "baserom.gbc",$2180,$219c - $2180
MoveBallPosition: ; 0x219c
; Updates the ball's position according to its velocity