Api The Cat - Development Thread [4.5.9]

mouse spirit

Well-known member
Very cool. Im a workaround type of person. I will try to think of ideas for the frog incase it poses a problem to code it that way.

My first idea is using two monsters,but that may not be ideal.
The tongue could be behind the frog ,but move left,then back to the right and stop behind the frog again.
If it gets blured or cant decides what should be in front,just also edit the toungue graphic accordingly.
I hope you know what i mean.
 
Last edited:

Barry2

Member
To hide the HUD you just need to put a check at the start of your doDrawSpriteHUD.asm so the script jumps past the part of the script which draws the sprites for the HUD. JMP skipAll goes to the skipAll: defined at the end so the HUD doesn't draw unless on game.

Something like this...

Code:
    LDA gameState         ;; CHECK GAMESTATES             ;;
    CMP #$00              ;;                              ;;
    BEQ onMainGame        ;; IS MAIN GAME                 ;;
    JMP skipAll
 
onMainGame:
 
;;;;;;;;;; YOUR SPRITE HUD SCRIPT GOES HERE ;;;;;;;;;;;;;;;;

skipAll:

If you haven't already you would need to use a different gamestate for your startscreen. Maybe #$01 but any will do. This is set where you build screens underneath Tile Layout there's a drop down menu.
Hey @Jonny Im not seeing my doDrawSpriteHUD.ams, could you tell me where to locate it at. THANKS
 

Barry2

Member
So I have copied the code over to my doDrawSpriteHud, im alittle confused on what to change my LDA too. Ive tried #$01 because its the second one on my drop down menu as start screen but it doesnt seem to be working. Ive tried differend numbers but they arent work nor do they make sense to you 02 or 03, Ive tried using StartScreen, StartScreem_2, but i get a error saying that line of the code is out of vaule. Can you be of any help?


Code:
;;; Here is an example of how to do a sprite hud.
;;; Arg5, the one that has the value of myVar, must correspond to a user variable you have in your game.
;;; Don't forget, you can only draw 8 sprites per scanline, so a sprite hud can only be 8 sprites wide max.



;DrawSpriteHud #$08, #$08, #$11, #$10, #$10, myVar, #$00
    ; arg0 = starting position in pixels, x
    ; arg1 = starting position in pixels, y
    ; arg2 = sprite to draw, CONTAINER
    ; arg3 = MAX   
    ; arg4 = sprite to draw, FILLED
    ; arg5 = variable.
    ; arg6 = attribute

    LDA #01             ;; CHECK GAMESTATES             ;;
    CMP #$00              ;;                              ;;
    BEQ onMainGame        ;; IS MAIN GAME                 ;;
    JMP skipAll
 
onMainGame:
 
;;;;;;;;;; YOUR SPRITE HUD SCRIPT GOES HERE ;;;;;;;;;;;;;;;;

skipAll:
        
DrawSpriteHud #16, #16, #$78, #$03, #$76, myHealth, #%00000001  ;;;; this draws lives

DrawSpriteHud #16, #24, #$79, #$05, #$77, myAmmo, #%00000000 ;; this draws ammo
The Handle Drawing Sprite Hud :

View attachment 5908
 

dale_coop

Moderator
Staff member
Try:

Code:
    LDA gameState         ;; CHECK GAMESTATES             ;;
    CMP #$01              ;; "Start Screen" game state    ;;
    BEQ onStartScreen     ;; IS START SCREEN              ;;
        JMP skipAll
   
onStartScreen:
 

latetera

Member
Hi everyone! After a long time, I'm back to my video game. I have been improving, including the timer and my hero hurt animation.
I also finished the monsters and animations on my "level 8" and finally have the background animated <3.

The scoring system needs implementation. As "My Hero" does not attack the other enemies or catch any coins, I think that the way to collect points is the timer; as it goes down, the time number when you finish the level are the points you get at the score, but I have no idea how to implement this. If anyone has some help with this, please post a comment.


Api The Cat - Level 8 (part 01).gif
 
Hi everyone! After a long time, I'm back to my video game. I have been improving, including the timer and my hero hurt animation.
I also finished the monsters and animations on my "level 8" and finally have the background animated <3.

