//Joystick Settings and Keyboard settings
#define JoyRight ((key[KEY_RIGHT]==1 && key[KEY_LEFT]==0) || (XAXIS>10000))
#define JoyLeft ((key[KEY_LEFT]==1 && key[KEY_RIGHT]==0) || (XAXIS<-10000))
#define JoyUp ((key[KEY_UP]==1 && key[KEY_DOWN]==0) || (YAXIS<-10000))
#define JoyDown ((key[KEY_DOWN]==1 && key[KEY_UP]==0) || (YAXIS>10000))
#define XBTN 0 #define CBTN 1
#define TBTN 2 #define SBTN 3
#define Xps (key[KEY_d]==1 || BTN[XBTN]==1)
#define Yps (key[KEY_w]==1 || BTN[YBTN]==1)
#define Cps (key[KEY_f]==1 || BTN(CBTN]==1)
#define Sps (key[KEY_s]==1 || BTN[SBTN]==1)
//Width and height settings of screen
#define ScreenWidth view.width
#define ScreenHeight view.height
//Player Stats
#define PlayerX GLOBAL_VARIABLES[0]
#define PlayerY GLOBAL_VARIABLES[1]
#define PlayerHP GLOBAL_VARIABLES[2]
#define PlayerMP GLOBAL_VARIABLES[3]
#define PlayerATK GLOBAL_VARIABLES[4]
#define PlayerDEF GLOBAL_VARIABLES[5]
#define PlayerMAG GLOBAL_VARIABLES[6]
#define PlayerSPD GLOBAL_VARIABLES[7]
#define PlayerLUCK GLOBAL_VARIABLES[8]
#define PlayerLEVEL GLOBAL_VARIABLES[9]
#define PlayerEXP GLOBAL_VARIABLES[10]
//Importan Game Settings
#define MoveSpeed 5
#define GameFPS 30
#define DefaultPosition 0
#define ViewStartX -320
#define ViewStartY -240
#define StartLevel 1
#define StartExp 0
#define StartATK 25
#define StartDEF 19
#define StartMAG 20
#define StartSPD 23
#define StartLuck 16
int BTN[8], GLOBAL_VARIABLES[1000], TO_NEXT;
double XAXIS, YAXIS;
char *key;
//Determine Level and get EXP info
void
GetEXPInfo(int START, double MULTIPLIER)
{
if(PlayerLEVEL<100)
{
TO_NEXT=START+(PlayerLEVEL*((START*MULTIPLIER)/2));
}
else if (PlayerLEVEL==100)
{
TO_NEXT=0;
}
if(PlayerEXP>=TO_NEXT && PlayerLEVEL<100)
{
PlayerLEVEL++;
}
}
//Setup status to use in leveling up
void
GetStatusInfo(double M1,double M2,double M3,double M4,double M5)
{
PlayerATK=StartATK+(PlayerLEVEL*(M1));
PlayerDEF=StartDEF+(PlayerLEVEL*(M2));
PlayerMAG=StartMAG+(PlayerLEVEL*(M3));
PlayerSPD=StartSPD+(PlayerLEVEL*(M4));
PlayerLUCK=StartLuck+(PlayerLEVEL*(M5));
}
//Readings for player
void
SetupPlayer() {
PlayerEXP=StartExp;
PlayerLEVEL=StartLevel; }
void
Enable()
{
int t;
key=GetKeyState();
XAXIS=GetJoystick1Axis(0);
YAXIS=GetJoystick1Axis(1);
for(t=0;t<7;t++)
{
BTN[t]=GetJoystick1Button(t);
}
}
Users browsing this forum: No registered users and 1 guest