Pulsating graphic

ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
edited November -1 in Working with GS (Mac)
Hi all

I am going to give my app a funky 'Stage Clear' scene after a level is completed.

I have a 'STAGE' graphic and a seperate '1' GRAPHIC

How do I get the '1' graphic to pulsate (Get slightly bigger then slightly smaller)

I can see the 'change size' attribute but that only seems to do one way and not stop

I have tried to do

Change size 100
timer - after 0.5 seconds
Change Size -100

this work for one go then after that the graphic keeps on growing until it fills the screen>

Any ideas?

Thanks guys

It takes a Zombie to know a Zombie!!!

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Is there anything in this thread that will help?

    http://gamesalad.com/forums/topic.php?id=25625
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi ZB, one way that would work OK is to use Interpolate to resize your height and width larger, then another Interpolate for smaller, etc., for how many times you want the actor to pulsate (triggered by a boolean attribute). With Interpolate behaviors, you won't be able to interrupt them though, although I'm guessing you don't need to.

    A quick tip for getting your height and width for the smaller and larger sizes kept in in ratio : make two temporary copies of your pulsating actor. Hold shift and reduce one of them by dragging inwards from one corner to the smaller size you're after, using the original as reference. Then using shift, enlarge the third one to the size required. Get the new measurements of these two temp. actors, to use in your Interpolate behaviors, then delete the 2 copies.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    Hi Gyro

    Sounds like a plan. I've set up the interpolate to change height and width by 20 pixels...what do I do to set it to shrink back?

    It takes a Zombie to know a Zombie!!!

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi ZB, just use another Interpolate behavior - but (I forgot to mention ;-) in a timer, set to After the amount of seconds you've got in the first Interpolate. Each subsequent Interpolate behavior needs to be in a timer as well, making the After so many seconds the times added up from the previous, if you get my meaning.

    So
    Interpolate height - larger - over 1 second -- for example
    Interpolate width - larger - over 1 second

    Timer: After 1 second
    Interpolate height - smaller - over 1 second
    Interpolate width - smaller - over 1 second

    Timer: After 2 seconds
    Interpolate height - larger - over 1 second
    Interpolate width - larger - over 1 second

    Timer: After 3 seconds
    Interpolate height - smaller - over 1 second
    Interpolate width - smaller - over 1 second

    etc, depending how many times you want it to pulsate.

    Hope that helps out.

    :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    Hi Gyro

    That's superb..i'll implement that tomorrow.

    Thanks for your help on this...been bugging me for a while now.

    :)

    It takes a Zombie to know a Zombie!!!

  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    I need it to keep on pulsating until the 'continue' graphic is pressed

    is there a way to get this to loop?

    It takes a Zombie to know a Zombie!!!

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Zombiebrains said:
    I need it to keep on pulsating until the 'continue' graphic is pressed

    is there a way to get this to loop?

    Ah, OK... I sorted a more efficient way that does what you want:

    Integer attribute Pulser set to 0

    --when you want the pulsing to begin, change attribute Pulser to 1

    Rule
    When scene.Pulser is 1
    Interpolate self.size.Width to --smaller size
    Duration 1 second
    Interpolate self.size.Height to --smaller size
    Duration 1 second

    Timer After 1 second
    Change Attribute Pulser to 2

    This following Rule to be separate from above:

    Rule
    When scene.Pulser is 2
    Timer After 0.2 seconds
    Interpolate self.size.Width to --larger size
    Duration 1 second
    Interpolate self.size.Height to --larger size
    Duration 1 second

    Timer After 1.2 seconds
    Change Attribute Pulser to 1

    That will continue to pulse as you want. Obviously you'll change the timings and put sizes as you require.

    When you want to stop the pulse, use a Change Attribute Pulser set to 0.

    :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    Superb Job Gyro...

    You were right, that method is exactly what I wanted and is constant, until the attribute is change which i can now control.

    You da man!!!

    Thanks so much :)

    It takes a Zombie to know a Zombie!!!

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    You're welcome, ZB; glad it worked out for you. :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.