The scoring system needs implementation. As "My Hero" does not attack the other enemies or catch any coins, I think that the way to collect points is the timer; as it goes down, the time number when you finish the level are the points you get at the score, but I have no idea how to implement this. If anyone has some help with this, please post a comment.


View attachment 7284
I can try... Can I see the script(s?) for the timer? Becauae that's where we should start freezing the timer at the end of the level (meaning check if it's beaten before the timer script continues)
followed by a separate segment you JMP to so it makes it countdown fast and add the score simultaneously... I think that's how it should be done at least
 

latetera

Member
I can try... Can I see the script(s?) for the timer? Becauae that's where we should start freezing the timer at the end of the level (meaning check if it's beaten before the timer script continues)
followed by a separate segment you JMP to so it makes it countdown fast and add the score simultaneously... I think that's how it should be done at least
Thank you so much for your help, sorry that I haven´t seen this message earlier

This is my handleGameTimer.asm full file. The details about the timer are at the end of the file

Code:
LDA userScreenByte7
BEQ +dontUpdateAnimatedTiles ;;making sure that this screen actually has animated tiles set up - thanks CGT
DEC animTimer
LDA animTimer
BNE +dontUpdateAnimatedTiles
    LDA #$10        ;;i'm using 10 as a starting point for animTimer
    STA animTimer
    INC animFrame
    LDA animFrame
    CMP #$03 ;;has it gone over the number of banks we filled?
    BEQ +resetAnimation
        SwitchCHRBank animFrame
        JMP +dontUpdateAnimatedTiles
    +resetAnimation
    LDA #$00
    STA animFrame
    SwitchCHRBank #$00
+dontUpdateAnimatedTiles

;;; APITheCat
;;; If the player is hurt (hurtTimer > 0), decrease the timer once per frame
LDA hurtTimer
BEQ +notTimingHurt
  DEC hurtTimer
+notTimingHurt

;;; APITheCat: Handle screen timer
LDA myTimeFrameCounter ; Load the frame counter (va de 60 a 0)
BNE +advanceFrameTimer ; If not zero, jumps to +advanceFrameTimer.

; It's zer! time to update the clock numbers
LDA #60 ; let's put the frame number on 60 again
STA myTimeFrameCounter ; loads 60 on the frame timer

DEC myTime ; Subtracting 1 to myTime (save values in the last digit XX5)
BPL +advanceFrameTimer ; if after subtract, the number is positive, we jump to the final
    LDA #09 ; otherwise, we are in -1. loading 9 to the last digit
    STA myTime
    DEC myTime10 ; subtracting one to the second digit X5X
    BPL +advanceFrameTimer ; again, if the result of the second digit is positive, jump to the final
        LDA #09 ; if negative, loading 9 to the second digit
        STA myTime10
        DEC myTime100 ; and we subtract 1 to the first digit (1XX)
        BPL +advanceFrameTimer ; If the result is positive, we jump to the final
            JMP RESET ; If not, time is out, going to the reset

+advanceFrameTimer ; subtract one to the frame counter
DEC myTimeFrameCounter
 
Thank you so much for your help, sorry that I haven´t seen this message earlier

This is my handleGameTimer.asm full file. The details about the timer are at the end of the file

Code:
LDA userScreenByte7
BEQ +dontUpdateAnimatedTiles ;;making sure that this screen actually has animated tiles set up - thanks CGT
DEC animTimer
LDA animTimer
BNE +dontUpdateAnimatedTiles
    LDA #$10        ;;i'm using 10 as a starting point for animTimer
    STA animTimer
    INC animFrame
    LDA animFrame
    CMP #$03 ;;has it gone over the number of banks we filled?
    BEQ +resetAnimation
        SwitchCHRBank animFrame
        JMP +dontUpdateAnimatedTiles
    +resetAnimation
    LDA #$00
    STA animFrame
    SwitchCHRBank #$00
+dontUpdateAnimatedTiles

;;; APITheCat
;;; If the player is hurt (hurtTimer > 0), decrease the timer once per frame
LDA hurtTimer
BEQ +notTimingHurt
  DEC hurtTimer
