vars and explods (Read 3866 times)

Started by cake-kun, April 02, 2018, 10:58:10 AM
Share this topic:
vars and explods
New #1  April 02, 2018, 10:58:10 AM
  • avatar
  • *
can i connect a explod to a variable or state meaning have an explod of a bar  and when it runs out it triggers me to transform  how would i do it
Last Edit: April 02, 2018, 10:03:16 PM by cake-kun
Re: vars and explods
#2  April 02, 2018, 03:30:15 PM
  • ****
  • Robotics Engineer
    • USA
*Edit* Ok, I realized I answer this in terms of Life, and not in terms of just some countdown timer.
But it is all relevant so I am leaving it copied below.

When the transform happens, set a Var to GameTime.

Then compare the Var to current GameTime to determine how much time has elapsed.

var(10) = GameTime

Trigger Example:
trigger1 = GameTime - var(10) > 1000 ;1000 ticks have passed.

You can use this to trigger the Explod bar in the same fashion I described it below for Life.

Depends how you build your bar.

You can use a series of different anims (the bar at different heights), and you would want to use this calculation in your Explod triggers:
Life = LifeMax
Life < LifeMax && Life => LifeMax/90
Life < LifeMax/90 && Life >= LifeMax/80

You can also use a lifebar that is a 1px wide sprite, and use the Scale parameter to make it stretch to a certain value for 100%.
I used this technique during my Jailbot's Arcade hyper move, I actual had both a vertical lifebar and a horizontal lifebar following the same principle.
Spoiler: The Vertical Lifebar (click to see content)
Spoiler: The Horizontal LifeBar (click to see content)

Last Edit: April 02, 2018, 04:32:38 PM by altoiddealer
Re: vars and explods
New #3  April 02, 2018, 09:43:34 PM
  • avatar
  • *
nvm i didn't understand before but i got it now thank you ! this helped just needed to really look into it
Last Edit: April 02, 2018, 10:03:04 PM by cake-kun