#pragma once
// Dark GDK - The Game Creators - www.thegamecreators.com
// the wizard has created a very simple 2D project that uses Dark GDK
// it can be used as a starting point in making your own 2D games
// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"
#include "DgAsteroid.h"
class DgApp
{
public:
DgApp(void);
~DgApp(void);
enum ID
{
ID_IMG_BACK=1,
IDMAX=30,
};
void OnExecute();
void OnInit();
void OnLoop();
void OnRender();
void OnCleanup();
int X;
int Y;
DgAsteroid Asteroid[IDMAX];
};
#pragma once
#include "DarkGDK.h"
class DgAsteroid
{
public:
// ConStrunctors
DgAsteroid(void); // Default Ctor
DgAsteroid( int newXPos, int newYPos ); // Ctor with position parameters
// Deconstructors
~DgAsteroid(void);
// Functions
// Loads the animated sprite
void OnInit(char *cSpriteLocation, int newId );
// Sets the position
void SetPosition(int newXPos, int newYPos);
// Sets the direction
void SetDirection(float newDirection );
// Sets the speed
void SetSpeed( float newSpeed );
// Game Loop
void OnLoop();
// Renders or draws the asteroid sprite
void OnRender();
int GetId() { return imgId; }
int GetX() { return xPos; }
int GetY() { return yPos; }
private:
// Position
int xPos;
int yPos;
// Speed & Direction
float curSpeed, curDirection;
// image id
int imgId;
};