Positional 'Pow' after enemy is destroyed

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

I have a game in progress in progress at the moment. I have my magical orbs floating up to the top of the screen, being generated from a spawner off the bottom of the screen.

When the orbs are hit the fall back down to the bottom with a fade out but i would like to put a 'POW!!' graphic exactly where it was hit for a second have that fade with the orb still falling.

I will fade this out afterwards, which I know how to do but its the position of the hit I needs when I try and replace the orb actor for the POW graphic it falls down to the bottom of the screen...i need it to be placed where it was hit...the x and y co-ordinates

Please can someone tell me how this could be achieved?

Thanks guys

It takes a Zombie to know a Zombie!!!

Comments

  • svnsvn Member Posts: 445
    CREATE AN INVISIBLE ACTOR and call it SpawnPOW . In your orb actors, tell tgem when they collide with actor SpawnPOW, spawn actor( POW graphic) In your (POW graphic) actor, put an interpolate rule: Interpolate self.color.Alpha to 0 in 1.5 sec

    This should do the trick.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    If you have a bunch of baddies the spawning could cause glitches. One thing you can do without spawning is to have one pow actor and three attributes:

    1) game.powX
    2) game.powY
    3) game.PowNow

    In the baddie -
    when collides with actor "Hero"
    change game.powX to self.X
    change game.powY to self.Y
    change game.PowNow to 1

    Then in the pow actor have this rule:

    when game.pownow is true (1)
    change self.X to game.powX
    change self.Y to game.powY
    interpolate width to 128 (or whatever)
    interpolate height to 128 (or whatever)
    -----rule when width = 128
    -----change game.pownow to 0
    Otherwise (of the 1st main rule)
    change self.x to ??? (offscreen)
    change self.Y to ??? (offscreen)
    change self.width to 2
    change self.height to 2

    The only problem with this method is if you need more than one pow at a time. You may need modify the above method like this:

    3 actors (or more) pow1, pow2, pow3
    The 3 attributes listed above for EACH pow (game.pow1x, game.pow2x, game.pow3x, etc.)
  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    thanks guys for those ideas...

    Sorry forgot to say that nothing collides with the orbs. The orbs are destroyed when the player presses a coloured bullet on a gun that is controlled by a boolean true event. ;player presses red bullet which in turn destroys red orb on screen.

    I then have it so that when the event is true then the orb velocity is turned downwards, the orb fades out and travels downwards.

    I need a 'POW' at the exact time the orb is effected by the true event and turns downwards.

    Sorry about that

    It takes a Zombie to know a Zombie!!!

  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    Thank you so much SVN

    Member
    CREATE AN INVISIBLE ACTOR and call it SpawnPOW . In your orb actors, tell tgem when they collide with actor SpawnPOW, spawn actor( POW graphic) In your (POW graphic) actor, put an interpolate rule: Interpolate self.color.Alpha to 0 in 1.5 sec

    This should do the trick.

    That did do the trick...work like a treat!

    Thank you so much!

    p.s Thank you scitunes again..

    It takes a Zombie to know a Zombie!!!

Sign In or Register to comment.