Flea Game and some help needed (demo)

Mugi

Member
Agreed.

I was just trying to slurp my coffee thinking "thats some neat consept art" then came tape worm and now i have coffee allover the damn kitchen.......
 

dale_coop

Moderator
Staff member
wallmasterr said:
Anyway, I also hit a wall in not knowing how to respawn the player after death.
Thought it was in the game objects played death settings tab, iv tried changing most of these option to reset game , win game , lose game , set to warp and none seem to work, player just stays dead and cant do anything.
Iv edited my handle player death script right now to just reset the game but that's not ideal.

At the player's death, the PlayerLoseLife.asm script is executed.

2019-02-12-09-50-27-Project-Settings.png

Currently I think your script might contain only a "JMP RESET" (reset the game).
What do you want it to do when your player is dead, loose 1 life and respawn at the beginning of the level?

For that, duplicate your "PlayerLoseLife.asm" to for example "PlayerLoseLife_with3Lives.asm", modify its contain with that:
Code:
;;; do loss of life stuff here
	DEC myLives
	LDA myLives
	BNE gameNotOver
	;;do gameover stuff here.  Warp to screen?  Show animation?  Just restart?
	JMP RESET
	
gameNotOver:
	;;;;;
	;;; do warp to continue screen stuff here.
	LDA #$00
	STA newGameState
	LDA continueMap
	CLC
	ADC #$01
	STA temp
	GoToScreen continueScreen, temp, #$04	
	LDA #$00
	STA playerToSpawn
	;LDX player1_object
	;DeactivateCurrentObject	
	LDA #$01
	STA loadObjectFlag
	
	JSR DeactivateAllObjects
 
	LDA continuePositionX
	STA newX
	LDA continuePositionY
	STA newY	

	;; player1 reset health:
	LDA #$03		;;  <--- HERE reset your player's Health (with the value for your game)
	STA myHealth
And assign this script to your "Player Lose Life" element in the "Project Settings > Scripts Settings" (at the place of the old one).


wallmasterr said:
And where dose it set the tile after a collectible object is picked up, iv got the jump script on all the bg tiles so when it replaces the tile after being collected it no longer has the jump script and character no longer jumps. This is a trouble as i cant place a pick up on the floor as it will not jump after, Iv got a work around at the moment of setting those problem tiles to ladders which also have the jump script.

When your player touches a "Collectable" tile, the script assigned is executed (check the "Project Settings > Script Settings" to see which script it is for your project, it might be associated to a "Tile Collision 0?" something element).

I that script, you will find that line:
Code:
  ChangeTileAtCollision #$00, #$00
The first "#$00" means the tile collision data is changed for the 0 collision type, the "0 - null walkable" . And the second "#$00" means the tile is changed with the tile that has the index 0 from your BG tileset (just count the 8x8 tiles starting from 0... Here, it's the first one).
In your case, try changing those two values with the ones for your game.
 

wallmasterr

Active member
"The first "#$00" means the tile collision data is changed for the 0 collision type, the "0 - null walkable" . And the second "#$00" means the tile is changed with the tile that has the index 0 from your BG tileset (just count the 8x8 tiles starting from 0... Here, it's the first one)."

So i made this change adn thought it was working , then committed checked again and it wasn't, tried pointing the replacement to ladder tile and solid and it works but when I point it at my jump tile it freezes when I collide. any ideas the just tile is the 11th in the list so iv been using ""#$11"
 

dale_coop

Moderator
Staff member
The numbers with #$ are hex value... so for hen 11th, it has to be «#$0B »
You could use decimal values if you prefer and let the compilator translate to hex for you... in that case just write #11 (without the $)

:)
 

wallmasterr

Active member
It works now, though it would be something like that, I feel I'm learning a lot. thanks

Iv been adding sound effects to my scripts too, its super easy :).
and iv switched my level tiles over to the path system soi can make smaller blocks and do things a lot quicker but it does look a little not as nice :\

fleaenemies.PNG


and added a title screen
fleestart screen pixel.png
 

dale_coop

Moderator
Staff member
Looks awesome! :)
Yep, path system is great to do that kind of stuff...

Wallmasterr, you like caverns, too? ;)

2019-02-20-14-15-29-NES-MAKER-4-1-5-Version-0x159-Underground-Adventure-Competition-Single-Screen-M.png
 

wallmasterr

Active member
ye nes games are all about the caverns.
Having problems with the start screen on a flashed cart. I set it up to press start and go to the game. It worked on the emulators but not on console. then i tryed making any of the buttons trigger it and it still didint work .
Any thoughts?
 

dale_coop

Moderator
Staff member
Do you have music on your start screen? If not, try setting one (I had an issue with no music on it, once).
 

wallmasterr

Active member
What do you want it to do when your player is dead, loose 1 life and respawn at the beginning of the level?

For that, duplicate your "PlayerLoseLife.asm" to for example "PlayerLoseLife_with3Lives.asm", modify its contain with that:

And assign this script to your "Player Lose Life" element in the "Project Settings > Scripts Settings" (at the place of the old one).

Im trying to get this respawn working.
Ye i want when you die for the player to respawn on the level they are on. not sure how lives and stuff works yet either. Would be cool for now to just respawn and not care about lives.

