GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

help needed! - Positioning/Respawning Actor

Hi, i just wanted to find out how exactly you code the re-positioning of an actor at a specific point on the scene (where it is at the beginning of the scene - its starting point). So basically after the main actor touches an enemy or a wall that destroys you, i wanted the actor to spawn where it was at the beginning of the scene and for the actor to lose one life. Any help would be appreciated and the sooner the better as this is a school project due in a week, thanks.

This code works:

Rule:
Attribute: game.Total score < 0
Change Attribute: self.position.X to 54
Change Attribute: self.position.Y to 754
Change Attribute: game.lives to game.lives-1
Change Attribute: game.total score to 0


However, this doesn't:


Rule:
When any conditions are valid:
Actor receives event - overlaps or collides - actor with tag - enemies
Actor receives event - overlaps or collides - actor with tag - death walls
Change Attribute: self.position.X to 54
Change Attribute: self.position.Y to 754
Change Attribute: game.lives to game.lives-1

all it does it subtract 1 life everytime i collide, but doesnt respawn/go back to set coordinates

Comments

  • famekraftsfamekrafts Posts: 719Member, BASIC
    use constrain attribute instead of change attribute, in the start even i spent hours with this problem.
  • tatiangtatiang Posts: 11,694Member, Sous Chef, PRO, Senior Sous-Chef
    So you're basically saying you're having a problem with tags, right? Add a log debugging statement to that second rule to see if it's actually triggering those behaviors you have listed.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

This discussion has been closed.