The Mugen Fighters Guild

Help => M.U.G.E.N Development Help => Topic started by: DR119 on December 02, 2017, 07:06:56 pm

Title: Flexible explod position
Post by: DR119 on December 02, 2017, 07:06:56 pm
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?
Title: Re: Flexible explod position
Post by: inktrebuchet on December 03, 2017, 03:11:43 am
Something like that is possible by using cond (http://mugenguild.com/forum/topics/ifelsemath-condmath-triggers-169131.0.html).


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)))


Title: Re: Flexible explod position
Post by: Odb718 on December 04, 2017, 02:40:39 pm
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?
Title: Re: Flexible explod position
Post by: inktrebuchet on December 04, 2017, 03:12:16 pm
Man, I’m glad you posted that solution! So simple.