Khross
|
I don't know how experienced a coder you are, but I got the impression you want someone to do the whole battle system for you. I can't do that, but I can offer some advice. :)
You'll want a function that continually loops until a) all your characters are dead, or b) all the enemies are dead. Something like this:
#define MAXCHARS 3
#define MAXENEMIES 3
//the defines are just for convience.
//ok, we'll need an array to store your party's hp.
global int curhp[MAXCHARS], maxhp[MAXCHARS];
//now, for the enemy...
global int e_curhP[MAXENEMIES], e_maxhp[MAXENEMIES];
void MainBattleLoop()
{
while(curhp[MAXCHARS]=1 || e_curhp[MAXENEMIES]=1)
/* Ok, this probably looks complicated. It's basically saying "keep looping while one party or the other has a member with at least 1 HP left." */
{
PlayersTurn();
/* Standard "Attack,Magic,Run" menu. */
EnemiesTurn(); //take a wild guess ;)
}
if(!e_curhp[MAXENEMIES]) //if the enemy hp = 0...
GiveXP(); /* Here you can give xp and mapswitch, or whatever. */
}
Ok! How about that menu? Well... I'm feeling generous, so here's some more crappy examples.
void PlayersTurn()
{
local int i,x,done; //misc ints
local int cy,cimage; //for the cursor
i=fontheight(0);
cimage=LoadImage("CURSOR.GIF"); //loads image
unpress(0); //clear keyboard presses
cy=0;
done=0;
while(!done)
{
Render(); //draw the screen
Setlucent(1); /* not nessicary, makes things transparent. */
Rectfill(20,screeny-(screeny/4),screenx/4,screeny/2,138);
/* icky math. Basically draws a blue box at the screen's bottom. */
GotoXY(screenx/4,screeny/2); Printstring(0,"Attack");
GotoXY(screenx/4,screeny/2+i); Printstring(0,"Magic");
GotoXY(screenx/4,screeny/2+15); Printstring(0,"Run");
/* this part might require keys.vc. Get it at http://www.vergesource.com */
if(up && c0) { unpress(0); cy++; }
if(down && c
Posted on 2000-12-16 22:42:10
|
Allan
|
No fucking text. Damn shit.
Companions the creator seeks, not corpses, not herds and believers. Fellow creators the creator seeks--those who write new values on new tablets. Companions the creator seeks, and fellow harvesters; for everything about him is ripe for the harvest.
Posted on 2000-12-16 23:21:50
|
Hatchet
|
I'm makin' an independant battle system demo, based off of Earthbound's for simplicity. I'm makking it for tVS as a tutorial. It's not done yet but I can send you what I have if you want, and you might be able to learn somethin' from it...
-Hatchet
-Hatchet
Posted on 2000-12-17 00:41:31
|