think i did what used but keeps giving me this error when trying to build.

"
Routines\Basic\ModuleScripts\flee scripts\HandlePlayerDeathAlly.asm(2): Unknown label.
Routines\Basic\ModuleScripts\flee scripts\HandlePlayerDeathAlly.asm(3): Unknown label.
"
 

n8bit

Member
wallmasterr said:
Im trying to get this respawn working.
Ye i want when you die for the player to respawn on the level they are on. not sure how lives and stuff works yet either. Would be cool for now to just respawn and not care about lives.

I am planning on a "no-lives" system for my game as well, have not figured out how to implement it though.

As far as respawning on same level, can you just place a checkpoint tile where the player starts? It should trigger and it will respawn them at the checkpoint each time.
 

wallmasterr

Active member
n8bit said:
wallmasterr said:
Im trying to get this respawn working.
Ye i want when you die for the player to respawn on the level they are on. not sure how lives and stuff works yet either. Would be cool for now to just respawn and not care about lives.

I am planning on a "no-lives" system for my game as well, have not figured out how to implement it though.

As far as respawning on same level, can you just place a checkpoint tile where the player starts? It should trigger and it will respawn them at the checkpoint each time.
Ye this is what I need but can't seem to get the script to work. it makes the noise like it should work but when I die it doesn't reset me.
 

n8bit

Member
Hmmm... I just checked my checkpoint script and it has not been modified. Double checked and my checkpoints are working. What does your checkpoint script look like?

Also if you want infinite lives comment out the following lines on the PlayerLoseLife script:

Code:
	DEC myLives
	LDA myLives
	BNE gameNotOver
	;;do gameover stuff here.  Warp to screen?  Show animation?  Just restart?
	JMP RESET
	
gameNotOver:

Your PlayerLoseLife script should look like this:

Code:
;;; do loss of life stuff here
	;;DEC myLives
	;;LDA myLives
	;;BNE gameNotOver
	;;do gameover stuff here.  Warp to screen?  Show animation?  Just restart?
	;;JMP RESET
	
;;gameNotOver:

;;;;;
;;; do warp to continue screen stuff here.
LDA #$00
STA newGameState
 LDA continueMap
 clc
 ADC #$01
 STA temp
 GoToScreen continueScreen, temp, #$04
 LDA #$00
 STA playerToSpawn
; LDX player1_object
; DeactivateCurrentObject
 LDA #$01
 STA loadObjectFlag
 
LDA continuePositionX
STA newX
LDA continuePositionY
STA newY

That should give you infinite lives.
 

wallmasterr

Active member
Thanks il try this

My checkpoint code is this
Code:
	CPX player1_object
	BEQ +
	JMP dontDoCheckpoint
+

	LDA Object_x_hi,x
	STA continuePositionX
	LDA Object_y_hi,x
	STA continuePositionY
	LDA currentMap
	STA continueMap
	LDA Object_scroll,x
	STA continueScreen
	PlaySound #SND_VICTORY
	TriggerScreen continueScreen
	;;ChangeTileAtCollision #$00, #TILE_CHECKPOINT_CLEARED
dontDoCheckpoint:

and my death tile script is
Code:
	CPX player1_object
	BNE +
	JSR HandlePlayerDeath
	PlaySound #SND_HURT_PLAYER


	JMP RESET
	;;; JMP RESET
+
 

wallmasterr

Active member
Thanks for helping, im getting there slowly, ok did that now it plays the death animation and never gets any further.
fleaDie.gif

heres my code for playerLoseLife script.
Code:
	;;;JMP RESET

	;;; do loss of life stuff here
	;;DEC myLives
	;;LDA myLives
	;;BNE gameNotOver
	;;do gameover stuff here.  Warp to screen?  Show animation?  Just restart?
	;;JMP RESET
	
;;gameNotOver:

;;;;;
;;; do warp to continue screen stuff here.
LDA #$00
STA newGameState

i noticed most of this is commented out...

after uncomenting the stuff to say this
Code:
	;;;JMP RESET

	;;; do loss of life stuff here
	DEC myLives
	LDA myLives
	BNE gameNotOver
	;;;do gameover stuff here.  Warp to screen?  Show animation?  Just restart?
	
gameNotOver:

;;;;;
;;; do warp to continue screen stuff here.
LDA #$00
STA newGameState

it gives me these errors

"
Routines\Basic\ModuleScripts\HurtWinLoseDeath\PlayerLoseLife.asm(4): Unknown label.
Routines\Basic\ModuleScripts\HurtWinLoseDeath\PlayerLoseLife.asm(5): Unknown label.
"
 

n8bit

Member
I think you are missing some parts of your lose life script.

Look at the second code snippet in my post above where I mentioned commenting stuff out select all of it and replace everything in your lose life script with it and see if it helps.
 

wallmasterr

Active member
Tryed it but still dose not work :(

then i started a new test project and followed this with a fresh download of nesmaker
https://www.youtube.com/watch?v=D3VRTLYRzjg&feature=youtu.be

And the checkpoints did not work. :(
where can i be going wrong with this?
 
Top Bottom