Started with game logic, implemented some draw stuff.

This commit is contained in:
T-moe
2016-01-18 16:15:51 +01:00
parent 6a136923d2
commit 91d6b2af96
8 changed files with 248 additions and 64 deletions

21
src/player.c Normal file
View File

@@ -0,0 +1,21 @@
#include "player.h"
#include <color.h>
void player_init(player_t* player) {
player->id=0;
player->color = GUI_COLOR_BLUE;
player->num_positions=1;
player->position = (point_t){.x=10,.y=100};
player->past_positions[0] = player->position;
player->direction = right;
player->state = alive;
}
void player_append_position(player_t* player, point_t point) {
if(player->num_positions < max_positions) {
player->past_positions[player->num_positions++] = point;
}
}