diff --git a/games/lemm/Makefile b/games/lemm/Makefile index 140795fe..6663995e 100644 --- a/games/lemm/Makefile +++ b/games/lemm/Makefile @@ -188,6 +188,7 @@ lemm.inc: generate_common LEMM ./generate_common -a 0x6000 -s update_remaining lemm.lst >> lemm.inc ./generate_common -a 0x6000 -s update_remaining_all lemm.lst >> lemm.inc ./generate_common -a 0x6000 -s collision_check_hazzard lemm.lst >> lemm.inc + ./generate_common -a 0x6000 -s collision_check_hazzard2 lemm.lst >> lemm.inc #### @@ -260,7 +261,7 @@ LEVEL7: level7.o level7.o: level7.s zp.inc hardware.inc qload.inc lemm.inc \ release_lemming.s \ - graphics/graphics_level7.inc + graphics/graphics_level7.inc graphics/l7_animation.inc ca65 -o level7.o level7.s -l level7.lst #### diff --git a/games/lemm/graphics/Makefile b/games/lemm/graphics/Makefile index 62f2b3a7..e7f167b3 100644 --- a/games/lemm/graphics/Makefile +++ b/games/lemm/graphics/Makefile @@ -18,7 +18,8 @@ all: graphics_test.inc \ graphics_level10.inc \ sprites.inc \ l4_animation.inc \ - l6_animation.inc + l6_animation.inc \ + l7_animation.inc @@ -118,7 +119,17 @@ l6_animation.inc: level_animations.png $(HGR_SPRITE) -s -l flame6_sprite level_animations.png 0 85 27 93 >> l6_animation.inc $(HGR_SPRITE) -s -l flame7_sprite level_animations.png 28 86 34 87 >> l6_animation.inc +### +l7_animation.inc: level_animations.png + $(HGR_SPRITE) -s -l spinner0_sprite level_animations.png 126 13 153 18 > l7_animation.inc + $(HGR_SPRITE) -s -l spinner1_sprite level_animations.png 126 31 153 36 >> l7_animation.inc + $(HGR_SPRITE) -s -l spinner2_sprite level_animations.png 126 49 153 54 >> l7_animation.inc + $(HGR_SPRITE) -s -l spinner3_sprite level_animations.png 126 67 153 72 >> l7_animation.inc + $(HGR_SPRITE) -s -l spinner4_sprite level_animations.png 126 85 153 90 >> l7_animation.inc + $(HGR_SPRITE) -s -l spinner5_sprite level_animations.png 126 103 153 108 >> l7_animation.inc + $(HGR_SPRITE) -s -l spinner6_sprite level_animations.png 126 121 153 126 >> l7_animation.inc + $(HGR_SPRITE) -s -l spinner7_sprite level_animations.png 126 139 153 144 >> l7_animation.inc ### diff --git a/games/lemm/graphics/level7.png b/games/lemm/graphics/level7.png index a4f63e21..0af5fdcb 100644 Binary files a/games/lemm/graphics/level7.png and b/games/lemm/graphics/level7.png differ diff --git a/games/lemm/graphics/level_animations.png b/games/lemm/graphics/level_animations.png index 4e012f64..8a6275d1 100644 Binary files a/games/lemm/graphics/level_animations.png and b/games/lemm/graphics/level_animations.png differ diff --git a/games/lemm/level7.s b/games/lemm/level7.s index c20a4be5..b78dd454 100644 --- a/games/lemm/level7.s +++ b/games/lemm/level7.s @@ -229,10 +229,22 @@ l7_door_is_open: jsr draw_flames + ;===================== + ; update timer + ;===================== + jsr update_timer + ;===================== + ; draw level animation + ;===================== + jsr draw_spinners + + + ;=================== ; main drawing loop + ;=================== jsr erase_lemming @@ -240,6 +252,11 @@ l7_door_is_open: jsr move_lemmings + ;========================= + ; extra check if hit slicer + + jsr collision_check_hazzard2 + jsr draw_lemming jsr handle_keypress @@ -303,3 +320,83 @@ level7_intro_text: .byte 13,18,"TIME 5 MINUTES",0 .byte 15,20,"RATING FUN",0 .byte 8,23,"PRESS RETURN TO CONTINUE",0 + +.include "graphics/l7_animation.inc" + + ;=================== + ; spinners + ;=================== + +draw_spinners: + + ; top + + lda FRAMEL + and #$7 + tay + + lda spinner_sprites_l,Y + sta INL + lda spinner_sprites_h,Y + sta INH + + lda #18 + sta XPOS + + lda #49 + sta YPOS + + jsr hgr_draw_sprite + + ; right + + lda FRAMEL + and #$7 + tay + + lda spinner_sprites_l,Y + sta INL + lda spinner_sprites_h,Y + sta INH + + lda #32 + sta XPOS + + lda #109 + sta YPOS + + jsr hgr_draw_sprite + + ; left + + lda FRAMEL + and #$7 + tay + + lda spinner_sprites_l,Y + sta INL + lda spinner_sprites_h,Y + sta INH + + lda #6 + sta XPOS + + lda #109 + sta YPOS + + jsr hgr_draw_sprite + + + rts + +spinner_sprites_l: + .byte spinner0_sprite,>spinner1_sprite + .byte >spinner2_sprite,>spinner3_sprite + .byte >spinner4_sprite,>spinner5_sprite + .byte >spinner6_sprite,>spinner7_sprite diff --git a/games/lemm/move_lemming.s b/games/lemm/move_lemming.s index 67bc4a5a..46765b24 100644 --- a/games/lemm/move_lemming.s +++ b/games/lemm/move_lemming.s @@ -1008,6 +1008,9 @@ collision_check_hazzard: check_hazzard_loop: ldy CURRENT_LEMMING + lda lemming_out,Y + beq continue_check_hazzard + lda lemming_y,Y cmp #130 bcs in_hazzard @@ -1035,3 +1038,45 @@ continue_check_hazzard: rts + + ;============================= + ; check if hit hazzard2 + ;============================= + ; TODO: make configurable +collision_check_hazzard2: + ldy #0 + sty CURRENT_LEMMING + +check_hazzard_loop2: + ldy CURRENT_LEMMING + + lda lemming_out,Y + beq continue_check_hazzard2 + + lda lemming_x,Y + cmp #10 + + bcs continue_check_hazzard2 + +in_hazzard2: + + lda lemming_status,Y + cmp #LEMMING_SPLATTING + beq continue_check_hazzard2 ; don't re-splat + + lda #LEMMING_SPLATTING + sta lemming_status,Y + + lda #0 + sta lemming_frame,Y + +continue_check_hazzard2: + + inc CURRENT_LEMMING + lda CURRENT_LEMMING + cmp #MAX_LEMMINGS + bne check_hazzard_loop2 + + rts + +