Multiple Endings to your game

Hello everyone,

If your like me and love story's you want multiple endings on your games.

I know I do as my game has a bit of story.

I wanted to share my multiple endings script to the game. I use 4 constants and 1 variable.

Variable

endingScene

the initial value is 0.


the four constants are
END_1
END_2
END_3
END_4

you can use which ever constant value you want as these will warp you to the screen

I use the values 250-253

now I use 2 scripts and I set them up as AI Scripts. But you can likely set them up as other things.

Script 1 just increases the value of the variable endingScene

Code:
   ;; Ending Mode
  LDA endingScene 
  CLC
  CMP #$03
  BCS +
  INC endingScene
  +

Script 2 does most of the work as it checks what the value of the ending scene is. and then warps the user to screen depending on the option. I use this to setup different cutscenes
that way my game has some variety. Also to note I made my ending start in the over-world if you want to use the underworld just comment the over-world section and then un-comment the overworld Section.

Code:
	;; possible endings
	;; 1:  no Saving the day - Default
	;; 2: you sorta save the day
	;; 3: you mostly save the day
	;; 4: you save the day (<-- the Max Ending)
	
	LDA endingScene 
	CLC
	CMP #$01
	BNE +
	;; if Ending 2:
	LDA #END_2
	STA tempz
	JMP ++
	+
	CMP #$02
	BNE +
	;; if Ending 3:
	LDA #END_3
	STA tempz
	JMP ++
	+
	CMP #$03
	BNE +
	;; if Ending 4:
	LDA #END_4
	STA tempz
	JMP ++
	+
	;;ELSE:
	;; default Ending:
	LDA #END_1
	STA tempz
	++ 
	
	;; warp to Ending:
	LDA tempz
	STA warpToScreen
	
	;;goes to the over-world
	GoToScreen warpToScreen, #$01, #$02
	
	;;goes to the under-world
	;;GoToScreen warpToScreen, #$02, #$02
	
	LDA #$00
	STA playerToSpawn
	
	LDA #$01
	STA loadObjectFlag
	
	JSR DeactivateAllObjects
	
	RTS

thank you and let me know what you think :)
 
Thebmultiple ends can be linked to the different game objects you use correct? So if im using the main charactor ending 1.
If i use say player object 16(example) for Object 2 then Ending 2. And so on?

Will this code allow for that ? Im sure you uave to write a varible, check what player onject is on the screen and them warp to X ending screen.

Does this sounds possible?
 
Top Bottom