generated from sigonasr2/CPlusPlusProjectTemplate
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>master
parent
913d1683f5
commit
0289b2e87f
Binary file not shown.
@ -0,0 +1,18 @@ |
|||||||
|
#ifndef ANIMATION_H |
||||||
|
#define ANIMATION_H |
||||||
|
#include "pixelGameEngine.h" |
||||||
|
|
||||||
|
using namespace olc; |
||||||
|
|
||||||
|
class Animation{ |
||||||
|
public: |
||||||
|
Decal*spr; |
||||||
|
int frames=1; |
||||||
|
int width=0; |
||||||
|
Animation(Decal*spr,int width){ |
||||||
|
this->frames=spr->sprite->width/width; |
||||||
|
this->width=width; |
||||||
|
this->spr=spr; |
||||||
|
} |
||||||
|
}; |
||||||
|
#endif |
@ -0,0 +1,64 @@ |
|||||||
|
#ifndef GAME_INIT_H |
||||||
|
#define GAME_INIT_H |
||||||
|
#define PARTY_TRAIL_LENGTH 48 |
||||||
|
#include "pixelGameEngine.h" |
||||||
|
#include "encounters.h" |
||||||
|
#include "map.h" |
||||||
|
#include "states.h" |
||||||
|
#include "references.h" |
||||||
|
#include "cutscene.h" |
||||||
|
#include "tiles.h" |
||||||
|
using namespace olc; |
||||||
|
|
||||||
|
|
||||||
|
static PixelGameEngine*GAME; |
||||||
|
static std::vector<Object*>OBJECTS; |
||||||
|
static vd2d cameraPos; |
||||||
|
static std::vector<Encounter*>ENCOUNTER_LIST; |
||||||
|
static int frameCount=0; |
||||||
|
static float elapsedTime=0; |
||||||
|
static const float TARGET_RATE = 1/60.0; |
||||||
|
static int MAP_WIDTH=-1; |
||||||
|
static int MAP_HEIGHT=-1; |
||||||
|
static Map*CURRENT_MAP; |
||||||
|
static Map*MAP_ONETT; |
||||||
|
static int GAME_STATE = GameState::EDITOR; |
||||||
|
static vi2d SELECTED_TILE={0,0}; |
||||||
|
static vi2d HIGHLIGHTED_TILE={0,0}; |
||||||
|
static int EDITING_LAYER=layer::DYNAMIC; |
||||||
|
static int SELECTED_OBJ_ID = PLAYER; |
||||||
|
static int OBJ_DISPLAY_OFFSET = 0; |
||||||
|
static bool GAME_FLAGS[128]={}; |
||||||
|
static std::array<Object*,4> PARTY_MEMBER_OBJ; |
||||||
|
static std::array<Entity*,7> PARTY_MEMBER_STATS; |
||||||
|
static bool messageBoxVisible=false; |
||||||
|
static std::string messageBoxText=""; |
||||||
|
static std::string messageBoxTargetText=""; |
||||||
|
static std::string messageBoxFinalText=""; |
||||||
|
static int messageBoxMarker=0; |
||||||
|
static int messageBoxStartMarker=0; //Start of text display.
|
||||||
|
static int messageBoxStopMarker=0; //End of text display for current printout.
|
||||||
|
static int messageBoxFrameWaitTime=1; |
||||||
|
static bool messageBoxLoad=false; //Set to true when ready to load a message in.
|
||||||
|
static std::map<int,vi2d> additionalChars; |
||||||
|
static Cutscene*TestCutscene; |
||||||
|
static Cutscene*CurrentCutscene=nullptr; |
||||||
|
static ActionType CurrentAction=ActionType::NONE; |
||||||
|
static double CUTSCENE_FADE_VALUE=0; |
||||||
|
static std::vector<CutsceneAction*>CUTSCENE_QUEUE; |
||||||
|
static std::map<BattleMoveName,Battle::Move*>MOVELIST; |
||||||
|
static std::array<vd2d,PARTY_TRAIL_LENGTH> partyTrail={vd2d{0,0}}; |
||||||
|
static int PARTY_MEMBER_COUNT = 1; |
||||||
|
static int ENCOUNTER_SELECTED = 0; |
||||||
|
static int ENCOUNTER_OFFSET = 0; |
||||||
|
|
||||||
|
static bool MOUSE_PRESSED_DOWN=false,MOUSE_DOWN=false,MOUSE_RELEASED=false; //TODO Implement Mouse things.static
|
||||||
|
static std::vector<std::vector<TILE*>> MAP; //The foreground layer.
|
||||||
|
static std::vector<std::vector<TILE*>> MAP2; |
||||||
|
static std::vector<std::vector<TILE*>> MAP3; |
||||||
|
static std::vector<std::vector<TILE*>> MAP4; |
||||||
|
static std::vector<std::vector<TILE*>> MAP5; //Collision Layer
|
||||||
|
static std::map<std::string,Decal*> SPRITES; |
||||||
|
static std::map<std::string,Animation*> ANIMATIONS; |
||||||
|
static std::map<int,Object*> OBJ_INFO; |
||||||
|
#endif |
@ -0,0 +1,14 @@ |
|||||||
|
|
||||||
|
|
||||||
|
namespace layer{ |
||||||
|
enum layer{ |
||||||
|
INTERFACE, //Interface items should be on this layer. On top of everything.
|
||||||
|
COLLISION, //Collision checking layer. This layer is
|
||||||
|
HIGH, |
||||||
|
DYNAMIC, |
||||||
|
GROUND, |
||||||
|
BACKGROUND, |
||||||
|
OBJECT, //The object layer doesn't actually exist, it's used to tell the editor we are adding an object instead.
|
||||||
|
ENCOUNTER, //The encounter layer doesn't actually exist, it's used to tell the editor we are adding encounters instead.
|
||||||
|
}; |
||||||
|
} |
@ -0,0 +1,26 @@ |
|||||||
|
#ifndef MAP_H |
||||||
|
#define MAP_H |
||||||
|
#include "pixelGameEngine.h" |
||||||
|
#include "encounters.h" |
||||||
|
|
||||||
|
using namespace olc; |
||||||
|
|
||||||
|
class Map{ |
||||||
|
public: |
||||||
|
std::string filename; |
||||||
|
std::string l2filename; |
||||||
|
std::string l3filename; |
||||||
|
std::string l4filename; |
||||||
|
std::string l5filename; |
||||||
|
Decal*tileset; |
||||||
|
std::vector<Encounter*> encounters; |
||||||
|
Map(std::string fname,std::string layer2_fname,std::string layer3_fname,std::string layer4_fname,std::string layer5_fname,Decal*tileset) { |
||||||
|
this->filename=fname; |
||||||
|
this->l2filename=layer2_fname; |
||||||
|
this->l3filename=layer3_fname; |
||||||
|
this->l4filename=layer4_fname; |
||||||
|
this->l5filename=layer5_fname; |
||||||
|
this->tileset=tileset; |
||||||
|
} |
||||||
|
}; |
||||||
|
#endif |
Loading…
Reference in new issue