help needed! - Positioning/Respawning Actor
sarah.schippke
Member Posts: 5
in Tech Support
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
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
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User