Flee Game and some help needed

User avatar
Mugi
Posts: 287
Joined: Thu Dec 27, 2018 8:30 pm

Re: Flee Game and some help needed

Post by Mugi » Tue Feb 12, 2019 4:38 am

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.......
User avatar
dale_coop
Posts: 2561
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Flee Game and some help needed

Post by dale_coop » Tue Feb 12, 2019 9:02 am

wallmasterr wrote:
Tue Feb 12, 2019 12:20 am
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.

Image
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: Select all

;;; 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 wrote:
Tue Feb 12, 2019 12:20 am
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: Select all

  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.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
wallmasterr
Posts: 20
Joined: Sun Jan 20, 2019 9:29 pm
Location: Scotland
Contact:

Re: Flee Game and some help needed

Post by wallmasterr » Tue Feb 19, 2019 8:28 pm

"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"
User avatar
dale_coop
Posts: 2561
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Flee Game and some help needed

Post by dale_coop » Tue Feb 19, 2019 11:51 pm

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 $)

:)
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
wallmasterr
Posts: 20
Joined: Sun Jan 20, 2019 9:29 pm
Location: Scotland
Contact:

Re: Flee Game and some help needed

Post by wallmasterr » Wed Feb 20, 2019 7:48 am

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 :\

Image

and added a title screen
Image
User avatar
dale_coop
Posts: 2561
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Flee Game and some help needed

Post by dale_coop » Wed Feb 20, 2019 1:17 pm

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

Wallmasterr, you like caverns, too? ;)

Image
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
wallmasterr
Posts: 20
Joined: Sun Jan 20, 2019 9:29 pm
Location: Scotland
Contact:

Re: Flee Game and some help needed

Post by wallmasterr » Wed Feb 20, 2019 1:30 pm

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?
User avatar
dale_coop
Posts: 2561
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Flee Game and some help needed

Post by dale_coop » Wed Feb 20, 2019 1:46 pm

You have this problem as soon as you power on the NES?
Or only when after loosing your lives?
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
dale_coop
Posts: 2561
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Flee Game and some help needed

Post by dale_coop » Wed Feb 20, 2019 1:46 pm

Do you have music on your start screen? If not, try setting one (I had an issue with no music on it, once).
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
Post Reply