112 lines
2.3 KiB
C
112 lines
2.3 KiB
C
#ifndef STATE_GAME_H
|
|
#define STATE_GAME_H
|
|
#include <SDL2/SDL.h>
|
|
#include "Vector.h"
|
|
#include "VoidMan.h"
|
|
#include "MetaBit.h"
|
|
#include "LiveMap.h"
|
|
|
|
int openGameState();
|
|
void closeGameState();
|
|
int processGameState();
|
|
int handleGameState();
|
|
int renderGameState();
|
|
|
|
void handlePlayerTriggers();
|
|
void handleMetaBitTriggers(struct MetaBit *metabit);
|
|
void setMetaBitsTarget(struct Vector *vector);
|
|
void setMetaBitTarget(struct Vector *vector);
|
|
void spawnMetaBit(int x, int y);
|
|
void spawnMetaBits();
|
|
|
|
void handleEntity(struct Entity *entity);
|
|
void handleEntityCollision(struct Entity *entity);
|
|
|
|
void activateTrigger(int id);
|
|
void activateEvent(int id);
|
|
|
|
void eventMessage(struct Event *event);
|
|
void eventHint(struct Event *event);
|
|
void eventGo(struct Event *event);
|
|
void eventDecorSet(struct Event *event);
|
|
void eventDecorDelete(struct Event *event);
|
|
void eventCellSet(struct Event *event);
|
|
|
|
void eventMetaBitSpawn(struct Event *event);
|
|
|
|
void eventMusicSet(struct Event *event);
|
|
void eventMusicStart(struct Event *event);
|
|
void eventMusicStop(struct Event *event);
|
|
void eventEndGame(struct Event *event);
|
|
|
|
void processTriggers();
|
|
|
|
struct Vector v_drag;
|
|
struct Vector camera;
|
|
struct Vector mouse;
|
|
struct Vector l_mouse;
|
|
|
|
int l_input;
|
|
#define MOUSE 0
|
|
#define KEY 1
|
|
|
|
int camera_x;
|
|
int camera_y;
|
|
float map_zoom;
|
|
struct Player *player;
|
|
|
|
extern char *facing[];
|
|
|
|
struct Sprite *fog;
|
|
|
|
struct VoidMan particles;
|
|
struct VoidMan projectiles;
|
|
struct VoidMan *metabits;
|
|
struct MetaBit *meta_bit;
|
|
struct VoidMan entities;
|
|
|
|
struct VoidMan message_queue;
|
|
struct Message *current_message;
|
|
|
|
struct VoidMan hint_queue;
|
|
struct Message *current_hint;
|
|
|
|
struct Textt *text_hp;
|
|
struct Textt *text_metabits;
|
|
struct Textt *text_exp;
|
|
struct Textt *text_level;
|
|
|
|
// hackish stuff
|
|
void addExp(int amount);
|
|
void updateMeta();
|
|
void updateHp();
|
|
void addDamage(int amount);
|
|
int handleDeath();
|
|
|
|
int start_exp;
|
|
int start_level;
|
|
int start_hp;
|
|
int start_metabits;
|
|
|
|
int cmd;
|
|
#define MOVE_LEFT (1<<0)
|
|
#define MOVE_RIGHT (1<<1)
|
|
#define MOVE_DOWN (1<<2)
|
|
#define MOVE_UP (1<<3)
|
|
#define MOUSE_MOVE (1<<4)
|
|
#define METABIT_MOVE (1<<5)
|
|
#define METABIT_RETURN (1<<6)
|
|
#define METABIT_STATUS_HOME 0
|
|
#define METABIT_STATUS_TARGET 1
|
|
#define METABIT_STATUS_TARGETTING 2
|
|
#define METABIT_STATUS_HOMING 3
|
|
struct Vector metabit_target;
|
|
int metabit_status;
|
|
|
|
int player_status;
|
|
#define WALKING (1<<0)
|
|
#define FIRE_1 (1<<1)
|
|
#define FIRE_2 (1<<2)
|
|
|
|
#endif
|