Destroyable characters
![philliswillis](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hi, I'm very new to this and have hit a couple of snags along the way.
My first of what will be many question's is, how can i make objects destroyable depending upon my main characters speed, similar to the system Rovio uses in Angry Birds?
My first of what will be many question's is, how can i make objects destroyable depending upon my main characters speed, similar to the system Rovio uses in Angry Birds?
Comments
RULE:
When self.linear velocity.X = 0 AND when self.linear velocity.Y = 0
Destroy Actor
Is this what you're asking?
1)create a game attribute called game.collideSpeed (real)
2)in the bird have this rule:
when collides with actor type green pig
change game.collideSpeed to magnitude(self.motion.linear.X,self.motion.linear.Y)
3) in the pig create a self attribute (integer) called self.hitpoints (set it to a number of your choice)
4) in the pig have this rule:
when collides with bird
change self.hitPoints to self.hitpoints-game.collideSpeed
5) in the pig have this rule
when self.hitpoints < ?????
change image to ???? (green pig with black eyes)
when self.hitpoints < 0
destroy actor
You'll need to experiment with this to figure out what to set the self.hitpoints to initially and what to use as your "black eyes" point value.