The Score Var and other HUD stuff is sure Buggy

User avatar
Imagaryboy
Posts: 18
Joined: Mon Aug 20, 2018 9:05 am
Location: Cologne

Re: The Score Var and other HUD stuff is sure Buggy

Post by Imagaryboy » Thu Sep 13, 2018 11:07 am

dale_coop wrote:
Thu Sep 13, 2018 10:46 am
Ok, your "last HP that won't disappear"... when doing what?
If it's after the player death, the modification of the "Adventure_HandlePlayerDeath.asm" should set it back (to $08 in your case, cf my script)
When the player takes his 8th hit, the last health point should also show an empty tile instead of a full tile before resetting the game.
User avatar
dale_coop
Posts: 1294
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: The Score Var and other HUD stuff is sure Buggy

Post by dale_coop » Thu Sep 13, 2018 11:56 am

Oh that always has been like that (cf all Joe's videos).
When the player takes his last (8th) hits, it directly resets the game.

But you could try (at line 6):

Code: Select all

	TXA
	STA tempx
	TYA 
	STA tempy
	
	;; UDPDATE the health HUD a last time before die :
	LDA #$00
	STA hudElementTilesToLoad
	STA hudElementTilesMax
	LDA DrawHudBytes
	ora #HUD_myHealth
	STA DrawHudBytes
	;; TURN ON handling the hud
    
	;;;;;;;;;;;;;;;;;;;
	LDX player1_object
	LDA Object_x_hi,x
	STA temp
	LDA Object_y_hi,x
	STA temp1
	CreateObject temp, temp1, #$08, #$00
	;; need to do this redundantly, otherwise, the death object will be in same slot as player
	LDX player1_object
	DeactivateCurrentObject
	;;;;;;;;;;;;;;;;;;;
	;;StopSound  ;;<<-- don't want the music stop after the player dies
	
	LDA #$FF
	STA player1_object
	
	;; HERE: when player dies, we give back his HEALTH :
	LDA #$08	
	STA myHealth
	
	LDX tempx
	LDY tempy
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
chronosv2
Posts: 160
Joined: Wed Aug 08, 2018 9:30 pm
Location: KY, USA
Contact:

Re: The Score Var and other HUD stuff is sure Buggy

Post by chronosv2 » Thu Sep 13, 2018 12:15 pm

All the code referencing myMoney is in Routines\UserScripts\AdventureGame_Base\PowerUpCode\
My advice to anyone looking to work with code is to get Notepad++ (or even better if you can afford it, Sublime Text 3) because you can find in files in folder to find all the references to a thing.
Also worth noting in the modules a lot of script is loaded whether you use those items or not -- in the Project Settings -> Script Settings tab you should set any tile types or power ups you're not using to their Blank equivalents in the same folder (i.e. "ROUTINES\UserScripts\AdventureGame_Base\PowerUpCode\Powerup_Blank.asm").
User avatar
Imagaryboy
Posts: 18
Joined: Mon Aug 20, 2018 9:05 am
Location: Cologne

Re: The Score Var and other HUD stuff is sure Buggy

Post by Imagaryboy » Thu Sep 13, 2018 8:26 pm

dale_coop wrote:
Thu Sep 13, 2018 11:56 am
Oh that always has been like that (cf all Joe's videos).
When the player takes his last (8th) hits, it directly resets the game.

But you could try (at line 6):

Code: Select all

	TXA
	STA tempx
	TYA 
	STA tempy
	
	;; UDPDATE the health HUD a last time before die :
	LDA #$00
	STA hudElementTilesToLoad
	STA hudElementTilesMax
	LDA DrawHudBytes
	ora #HUD_myHealth
	STA DrawHudBytes
	;; TURN ON handling the hud
    
	;;;;;;;;;;;;;;;;;;;
	LDX player1_object
	LDA Object_x_hi,x
	STA temp
	LDA Object_y_hi,x
	STA temp1
	CreateObject temp, temp1, #$08, #$00
	;; need to do this redundantly, otherwise, the death object will be in same slot as player
	LDX player1_object
	DeactivateCurrentObject
	;;;;;;;;;;;;;;;;;;;
	;;StopSound  ;;<<-- don't want the music stop after the player dies
	
	LDA #$FF
	STA player1_object
	
	;; HERE: when player dies, we give back his HEALTH :
	LDA #$08	
	STA myHealth
	
	LDX tempx
	LDY tempy
Thanks again! it worked but I had to drop some other code because I ran out of space xD
User avatar
dale_coop
Posts: 1294
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: The Score Var and other HUD stuff is sure Buggy

Post by dale_coop » Thu Sep 13, 2018 9:08 pm

Arf... yeah, a recurring problem.
Hopefully, in the 4.1 we will have a lot more free space :)
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
Post Reply