Sorry I was rushed to write that. Here is the code that I have so far.
Quote: "
#include "DarkGDK.h"
void DarkGDK ( void )
{
int RandomNumber = dbRND ( 4 );
int ObjectOneAttack = 2;
int ObjectOneDefense = 2;
int ObjectOneStrength = 2;
int ObjectOneFight = ObjectOneAttack * RandomNumber + ObjectOneStrength * RandomNumber / RandomNumber;
int ObjectOneDefend = ObjectOneDefense * RandomNumber + ObjectOneStrength * RandomNumber / RandomNumber;
int ObjectTwoAttack = 2;
int ObjectTwoDefense = 2;
int ObjectTwoStrength = 2;
int ObjectTwoDefend = ObjectTwoDefense * RandomNumber + ObjectTwoStrength * RandomNumber / RandomNumber;
int ObjectTwoFight = ObjectTwoAttack * RandomNumber + ObjectTwoStrength * RandomNumber / RandomNumber;
int Offense = ObjectOneFight && ObjectTwoFight;
int Defense = ObjectTwoDefend && ObjectOneDefend;
int Loser = ;
dbSyncOn ( );
dbSyncRate ( 60 );
dbMakeObjectBox ( 1, 2, 8, 2 );
dbMakeObjectBox ( 2, 4, 4, 4 );
dbPositionObject ( 2, 0, 7, 0 );
dbPositionCamera ( 0, 5, -15 );
while ( LoopGDK ( ) )
{
dbSync ( );
if ( dbKeyState ( 17 ) )
dbPitchCameraUp ( 1 );
else if ( dbKeyState ( 31 ) )
dbPitchCameraDown ( 1 );
if ( dbKeyState ( 30 ) )
dbRollCameraLeft ( 1 );
else if ( dbKeyState ( 32 ) )
dbRollCameraRight ( 1 );
if ( dbUpKey ( ) )
dbPositionCamera ( dbCameraPositionX ( ), dbCameraPositionY ( )+1, dbCameraPositionZ ( ) );
else if ( dbDownKey ( ) )
dbPositionCamera ( dbCameraPositionX ( ), dbCameraPositionY ( )-1, dbCameraPositionZ ( ) );
if ( dbLeftKey ( ) )
dbMoveCameraLeft ( 0, 1 );
else if ( dbRightKey ( ) )
dbMoveCameraRight ( 0, 1 );
if ( dbKeyState ( 19 ) )
dbPositionCamera ( 0, 2.5, -15 );
if ( dbControlKey ( ) )
if ( Offense < Defense )
Offense = Loser;
else if ( Offense > Defense )
Defense = Loser;
if ( Offense ( ) = Loser )
dbDeleteObject ( Loser );
else if ( Defense ( ) = Loser )
dbDeleteObject ( Loser );
}
return;
}"
I'm trying to make it so that you have a random attack/defend stat and if you lost than you take damage or delete the object which is what i'm doing up there.
Terrestrial Productions