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.
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.