+notTimingHurt

;;; APITheCat: Handle screen timer
LDA myTimeFrameCounter ; Load the frame counter (va de 60 a 0)
BNE +advanceFrameTimer ; If not zero, jumps to +advanceFrameTimer.

; It's zer! time to update the clock numbers
LDA #60 ; let's put the frame number on 60 again
STA myTimeFrameCounter ; loads 60 on the frame timer

DEC myTime ; Subtracting 1 to myTime (save values in the last digit XX5)
BPL +advanceFrameTimer ; if after subtract, the number is positive, we jump to the final
    LDA #09 ; otherwise, we are in -1. loading 9 to the last digit
    STA myTime
    DEC myTime10 ; subtracting one to the second digit X5X
    BPL +advanceFrameTimer ; again, if the result of the second digit is positive, jump to the final
        LDA #09 ; if negative, loading 9 to the second digit
        STA myTime10
        DEC myTime100 ; and we subtract 1 to the first digit (1XX)
        BPL +advanceFrameTimer ; If the result is positive, we jump to the final
            JMP RESET ; If not, time is out, going to the reset

+advanceFrameTimer ; subtract one to the frame counter
DEC myTimeFrameCounter
this might be a bit sloppy... but try this:
;;; APITheCat: Handle screen timer
LDA levelClear
BNE +continueFrameTimer
JMP +levelClearPoints
+continueFrameTimer
LDA myTimeFrameCounter ; Load the frame counter (va de 60 a 0)
BNE +advanceFrameTimer ; If not zero, jumps to +advanceFrameTimer.
; It's zer! time to update the clock numbers
LDA #60 ; let's put the frame number on 60 again
STA myTimeFrameCounter ; loads 60 on the frame timer

DEC myTime ; Subtracting 1 to myTime (save values in the last digit XX5)
BPL +advanceFrameTimer ; if after subtract, the number is positive, we jump to the final
LDA #09 ; otherwise, we are in -1. loading 9 to the last digit
STA myTime
DEC myTime10 ; subtracting one to the second digit X5X
BPL +advanceFrameTimer ; again, if the result of the second digit is positive, jump to the final
LDA #09 ; if negative, loading 9 to the second digit
STA myTime10
DEC myTime100 ; and we subtract 1 to the first digit (1XX)
BPL +advanceFrameTimer ; If the result is positive, we jump to the final
JMP RESET ; If not, time is out, going to the reset

+advanceFrameTimer ; subtract one to the frame counter
DEC myTimeFrameCounter
RTS

+levelClearPoints
LDA myTime
BEQ +donewithlevel
DEC myTime
INC myPoints
JMP +levelClearPoints
+donewithlevel
RTS
obviously keep the part above
;;; APITheCat: Handle screen timer
but just replace what's below and try that
 

latetera

Member
this might be a bit sloppy... but try this:

obviously keep the part above

but just replace what's below and try that
Thank you so much for your help!

I'm having these warnings

Routines\BASE_4_5\Game\Subroutines\handleGameTimer.asm(28): Unknown label.
Routines\BASE_4_5\Game\Subroutines\handleGameTimer.asm(58): Unknown label.
Routines\BASE_4_5\Game\Subroutines\handleGameTimer.asm(59): Unknown label.

on line 28 "levelClear"
on line 58 "myPoints"
and on line 59 "levelClearPoints"

Sorry, but I don't know how to implement these variables. Can I ask you how?
 

latetera

Member
Hello there! I'm reaching out in hopes of finding assistance. My game is nearly complete, around 90%, and I need help implementing the scoring system. Any assistance with this would be greatly appreciated. Thank you!

 

dale_coop

Moderator
Staff member
Have you already thought about your score. How it be calculated, where/how/when will it be displayed on screen, ... ?
 

latetera

Member
Here I have a demo of the level I'm polishing just in case someone wants to test: Api The Cat - Level 5 (demo)
I would still like to know how to convert my remaining time on my timer when finishing the game to use it as a score. Anyone knows any post related to this?

Thank you all < 3

Api_The_Cat_-_Sewers.gif
 
Top Bottom