YesNoOk
avatar

Flexible explod position (Read 1621 times)

Started by DR119, December 02, 2017, 07:06:56 pm
Share this topic:
Flexible explod position
#1  December 02, 2017, 07:06:56 pm
  • avatar
  • **
I'm trying to implement a bonus system which adds points for certain achievements like winning the round without losing life, winning in a certain time etc. and I want the game to give out the bonuses the player has achieved at the end of each round. I created explods for that, but I need them to be in a flexible position depending on which bonuses were achieved and which weren't.
For example, if the player got bonus 1 and bonus 3, but not bonus 2, I want it to look like this:
bonus 1
bonus 3
but when bonus 2 is achieved, it should be shown between bonus 1 and 3 and bonus 3 should be displayed under bonus 2.
So is it doable to display explods flexible?

ink

Re: Flexible explod position
#2  December 03, 2017, 03:11:43 am
  • ****
  • inktrebuchet
    • USA
    • s236.photobucket.com/albums/ff271/inktrebuchet/?
Something like that is possible by using cond.


I have a quick example below. It assumes you are using variables to keep track of which bonuses is going to be used and spaces them in increments of 10.

Explod bonus 1
Pod Y = 30

Explod bonus 2
Pos Y =  cond(var(1) = 1, 20, 30)

Explod bonus 3
Pos Y = cond(var(1) = 1 && var(2) = 1, 10, cond(var(1)=1, 20, cond(var(2) = 1, 20, 30)))


Last Edit: December 03, 2017, 03:40:51 am by ink
Re: Flexible explod position
#3  December 04, 2017, 02:40:39 pm
  • *****
  • Shame on you!
    • USA
If you did it right you could just use the Pos you want adjusted to be  120 + Var(1) + Var(2). Where Var(1) and Var(2) would be set to the width you needed. 120 would be your starting point.
How are you finding out that P1 deserves the awards?
vVv Wheat Stage Released vVv

ink

Re: Flexible explod position
#4  December 04, 2017, 03:12:16 pm
  • ****
  • inktrebuchet
    • USA
    • s236.photobucket.com/albums/ff271/inktrebuchet/?
Man, I’m glad you posted that solution! So simple.