I am trying to make a 2D sidescroller but I got the code, added backdrop and a player and stuff but when I run, play the game I only see the backdrop moving but no player.
Player.cpp
#include "DarkGDK.h"
#include "Player.h"
#include "Input.h"
int iPlayerX = 512;
int iPlayerY = 340;
int iPlayerSpeed = 5;
int iPlayerFrame = 7;
int iFrameAnimateDelay = 0;
bool bPlayerIsFiring = false;
int iPlayerBulletY = 0;
int g_PlayerDieFrame = 1;
int g_PlayerExplosionDelay = 0;
void playerSetup ( void )
{
dbCreateAnimatedSprite ( 1, "Assets\\hahah copy.png ", 3 ,3 , 1 );
dbSprite ( 1 , iPlayerX , iPlayerY , 1 );
dbSetSpriteFrame ( 1, iPlayerFrame );
}
void playerUpdate ( void );
void playerAnimate ( void );
void playerReset ( void );
bool playerLevelStart ( void );
bool playerLevelStart2 ( void );
void playerUpdateFire ( void );
Player.h
#pragma once
void playerSetup ( void );
extern int iPlayerX;
extern int iPlayerY;
extern int iPlayerSpeed;
Input.cpp
#include "DarkGDK.h"
#include "Input.h"
bool checkLeft ( void )
{
if ( dbKeyState ( 107 ) )
return true;
return false;
}
bool checkRight ( void )
{
if ( dbKeyState ( 109 ) )
return true;
return false;
}
Input.h
#pragma once
bool checkLeft ( void );
bool checkRight ( void );
I also have code for backdrop and main, I can supply them if needed. I will be online for the following hours but leaving tommorow so if anyone has any ideas ? I think it's the positioning of the sprite the coordinates are wrong ? If so does anyone have some code snippet so it prints coordinates of my mouse icon when I hover around so I can place sprite accordingly ?Thanks.