protomine/src/game/init.c

22 lines
367 B
C

#include "game.h"
#include "grid.h"
struct Game
game_init(void)
{
struct Game game;
game.state = GameFloor;
game.floor = grid_new(1024, 14);
grid_random_walker(&game.floor);
game.player = player_init(0, game.floor.height / 2);
game.rest = grid_new(25, 14);
return game;
}
void
game_deinit(struct Game game)
{
grid_free(game.floor);
grid_free(game.rest);
}