-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
2,784 additions
and
2,704 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,55 @@ | ||
/* | ||
* | ||
* AnimSprite - By CrociDB | ||
* http://crocidb.wordpress.com/ | ||
* | ||
* Obrigado por usar ^^ | ||
* | ||
*/ | ||
|
||
#include <allegro.h> | ||
|
||
#include <iostream> | ||
#include <vector> | ||
|
||
#include <State.h> | ||
|
||
class AnimSprite | ||
{ | ||
private: | ||
std::vector<BITMAP*> frames; | ||
int frame_atual; | ||
int delay; | ||
|
||
int time; | ||
|
||
std::vector<State*> states; | ||
int curr_state; | ||
|
||
int x, y; | ||
public: | ||
AnimSprite(); | ||
|
||
void run(BITMAP* bmp); | ||
|
||
void SetDelay(int sdelay); | ||
int GetDelay() const; | ||
|
||
void SetX(int sx); | ||
void SetY(int sy); | ||
void SetPosition(int sx, int sy); | ||
|
||
int GetX() const; | ||
int GetY() const; | ||
|
||
void AddFrame(const char* file); | ||
void AddFrame(BITMAP* bmp); | ||
|
||
int GetNumFrames() const; | ||
|
||
void AddState(State* st); | ||
void FitStates(); | ||
|
||
void SetCurrentState(int st); | ||
int GetCurrentState() const; | ||
}; | ||
/* | ||
* | ||
* AnimSprite - By CrociDB | ||
* http://crocidb.wordpress.com/ | ||
* | ||
* Obrigado por usar ^^ | ||
* | ||
*/ | ||
|
||
#include <allegro.h> | ||
|
||
#include <iostream> | ||
#include <vector> | ||
|
||
#include <State.h> | ||
|
||
class AnimSprite | ||
{ | ||
private: | ||
std::vector<BITMAP*> frames; | ||
int frame_atual; | ||
int delay; | ||
|
||
int time; | ||
|
||
std::vector<State*> states; | ||
int curr_state; | ||
|
||
int x, y; | ||
public: | ||
AnimSprite(); | ||
|
||
void run(BITMAP* bmp); | ||
|
||
void SetDelay(int sdelay); | ||
int GetDelay() const; | ||
|
||
void SetX(int sx); | ||
void SetY(int sy); | ||
void SetPosition(int sx, int sy); | ||
|
||
int GetX() const; | ||
int GetY() const; | ||
|
||
void AddFrame(const char* file); | ||
void AddFrame(BITMAP* bmp); | ||
|
||
int GetNumFrames() const; | ||
|
||
void AddState(State* st); | ||
void FitStates(); | ||
|
||
void SetCurrentState(int st); | ||
int GetCurrentState() const; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,62 @@ | ||
/* | ||
* Game developed by CrociDB on SpeedHack 2009 | ||
* http://speedhack.allegro.cc/ | ||
* | ||
* CrociDBlog - http://crocidb.wordpress.com/ | ||
* | ||
* The App Control class. | ||
* | ||
*/ | ||
|
||
#include <allegro.h> | ||
|
||
class CApp | ||
{ | ||
private: | ||
/* Variaveis que guardam a resolucao */ | ||
int w, h; | ||
/* Tamanho para programacao */ | ||
int tw, th; | ||
/* Buffer */ | ||
BITMAP *buffer; | ||
/* Wide */ | ||
int wide; | ||
/* Bitmap do mouse */ | ||
BITMAP *bmpMouse; | ||
public: | ||
/* Funcao de Inicializacao */ | ||
void Init(int sw, int sh, char *title); | ||
/* Funcao de Inicializacao (carrega info do arquivo) */ | ||
void Init(char *title); | ||
/* Funcao de Desiniciacao */ | ||
void deInit(); | ||
/* Funcao que muda entre Fullscreen e Windowed */ | ||
void SwitchMode(); | ||
/* Funcao que muda entre Widescreen e normal */ | ||
void SwitchWide(); | ||
/* Limpa o Buffer */ | ||
void ClearBuffer(); | ||
void ClearBuffer(int col); | ||
/* Funcao que atualiza o buffer */ | ||
void Refresh(); | ||
/* Mostra o cursor */ | ||
void ShowMouse(); | ||
|
||
/* Está em Widescreen? */ | ||
int isWide(); | ||
|
||
/* Seta o Buffer */ | ||
void SetBuffer(BITMAP *dbuffer); | ||
/* Pega o Buffer */ | ||
BITMAP *GetBuffer(); | ||
/* Cria um Buffer */ | ||
void CreateBuffer(); | ||
|
||
/* Fade In */ | ||
void fade_in(BITMAP *bmp_orig, int speed); | ||
void fadeInToColor(BITMAP *bmp_orig, int speed, int color); | ||
/* Fade Out */ | ||
void fade_out(int speed); | ||
void fadeOutToColor(int speed, int color); | ||
|
||
}; | ||
/* | ||
* Game developed by CrociDB on SpeedHack 2009 | ||
* http://speedhack.allegro.cc/ | ||
* | ||
* CrociDBlog - http://crocidb.wordpress.com/ | ||
* | ||
* The App Control class. | ||
* | ||
*/ | ||
|
||
#include <allegro.h> | ||
|
||
class CApp | ||
{ | ||
private: | ||
/* Variaveis que guardam a resolucao */ | ||
int w, h; | ||
/* Tamanho para programacao */ | ||
int tw, th; | ||
/* Buffer */ | ||
BITMAP *buffer; | ||
/* Wide */ | ||
int wide; | ||
/* Bitmap do mouse */ | ||
BITMAP *bmpMouse; | ||
public: | ||
/* Funcao de Inicializacao */ | ||
void Init(int sw, int sh, char *title); | ||
/* Funcao de Inicializacao (carrega info do arquivo) */ | ||
void Init(char *title); | ||
/* Funcao de Desiniciacao */ | ||
void deInit(); | ||
/* Funcao que muda entre Fullscreen e Windowed */ | ||
void SwitchMode(); | ||
/* Funcao que muda entre Widescreen e normal */ | ||
void SwitchWide(); | ||
/* Limpa o Buffer */ | ||
void ClearBuffer(); | ||
void ClearBuffer(int col); | ||
/* Funcao que atualiza o buffer */ | ||
void Refresh(); | ||
/* Mostra o cursor */ | ||
void ShowMouse(); | ||
|
||
/* Está em Widescreen? */ | ||
int isWide(); | ||
|
||
/* Seta o Buffer */ | ||
void SetBuffer(BITMAP *dbuffer); | ||
/* Pega o Buffer */ | ||
BITMAP *GetBuffer(); | ||
/* Cria um Buffer */ | ||
void CreateBuffer(); | ||
|
||
/* Fade In */ | ||
void fade_in(BITMAP *bmp_orig, int speed); | ||
void fadeInToColor(BITMAP *bmp_orig, int speed, int color); | ||
/* Fade Out */ | ||
void fade_out(int speed); | ||
void fadeOutToColor(int speed, int color); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,67 @@ | ||
/** | ||
* GameJam 2009 - GamePlay | ||
* | ||
* The Arm class file. | ||
*/ | ||
|
||
#ifndef _CARM_H_ | ||
#define _CARM_H_ | ||
|
||
#define DEFAULT_X 800 | ||
#define DEFAULT_Y 0 | ||
|
||
#include <allegro.h> | ||
|
||
#include "CMap.h" | ||
#include "AnimSprite.h" | ||
|
||
enum EArmState | ||
{ | ||
EAS_NULL, | ||
EAS_MOVE_GO, | ||
EAS_MOVE_BA, | ||
EAS_SET | ||
}; | ||
|
||
class CArm | ||
{ | ||
private: | ||
int x, y; | ||
int dx, dy; | ||
int rx, ry; | ||
|
||
int vel; | ||
|
||
int curr; | ||
|
||
CMap *map; | ||
|
||
int type; | ||
|
||
BITMAP *sprite[2]; | ||
|
||
EArmState state; | ||
|
||
public: | ||
CArm(); | ||
|
||
void getMap(CMap *map); | ||
|
||
// Setters | ||
void setX(int px); | ||
void setY(int py); | ||
|
||
// Getters | ||
int getX(); | ||
int getY(); | ||
|
||
void armAction(); | ||
|
||
void show(BITMAP *buffer); | ||
void update(); | ||
}; | ||
|
||
|
||
|
||
#endif | ||
|
||
/** | ||
* GameJam 2009 - GamePlay | ||
* | ||
* The Arm class file. | ||
*/ | ||
|
||
#ifndef _CARM_H_ | ||
#define _CARM_H_ | ||
|
||
#define DEFAULT_X 800 | ||
#define DEFAULT_Y 0 | ||
|
||
#include <allegro.h> | ||
|
||
#include "CMap.h" | ||
#include "AnimSprite.h" | ||
|
||
enum EArmState | ||
{ | ||
EAS_NULL, | ||
EAS_MOVE_GO, | ||
EAS_MOVE_BA, | ||
EAS_SET | ||
}; | ||
|
||
class CArm | ||
{ | ||
private: | ||
int x, y; | ||
int dx, dy; | ||
int rx, ry; | ||
|
||
int vel; | ||
|
||
int curr; | ||
|
||
CMap *map; | ||
|
||
int type; | ||
|
||
BITMAP *sprite[2]; | ||
|
||
EArmState state; | ||
|
||
public: | ||
CArm(); | ||
|
||
void getMap(CMap *map); | ||
|
||
// Setters | ||
void setX(int px); | ||
void setY(int py); | ||
|
||
// Getters | ||
int getX(); | ||
int getY(); | ||
|
||
void armAction(); | ||
|
||
void show(BITMAP *buffer); | ||
void update(); | ||
}; | ||
|
||
|
||
|
||
#endif | ||
|
Oops, something went wrong.