aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-10-10 16:24:33 -0400
committerJesse Luehrs <doy@tozt.net>2014-10-10 16:24:33 -0400
commitc5499721bd16d242453fc5840216136c17da6fd9 (patch)
tree9bbfee1b3df59c8d10b14aea1648aa2f49ff6fa6
parent20af7436bb2cfed3ee27b1bb761e031d35905b3c (diff)
downloadnes-snake-c5499721bd16d242453fc5840216136c17da6fd9.tar.gz
nes-snake-c5499721bd16d242453fc5840216136c17da6fd9.zip
use a more gradual ramp up for speed
geometric instead of arithmetic progression, via a lookup table
-rw-r--r--main.s19
1 files changed, 15 insertions, 4 deletions
diff --git a/main.s b/main.s
index 705a9f1..7819d39 100644
--- a/main.s
+++ b/main.s
@@ -106,7 +106,7 @@ clrmem:
LDA #$04
LDX #$01
STA head_y, x
- LDA #35
+ LDA #20
STA frame_skip
; Second wait for vblank, PPU is ready after this
@@ -370,9 +370,9 @@ eat_apple:
STX length
AND #$07
BNE +
- LDX frame_skip
- DEX
- STX frame_skip
+ LDX length
+ LDA speed.w, x
+ STA frame_skip
+ JSR new_apple
end_game_loop:
@@ -699,6 +699,17 @@ game_background_middle: ; {{{
game_background_bottom: ; {{{
.asc " '----------------: "
; }}}
+speed: ; {{{
+ .db 20,20,20,19,19,19,19,19,19,19,18,18,18,18,18,18,18,17,17,17,17,17,17,17,
+ .db 17,16,16,16,16,16,16,16,16,16,15,15,15,15,15,15,15,15,15,14,14,14,14,14,
+ .db 14,14,14,14,13,13,13,13,13,13,13,13,13,13,13,12,12,12,12,12,12,12,12,12,
+ .db 12,12,11,11,11,11,11,11,11,11,11,11,11,11,10,10,10,10,10,10,10,10,10,10,
+ .db 10,10,10,10,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+ .db 8,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+ .db 6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,4,
+ .db 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,
+ .db 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
+; }}}
; }}}
.orga $FFFA ;first of the three vectors starts here
; interrupt vectors {{{