Destroyable characters

philliswillisphilliswillis Member Posts: 4
edited November -1 in Working with GS (Mac)
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?

Comments

  • DrGlickertDrGlickert Member Posts: 1,135
    I believe that what you're asking is that you want the actor to be destroyed when it stops moving? Yes?

    RULE:
    When self.linear velocity.X = 0 AND when self.linear velocity.Y = 0
    Destroy Actor

    Is this what you're asking?
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    if you want the bad guys to only be hurt a little when lightly touched and hurt a lot when slammed into you'll need to do something like this:

    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.
  • DrGlickertDrGlickert Member Posts: 1,135
    Oh, I misread this question. Good lookin out SciTunes!
  • philliswillisphilliswillis Member Posts: 4
    Thats looks good scitunes I'll give a go later, and no body needs to worry it's not an Angry Birds rip off.
  • philliswillisphilliswillis Member Posts: 4
    Thats looks good scitunes I'll give a go later, and no body needs to worry it's not an Angry Birds rip off.
  • philliswillisphilliswillis Member Posts: 4
    Works a treat,thank you
Sign In or Register to comment.