Mike's Cookie Factory (WIP)

jim

Member
Finally got my bonus timer working right when you hit the elevator it shuts off and will add the remaining time to your score if there is none left you don't get anything added to your score.
https://streamable.com/64k17k

Level designs are next I guess.
 

Jonny

Well-known member
Nice one. I was thinking about that when playing Tiny Toons the other day. Is it difficult to do?
 
  • Like
Reactions: jim

jim

Member
I used the count-down timer from this thread but I added 2 extra variables to it.
variables.png

I tried adding my code for when it added the remaining time to the score when the player collided with the elevator but I kept getting weird numbers.
So I made a blank tile and put it behind my elevator and it works fine.

Code:
CPX player1_object
    
    BEQ +isPlayer
    JMP +notPlayer
    +isPlayer
    LDA myFuse
    CMP #03
    BEQ +isThree
    JMP +notThree
    +isThree
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; BELOW WILL CHANGE TILE AT COLLISION.
    
    ChangeTileAtCollision #$00, #$00
    
    ;MACRO AddValue arg0, arg1, arg2, arg3
    ;arg0 = how many places this value has.
    ;arg1 = home variable
    ;arg2 = amount to add
    ;arg3 = what place value is receiving the addition?
        ;;; 0 = ones place, 1 = tens place, 2 = hundreds place, etc.
    
    AddValue #$08, myScore, myTime_100, #$02
    AddValue #$08, myScore, myTime_1000, #$03
    UpdateHudElement #$03
+notPlayer:
+notThree

myFuse is the 3 red things you need to pick up for the elevator to open. I only added myTime_100 & myTime_1000 to myScore because the other two variables will always be zero.
 
Top Bottom