Last change
on this file since 677 was
673,
checked in by guerin, 9 years ago
|
raycast: initial port
Raycast is a small game that looks like Wolfenstein 3D. I created
it for my SESI project, on a Cortex M4 devboard.
Imported from
github.com/libcg/tiva-c/tree/master/boards/dk-tm4c129x/upmc_raycast
|
File size:
617 bytes
|
Rev | Line | |
---|
[673] | 1 | #ifndef __GAME_H |
---|
| 2 | #define __GAME_H |
---|
| 3 | |
---|
| 4 | #include <stdint.h> |
---|
| 5 | #include <stdbool.h> |
---|
| 6 | |
---|
| 7 | #define M_PI (3.14159f) |
---|
| 8 | #define COLLIDE_GAP (0.2f) |
---|
| 9 | #define PLAYER_MOVE (0.13f) |
---|
| 10 | #define PLAYER_ROT (0.1f) |
---|
| 11 | #define TIME_TOTAL (30) |
---|
| 12 | |
---|
| 13 | typedef struct |
---|
| 14 | { |
---|
| 15 | float x; |
---|
| 16 | float y; |
---|
| 17 | float dir; |
---|
| 18 | } Player; |
---|
| 19 | |
---|
| 20 | typedef struct |
---|
| 21 | { |
---|
| 22 | uint8_t tile[10][10]; |
---|
| 23 | uint8_t w; |
---|
| 24 | uint8_t h; |
---|
| 25 | float startX; |
---|
| 26 | float startY; |
---|
| 27 | float startDir; |
---|
| 28 | } Map; |
---|
| 29 | |
---|
| 30 | typedef struct |
---|
| 31 | { |
---|
| 32 | Player player; |
---|
| 33 | Map *map; |
---|
| 34 | int mapId; |
---|
| 35 | int timeLeft; |
---|
| 36 | } Game; |
---|
| 37 | |
---|
| 38 | int gameLocate(int x, int y); |
---|
| 39 | void gameRun(); |
---|
| 40 | void gameTick(); |
---|
| 41 | |
---|
| 42 | #endif // __GAME_H |
---|
Note: See
TracBrowser
for help on using the repository browser.