------

[ AD ] Port Monitor ( Try to use a Best WebSite Monitoring Tool )

------

#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;
};

'온라인게임' 카테고리의 다른 글

RAID(레이드)의 종류와 개념  (0) 2015.04.28
Dark GDK - Shoot / 2D  (0) 2011.10.29
DarkGDK - Sprite Animation / 2D  (0) 2011.10.28
Dark GDK - Terrain / 3D  (0) 2011.10.27
Dark GDK - FPS 게임 화면 만들기 / 3D  (3) 2011.10.26

+ Recent posts