monkey: can pick up items

though only two at this point and you can't do anything with them
This commit is contained in:
Vince Weaver 2020-10-19 00:33:39 -04:00
parent 09dc8de953
commit 05d4e4bd50
9 changed files with 248 additions and 32 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -1,5 +1,5 @@
5 HOME
10 PRINT "LOADING MONKEY V0.04"
10 PRINT "LOADING MONKEY V0.05"
20 PRINT:PRINT
40 PRINT "CONTROLS: "
42 PRINT " MOVE CURSOR : ARROWS OR WASD"

View File

@ -414,16 +414,15 @@ location12:
.word chalice_string ; name
.word chalice_action-1 ; action
.byte 31,33 ; x
.byte 30,36 ; y
.word chicken_string ; name
.word chicken_pulley_action-1 ; action
.byte 29,39 ; x
.byte 36,40 ; y
.word trunk_string ; name
.word trunk_action-1 ; action
.byte 31,33 ; x
.byte 30,36 ; y
.word chicken_string ; name
.word chicken_pulley_action-1 ; action
; MONKEY_VOODOO2 -- voodoo lady
location13:
@ -503,6 +502,8 @@ bones_string: .byte "BONES",0
chalice_string: .byte "CHALICE",0
trunk_string: .byte "TRUNK",0
voodoo_knicknacks_string:.byte "VOODOO KNICKNACKS",0
chicken_pulley_string: .byte "CHICKEN PULLEY",0
null_string: .byte "NULL",0
; voodoo2 strings
voodoo_lady_string: .byte "VOODOO LADY",0

View File

@ -42,6 +42,15 @@ monkey_start:
sta DISPLAY_MESSAGE
sta BAR_DOOR_OPEN
sta VALID_NOUN
sta ITEMS_PICKED_UP
sta INVENTORY_NEXT_SLOT
sta INVENTORY
sta INVENTORY2
sta INVENTORY3
sta INVENTORY4
sta INVENTORY5
; init cursor
@ -51,8 +60,8 @@ monkey_start:
; set up initial location
; lda #MONKEY_BAR
lda #MONKEY_LOOKOUT
lda #MONKEY_BAR
; lda #MONKEY_LOOKOUT
; lda #MONKEY_VOODOO1
sta LOCATION
@ -100,6 +109,8 @@ game_loop:
beq do_draw_sign
cmp #MONKEY_VOODOO2
beq do_draw_smoke
cmp #MONKEY_BAR_INSIDE3
beq do_draw_meat
jmp nothing_special
@ -119,6 +130,10 @@ do_draw_smoke:
jsr draw_smoke
jmp nothing_special
do_draw_meat:
jsr draw_meat
jmp nothing_special
nothing_special:

View File

@ -64,23 +64,35 @@ bar_inside3_check_bounds:
rts
;draw_house:
; lda #<wall_sprite
; sta INL
; lda #>wall_sprite
; sta INH
;================================
;================================
; draw meat
;================================
;================================
draw_meat:
lda ITEMS_PICKED_UP
and #IPU_ITEM_MEAT
bne done_draw_meat
; lda #18
; sta XPOS
; lda #22
; sta YPOS
lda #<meat_sprite
sta INL
lda #>meat_sprite
sta INH
; jsr put_sprite_crop
lda #9
sta XPOS
lda #26
sta YPOS
; rts
jsr put_sprite_crop
done_draw_meat:
rts
;house_sprite:
meat_sprite:
.byte 3,2
.byte $3A,$8A,$AA
.byte $A3,$A8,$Af
;===================================
@ -172,6 +184,31 @@ table_actions:
;=============================
meat_action:
lda CURRENT_VERB
cmp #VERB_PICK_UP
bne meat_not_pickup
; pick up the meat
lda ITEMS_PICKED_UP
ora #IPU_ITEM_MEAT
sta ITEMS_PICKED_UP
; add to inventory
lda #INV_ITEM_MEAT
ldx INVENTORY_NEXT_SLOT
sta INVENTORY,X
inc INVENTORY_NEXT_SLOT
; decrement object count in room
ldy #LOCATION_NUM_AREAS
lda location14,Y
sec
sbc #1
sta location14,Y
rts
meat_not_pickup:
asl
tay

View File

