kitchen: README + MISSIONS/engine-c keep-drop notes
This commit is contained in:
parent
1d351918da
commit
575d7d29b8
130 changed files with 9817 additions and 1 deletions
25
openkknd2-am-coder/include/ok_buildings.h
Normal file
25
openkknd2-am-coder/include/ok_buildings.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef OK_BUILDINGS_H
|
||||
#define OK_BUILDINGS_H
|
||||
#include "ok_types.h"
|
||||
|
||||
// Building types
|
||||
enum OkBuildingKind {
|
||||
OK_BUILDING_HQ = 0,
|
||||
OK_BUILDING_BARRACKS = 1,
|
||||
OK_BUILDING_MAX
|
||||
};
|
||||
|
||||
// Building structure
|
||||
typedef struct {
|
||||
int x, y;
|
||||
OkBuildingKind kind;
|
||||
OkFaction faction;
|
||||
int resource_cost;
|
||||
bool built;
|
||||
} OkBuilding;
|
||||
|
||||
// Function declarations
|
||||
void ok_buildings_init(OkWorld *w);
|
||||
void ok_buildings_place(OkWorld *w, int x, int y, OkBuildingKind kind, OkFaction faction);
|
||||
void ok_buildings_update(OkWorld *w);
|
||||
#endif // OK_BUILDINGS_H
|
||||
6
openkknd2-am-coder/include/ok_map.h
Normal file
6
openkknd2-am-coder/include/ok_map.h
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef OK_MAP_H
|
||||
#define OK_MAP_H
|
||||
#include "ok_types.h"
|
||||
void ok_map_init(OkWorld *w, uint32_t seed);
|
||||
bool ok_map_walkable(const OkWorld *w, int x, int y);
|
||||
#endif
|
||||
31
openkknd2-am-coder/include/ok_types.h
Normal file
31
openkknd2-am-coder/include/ok_types.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#ifndef OK_TYPES_H
|
||||
#define OK_TYPES_H
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define OK_WORLD_W 32
|
||||
#define OK_WORLD_H 24
|
||||
#define OK_MAX_UNITS 64
|
||||
|
||||
typedef enum { OK_TILE_EMPTY = 0, OK_TILE_BLOCK = 1, OK_TILE_RES = 2 } OkTile;
|
||||
typedef enum { OK_FACTION_A = 0, OK_FACTION_B = 1 } OkFaction;
|
||||
typedef enum { OK_UNIT_SCOUT = 0, OK_UNIT_WORKER = 1 } OkUnitKind;
|
||||
|
||||
typedef struct {
|
||||
int x, y;
|
||||
OkFaction faction;
|
||||
OkUnitKind kind;
|
||||
int hp;
|
||||
bool alive;
|
||||
} OkUnit;
|
||||
|
||||
typedef struct {
|
||||
OkTile tiles[OK_WORLD_H][OK_WORLD_W];
|
||||
OkUnit units[OK_MAX_UNITS];
|
||||
int unit_count;
|
||||
int tick;
|
||||
int resources_a;
|
||||
int resources_b;
|
||||
} OkWorld;
|
||||
|
||||
#endif
|
||||
8
openkknd2-am-coder/include/ok_unit.h
Normal file
8
openkknd2-am-coder/include/ok_unit.h
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef OK_UNIT_H
|
||||
#define OK_UNIT_H
|
||||
#include "ok_types.h"
|
||||
int ok_unit_spawn(OkWorld *w, OkFaction f, OkUnitKind k, int x, int y);
|
||||
void ok_unit_step_toward(OkWorld *w, int uid, int tx, int ty);
|
||||
void ok_world_tick(OkWorld *w);
|
||||
int ok_world_alive_count(const OkWorld *w, OkFaction f);
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue