protomine/src/grid/shop.c

17 lines
473 B
C
Raw Normal View History

2021-06-01 22:49:16 +02:00
#include "grid.h"
#include "player.h"
2021-06-01 22:49:16 +02:00
#include "tiles.h"
2021-06-01 23:35:47 +02:00
void
grid_shop(struct Grid *restrict grid, struct Player *restrict player)
2021-06-01 23:35:47 +02:00
{
2021-06-01 22:49:16 +02:00
const int x_middle = grid->width / 2;
const int y_middle = grid->height / 2;
2021-06-01 23:35:47 +02:00
grid_set(grid, x_middle - 2, y_middle, TILE_CONTRACTS_SPEED_UP);
grid_set(grid, x_middle + 2, y_middle, TILE_CONTRACTS_SLOW_DOWN);
grid_set(grid, grid->width - 3, grid->height - 3, TILE_ZONE_TRANSITION);
*player = player_init(x_middle, y_middle + 2);
2021-06-01 22:49:16 +02:00
}