1up sound not playing

Post Reply
User avatar
red moon
Posts: 225
Joined: Mon Aug 12, 2019 12:19 am

1up sound not playing

Post by red moon » Sun Nov 10, 2019 10:01 pm

Hello everyone, I wanted to ask if I could get some help with a 1up sound playing when the player finds ten treasures.
The mechanics work, but I can only get the default "get" sound to play when I reach 10. I assigned the ExtraLife sound to SND_1UP and I altered the bottom of the script to reference the 1UP sound. That may not the right place to do that....
Thank you!

Here is the script

Code: Select all

;;blank
	CPX player1_object
	BEQ isPlayerForCollectableScore
	JMP ++
isPlayerForCollectableScore:
	LDA tileCollisionFlag
	BEQ +
	JMP ++
+
	LDA #$01
	STA tileCollisionFlag
	ChangeTileAtCollision #$00, #$00
	
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	TXA
	STA tempx	
	AddValue #$08, myScore, #$01, #$00
	;;; we also need to set up the routine to update the HUD
	;; for this to work right, health must be a "blank-then-draw" type element.
	;STA hudElementTilesToLoad
	;	LDA #$00
	;	STA hudElementTilesMax
		; LDA DrawHudBytes
		; ora #HUD_myScore
		; STA DrawHudBytes
	UpdateHud HUD_myScore
	PlaySound #SND_GET
	
	 ;; extra life stuff:
    LDA myScore+1
    BNE updateLives ;count equal to 10
    JMP +
	
	updateLives:
    LDA myLives
    ADC #$01 ;add 1 to lives
    STA myLives    

    ;; update the count in hud
    STA hudElementTilesToLoad
    UpdateHud HUD_myLives
    
    ;; play 1UP sound
    PlaySound #SND_1UP
    
    
	
	+:
    LDX tempx
	++ 
Attachments
sound.jpg
sound.jpg (349.93 KiB) Viewed 35 times
Post Reply