Sry i didn't get it in
#include "DarkGDK.h"
#include "Time.h"
#include "dInput.h"
void DarkGDK ( void )
{
dbSetWindowSize(800,600);
dbLoadImage("enemy.bmp",1);
dbLoadImage("test.bmp",2);
dbLoadImage("skud.bmp",3);
dbSyncOn ( );
dbSyncRate ( 60 );
//Movement Variables
int Jumps = 4;
int jumpsStart = 0;
bool Enemyfalling = true;
bool Playerfalling = true;
const int Gravity = 4;
bool PlayerShooting = false;
bool PlayerRight = true;
bool PlayerLeft = false;
dbSprite(1,1,1,1);
dbSprite(2,400,0,2);
while ( LoopGDK ( ) )
{
int PlayerPosX = dbSpriteX(1);
int EnemyPosX = dbSpriteX(2);
int PlayerY = dbSpriteY(1);
int EnemyY = dbSpriteY(2);
if (Playerfalling == true);
if (PlayerY <= 400)
{
dbMoveSprite(1,-Gravity);
Playerfalling = true;
}else
{
Playerfalling = false;
}
if (Enemyfalling == true);
if (EnemyY <= 400)
{
dbMoveSprite(2,-Gravity);
Enemyfalling = true;
}else
{
Enemyfalling = false;
}
if (dbSpaceKey() == 1)
{
if (Playerfalling == false)
{
dbMoveSprite(1,120);
}else if (Playerfalling == true)
{
}
}
if (dbRightKey() == 1)
{
dbRotateSprite(1,90);
dbMoveSprite(1,3);
dbRotateSprite(1,0);
PlayerRight = true;
PlayerLeft = false;
}
if (dbLeftKey() == 1)
{
dbRotateSprite(1,90);
dbMoveSprite(1,-3);
dbRotateSprite(1,0);
PlayerLeft = true;
PlayerRight = false;
}
if (Enemyfalling == false)
{
if (EnemyPosX < PlayerPosX)
{
EnemyPosX++;
}
if (EnemyPosX > PlayerPosX)
{
EnemyPosX--;
}
dbSprite(2,EnemyPosX,EnemyY,2);
}
if (PlayerShooting == false && dbKeyState(DIK_W) == 1)
{
dbSprite(3,PlayerPosX,PlayerY,3);
PlayerShooting = true;
}else if (PlayerShooting == true && PlayerRight == true)
{
dbRotateSprite(3,90);
dbMoveSprite(3,9);
dbRotateSprite(3,0);
}else if (PlayerShooting == true && PlayerLeft == true)
{
dbRotateSprite(3,90);
dbMoveSprite(3,-9);
dbRotateSprite(3,0);
}
if (PlayerShooting == true)
{
int shootX = dbSpriteX(3);
if (shootX >= 600 || shootX <= 1)
{
dbDeleteSprite(3);
PlayerShooting = false;
}
}
dbSync ( );
}
return;
}
Beginner In the Language.