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 Member, BASIC Posts: 834
    use constrain attribute instead of change attribute, in the start even i spent hours with this problem.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    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

Sign In or Register to comment.