PDA

View Full Version : Battle System


WarrOrange
01-17-2004, 10:44 AM
Ok, ive tried many different ways to get this to work but, being me i cant figure out the way......
Heres what I want to do.

I want to put a random battle feature into my game. I dont want the person playing the game to be overwhelmed with random battles. So therefore I would want atleast a 5 second wait inbetween each battle.

WarrOrange
01-17-2004, 10:49 AM
BUT WAIT THERES MORE
Im trying to make bar on my battle system that will act kind of like a loading bar but load for however long a AS it to be (like according to lvl and class ... such)

Marz
01-17-2004, 03:31 PM
A loading bar? That's the part I don't understand.

But... Making a random battle feature wouldn't be too hard buddy. Here is a small script that should help you out. You should recode the positioners (onEnterFrame and onLoad) to your code's style then.



_root.onLoad = function()
{
timerVar = 0;
// For waitTimer, you will want to change it to ::
// currentFrameRate * 5
waitTimer = 150;
randomTimer = 0;
}

_root.onEnterFrame = function()
{
if(timerVar < waitTimer)
{
timerVar++;
}
else
{
randomTimer = 1;
}

if(randomTimer == 1)
{
temp = Math.random()*100;
if(temp < 10)
{
startRandomBattle();
randomTimer = 0;
timerVar = 0;
}
}
}



Hope that works out for you buddy... Possible 10% chance of hitting a random enemy every frame after the intial 5 seconds.

WarrOrange
01-17-2004, 05:21 PM
.. how can i explain the bar... OH ok
Well i am making a Final Fantasy type rpg....
after the character attacks i dont want the person to be able to attack directly after... so i am trying to make a bar that will gradualy fill up according to level and when it is full they will be able to attack again

WarrOrange
01-17-2004, 05:24 PM
Oh and thanks AGAIN Marz! Im gradually learning game coding... maybe one day ill be helping ppl :-p (riiiiiight...)

Marz
01-17-2004, 05:33 PM
*lol*.. No problem.. Okay..

So you want a small bar that will tell when the player will be able to fight next...??

This gets into some queing and some holding and some other things man. I'd suggest just waiting until I come ut with the appropriate tutorials... Found in the sticky above under Marz's Game Programming