Posted October 04, 2018 by Tete-chin Spacestone
#Battle
Hello!
Today I'm gonna explain how I did the minigame of battles in real time.
Originally, the minigame was going to be about clicking runes on the screen, but since I only had 2 months to do it, I switched to something that seemed simpler.
Well, to start, I made the variables: PVpropio (own pv, I'm spanish XD), PVenemigo (pvenemy), pv, damage, fight.
At the beggining of the battle:
f.PVenemigo=6
f.PVpropio=5
f.PVpropio+=f.pv
Why is this? In the game, some choices makes an add+1 to the pv, so, in battles you have your PVpropio with pv.
Funny fact, it's the first game I do, so I didn't know how to erase the image button (page break) so I used the TyranoScript [cm] XDXD
I had 4 different patterns for the enemies, they actives with the f.fight=Math.floor(Math.random()*)+1 that variable in random between 1 to 4, so it jumps to the pattern randomly :)
When PVenemigo is 0 it jumps to the label win, and if PVpropio is 0 it jumps to lose.