How Would I Kill all Monsters = Victory + Warp to Screen ?

TolerantX

Active member
(Core: 2 player no Scroll) (Module: 2 Player Platformer)

How would I make it so when I kill all the monsters on the screen, it plays player victory animation then warp to another screen/level?

Thank you.
 

dale_coop

Moderator
Staff member
The difficulty here would be to determine which player will be replaced by the victory object ?

If both of them... just modify the script assigned to the "Killed Last Monster" element in your "Project Settings > Script Settings"... at the end of that script, add this code:
Code:
	LDX player1_object
	LDA Object_x_hi,x
	STA temp
	LDA Object_y_hi,x
	STA temp1
	LDA #$00
	STA temp2
	DeactivateCurrentObject
	LDA #$FF
	STA player1_object
	CreateObject temp, temp1, #OBJ_PLAYER_VICTORY, temp2, currentNametable

	LDA player2Mode
	BEQ +
	LDA player2_object
	CMP #$FF
	BEQ +
	LDX player2_object
	LDA Object_x_hi,x
	STA temp
	LDA Object_y_hi,x
	STA temp1
	LDA #$01
	STA temp2
	DeactivateCurrentObject
	LDA #$FF
	STA player2_object
	CreateObject temp, temp1, #OBJ_PLAYER_VICTORY, temp2, currentNametable
	+

	LDA #$01
	STA loadObjectFlag

	;StopSound
	;LDA #$FF

	PlaySound #SND_VICTORY
 
Top Bottom