Pursuing Tom Ram

Game available in Itch.io.

Soruce code in Github.

Programming adventures in VIC-20.


One puzzle. Diary

Branch distance has a limit.

A text adventure is not funny if there is no puzzles to solve. I will explain you a couple of puzzles from Pursuing Tom Ram.

One of the first puzzles is to read the diary.

If player tries to read de diary in the very beginning of the game, you will find that you understand nothing due its fuzzy characters.

If player takes the glasses and examine it, you will see everything fuzzy. Fuzzy is the clue. If you read the diary wearing your glasses in the inventory (you have not to do anything else) you will understand the diary.

  
;- Read diary with classes
Read_CMD
        ; loc is desktop
        cmp #LOC_LIBRARY
        bne P_Useless

        ; Name es diary
        lda name_index
        cmp #DIARY_IND
        bne P_Useless

        ; Player has glasses in inventory
        ldx #GLASSES_IND
        jsr Item_In_Inventory        
        bne P_Understand_Nothing

        ; print message
        lda #str_read_diary
        jsr PRTSTR

        ; Set flag 0.
        ; The game knows if diary is read
        ; using this flag
        ldy #$0
        jsr set_flag_y

        rts

; If player is not in desktop or try to read
; a thing it is not a diary.
P_Useless
        lda #str_useless
        jsr PRTSTR
        rts

; Readin the diary witthout the glasses
; This is clue, that player needs glasses
P_Understand_Nothing
        lda #str_understand_nothing
        jsr PRTSTR
        rts


  

It seems a lot of code, but it is the same one, once and again. This is the only valid use of REad verb, so all code in in its subroutine.

I know that this puzzle may be so easy that players try to resolve it in a more complex way.