-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Rafael-Dev-21/dev2
Dev2
- Loading branch information
Showing
37 changed files
with
703 additions
and
347 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef DRAW_H | ||
#define DRAW_H | ||
|
||
// draw | ||
void draw_map(Map * const, Point); | ||
void draw_player(Point pos, Point cursor); | ||
|
||
#endif |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#ifndef ENGINE_H | ||
#define ENGINE_H | ||
|
||
#define ESC 27 | ||
|
||
// engine | ||
void init_curses(void); | ||
|
||
#endif |
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
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,6 +1,6 @@ | ||
#pragma once | ||
|
||
#include "util/geom.hpp" | ||
#include "geom.hpp" | ||
|
||
class Entity { | ||
public: | ||
|
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 |
---|---|---|
|
@@ -52,4 +52,4 @@ class EventSystem { | |
|
||
private: | ||
std::list<EventListener *> listeners; | ||
}; | ||
}; |
File renamed without changes.
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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef MOVE_H | ||
#define MOVE_H | ||
|
||
#include "position.h" | ||
#include "world.h" | ||
|
||
// move | ||
void move_from(Point *, Direction); | ||
void move_and_collide(Map * const, Point *, Direction); | ||
Direction dir_from_ch(int, Direction); | ||
|
||
#endif |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef MYMATH_H | ||
#define MYMATH_H | ||
|
||
#include <stdint.h> | ||
|
||
typedef struct { | ||
float x; | ||
float y; | ||
} Vec2; | ||
|
||
// math | ||
float lerp(float a, float b, float t); | ||
float smooth(float t); | ||
float smoother(float t); | ||
float normalize(float value, float min, float max); | ||
float hash_posf(int x, int y); | ||
size_t hash_pos(int x, int y); | ||
float dot(Vec2 a, Vec2 b); | ||
|
||
#endif |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef NOISE_H | ||
#define NOISE_H | ||
|
||
typedef struct { | ||
float frequency; | ||
float amplitude; | ||
float lacunarity; | ||
float persistence; | ||
int octaves; | ||
float (*noisefn)(float, float); | ||
} FBMParams; | ||
|
||
// noise | ||
float value2d(float x, float y); | ||
float perlin2d(float x, float y); | ||
float simplex2d(float x, float y); | ||
float fbm2d(float x, float y, FBMParams params); | ||
|
||
extern FBMParams default_fbm; | ||
|
||
#endif |
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 |
---|---|---|
|
@@ -50,4 +50,4 @@ class Simplex : public Noise { | |
unsigned seed; | ||
|
||
static int grads[12][3]; | ||
}; | ||
}; |
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 |
---|---|---|
|
@@ -14,4 +14,4 @@ struct FixedObject { | |
struct LooseObject { | ||
std::string name; | ||
int quantity; | ||
}; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef POSITION_H | ||
#define POSITION_H | ||
|
||
typedef enum { | ||
UP, | ||
DOWN, | ||
LEFT, | ||
RIGHT | ||
} Direction; | ||
|
||
typedef struct { | ||
int x; | ||
int y; | ||
} Point; | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#ifndef WORLD_H | ||
#define WORLD_H | ||
|
||
#include <stdbool.h> | ||
|
||
enum { | ||
TILE_NONE, | ||
TILE_GRASS, | ||
TILE_SAND, | ||
TILE_WATER, | ||
TILE_STONE, | ||
TILE_COUNT | ||
}; | ||
|
||
enum { | ||
OBJ_NONE, | ||
OBJ_WALL, | ||
OBJ_COUNT | ||
}; | ||
|
||
typedef struct { | ||
int glyph; | ||
int color; | ||
} TileType; | ||
|
||
typedef struct { | ||
int glyph; | ||
int color; | ||
bool solid; | ||
} ObjectType; | ||
|
||
typedef struct { | ||
int type; | ||
int object; | ||
} Tile; | ||
|
||
typedef struct { | ||
int width; | ||
int height; | ||
Tile * * tiles; | ||
} Map; | ||
|
||
// map | ||
Map * create_map(int, int); | ||
void free_map(Map *); | ||
void init_map(Map *); | ||
void place_wall(Map *, Point); | ||
void break_wall(Map *, Point); | ||
bool is_solid(Map * const, Point); | ||
|
||
extern TileType tile_types[TILE_COUNT]; | ||
extern ObjectType obj_types[OBJ_COUNT]; | ||
|
||
#endif |
Oops, something went wrong.