@ -90,14 +90,37 @@ voodoo1_draw_foreground:
sta XPOS
lda #30
sta YPOS
jmp put_sprite_crop
jsr put_sprite_crop
lda ITEMS_PICKED_UP
and #IPU_ITEM_PULLEY_CHICKEN
bne done_voodoo1_draw_foreground
lda #<chicken_pulley_sprite
sta INL
lda #>chicken_pulley_sprite
sta INH
lda #30
sta XPOS
lda #30
sta YPOS
jsr put_sprite_crop
done_voodoo1_draw_foreground:
rts
voodoo1_fg_sprite:
.byte 20,2
.byte $AA,$8A,$88,$88,$8A,$AA,$AA,$AA,$AA,$AA
.byte $8A,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$77,$AA
.byte $8A,$08,$08,$80,$80,$88,$8A,$AA,$AA,$08
.byte $08,$08,$AA,$AA,$AA,$AA,$AA,$AA,$87,$57
.byte 12,2
.byte $AA,$8A,$88,$88,$8A,$AA,$AA,$AA,$AA,$AA,$8A,$AA
.byte $8A,$08,$08,$80,$80,$88,$8A,$AA,$AA,$08,$08,$08
chicken_pulley_sprite:
.byte 2,2
.byte $77,$AA
.byte $87,$57
;==========================
@ -431,6 +454,32 @@ trunk_look: .byte 8,21,"PROBABLY HAS A BODY IN IT",0
;=============================
chicken_pulley_action:
lda CURRENT_VERB
cmp #VERB_PICK_UP
bne chicken_pulley_not_pickup
; pick up the chicken_pulley
lda ITEMS_PICKED_UP
ora #IPU_ITEM_PULLEY_CHICKEN
sta ITEMS_PICKED_UP
; add to inventory
lda #INV_ITEM_PULLEY_CHICKEN
ldx INVENTORY_NEXT_SLOT
sta INVENTORY,X
inc INVENTORY_NEXT_SLOT
; decrement object count in room
ldy #LOCATION_NUM_AREAS
lda location12,Y
sec
sbc #1
sta location12,Y
rts
chicken_pulley_not_pickup:
asl
tay

View File

@ -104,9 +104,9 @@ no_message:
no_noun:
; stick zero at end
lda #0
tay
sta (OUTL),Y
; lda #0
; tay
; sta (OUTL),Y
; center it
lda #<(temp_line+2)
@ -154,13 +154,108 @@ bottom_loop:
cpx #18
bne bottom_loop
;======================================
; draw inventory
; draw /\
; draw ::
; draw \/
lda #<inv_up
sta OUTL
lda #>inv_up
sta OUTH
jsr move_and_print
jsr move_and_print
jsr normal_text
jsr move_and_print
;==============================
; print inventory, if any
lda INVENTORY
beq done_inventory
asl
tay
lda inventory_names,Y
sta INL
lda inventory_names+1,Y
sta INH
lda #<(temp_inv+2)
sta OUTL
lda #>(temp_inv+2)
sta OUTH
jsr strcat
lda #<(temp_inv)
sta OUTL
lda #>(temp_inv)
sta OUTH
lda #21
sta temp_inv+1
jsr move_and_print
lda INVENTORY2
beq done_inventory
asl
tay
lda inventory_names,Y
sta INL
lda inventory_names+1,Y
sta INH
lda #<(temp_inv+2)
sta OUTL
lda #>(temp_inv+2)
sta OUTH
jsr strcat
lda #<(temp_inv)
sta OUTL
lda #>(temp_inv)
sta OUTH
lda #22
sta temp_inv+1
jsr move_and_print
done_inventory:
rts
inventory_names:
.word null_string ; NULL
.word meat_string ; HUNK OF MEAT
.word chicken_pulley_string ; CHICKEN PULLEY
inv_up: .byte 22,21,"/\",0
inv_down: .byte 22,23,"\/",0
inv_middle: .byte 22,22,"::",0
temp_inv:
.byte 25,0," ",0
;0123456789012345678901234567890123456789
;
;GIVE PICK UP USE
;OPEN LOOK AT PUSH
;CLOSE TALK TO PULL
;GIVE PICK UP USE /\ HUNK O' MEAT
;OPEN LOOK AT PUSH :: CHICKEN PULLEY
;CLOSE TALK TO PULL \/
bottom_strings:
.word bottom_give
@ -230,6 +325,9 @@ strcat_done:
lda #0
adc OUTH
sta OUTH
lda #0
tay
sta (OUTL),Y ; NUL terminate
rts
;====================================

View File

@ -116,6 +116,22 @@ GUYBRUSH_SIZE = $98
GUYBRUSH_SMALL = 2
GUYBRUSH_TINY = 3
GUYBRUSH_FEET = $99
ITEMS_PICKED_UP = $9A
IPU_ITEM_MEAT = $01
IPU_ITEM_PULLEY_CHICKEN = $02
INV_ITEM_MEAT = $1
INV_ITEM_PULLEY_CHICKEN = $2
INVENTORY = $9B
INVENTORY2 = $9C
INVENTORY3 = $9D
INVENTORY4 = $9E
INVENTORY5 = $9F
INVENTORY_NEXT_SLOT = $A0
; done game puzzle state