actor size , very important!! ****

yoenoeszyoenoesz Member Posts: 42
edited November -1 in Working with GS (Mac)
Hey there everyone,

I'm making a game, where I got a little problem that I can't figure out..

I have 2 actors.. The first one is 50x20 (actor1), the other is 70x40 (actor2)..

Now what I want to do is:

When actor 1 gets bigger (change size behavior - already done that), and reaches the size of actor 2 (70x40), I need to have the possibility to destroy actor 2...

How can I make this work??

THNX in advance!

Comments

  • ozboybrianozboybrian PRO Posts: 2,102
    What do you mean?
  • steve86steve86 Member Posts: 806
    First create a Boolean global attribute named sizereached

    actor 1:

    create a rule.

    when self.size.width > 70 AND self.size.height > 40

    sizereached = true

    actor 2:

    when sizereached = true

    (here put what would you like to happen once actor 1 reaches actor 2 size)
  • yoenoeszyoenoesz Member Posts: 42
    I dont get it... What behavior do I have to add at: Rule: when self.size.width > 70 AND self.size.height > 40??

    Do I have to add change attribute to use sizereached = true at the rule: when ALL conditions are valid: attribute, self.size.width IS GREATER THEN (>) 70 ??

    And do I have to hit the (+) plus button under? And add the other attribute 40 ??

    And what do I have to do at actor 2? the same as actor 1 ?
  • yoenoeszyoenoesz Member Posts: 42
    Look, let me explain what I mean with a game, called Fishy..

    Go to http://spele.nl/games/behendigheid/fishy/fishy-1/

    This is what I mean, if my actor gets to the size of the actor wich is greather then the smallest fish, it has to grow to the size of the bigger fish and then I will have the possibility to eat the fish that's bigger then the size of my character.

    I hope you understand what i mean, just play it, and you will understand what I mean..
    THNX
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    I will make a demo project for you... 1 minute...

    Ace
  • yoenoeszyoenoesz Member Posts: 42
    THANKS!! This is actually what i mean, but without the -when touch is pressed- button..

    And i did the interpolate behavior but the actor grows when it spawned, and stays at 70x40 format...
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Just thought I'd add the option to grow and shrink just to cover everything you will need. All you have to do then is change attribute FishGrow to true when you want it to grow.

    Do you have multiple actors needing to grow?

    Ace
  • yoenoeszyoenoesz Member Posts: 42
    Did you play the game that i'd send by link?? just play it and you will understand what i mean..

    I really need it badly, cuz i cant do something else right now..
  • JeffreyShimaneJeffreyShimane Member Posts: 372
    Instead of tracking the actual size of the growing actor, you could just track how many things it has eaten that makes it grow. For example, if actor 1 eats 10 (or whatever number) smaller fish, it sets an attribute called FishSize to 2 (1 is the default). You could have rules that check FishSize when actor 1 collides with another fish. If it's FishSize attribute is bigger (or the same size depending on what you want) than the other fish's, the attribute you are using to track the number of fish eaten increments by 1. If the other fish is bigger than actor 1, then actor 1 dies (or whatever you want to happen).

    - Jeff
  • yoenoeszyoenoesz Member Posts: 42
    Thnx, but it's not the answer i'm looking for man :(
Sign In or Register to comment.