mirror of
https://git.planet-casio.com/Slyvtt/Collab_RPG.git
synced 2024-12-26 19:43:41 +01:00
clang-format sur src/* (+ hook clang-format ?)
This commit is contained in:
parent
7eaea821b6
commit
3f03c37bd2
1 changed files with 15 additions and 15 deletions
30
src/game.c
30
src/game.c
|
@ -86,12 +86,12 @@ void game_render_indicator(Game *game) {
|
|||
dimage(5, 5, &SignAction_img);
|
||||
int i;
|
||||
Player *player = &game->player;
|
||||
for(i=0;i<game->map_level->nbPortal;i++){
|
||||
for(i = 0; i < game->map_level->nbPortal; i++) {
|
||||
Portal *portal = &game->map_level->portals[i];
|
||||
if(player->x >= portal->collider.x1*PXSIZE &&
|
||||
player->x < portal->collider.x2*PXSIZE &&
|
||||
player->y >= portal->collider.y1*PXSIZE &&
|
||||
player->y < portal->collider.y2*PXSIZE){
|
||||
if(player->x >= portal->collider.x1 * PXSIZE &&
|
||||
player->x < portal->collider.x2 * PXSIZE &&
|
||||
player->y >= portal->collider.y1 * PXSIZE &&
|
||||
player->y < portal->collider.y2 * PXSIZE) {
|
||||
dimage(5, 5, &SignAction_img);
|
||||
break;
|
||||
}
|
||||
|
@ -144,19 +144,19 @@ void game_get_inputs(Game *game) {
|
|||
}
|
||||
}
|
||||
Player *player = &game->player;
|
||||
if(keydown(KEY_SHIFT)){
|
||||
if(keydown(KEY_SHIFT)) {
|
||||
int i;
|
||||
for(i=0;i<game->map_level->nbPortal;i++){
|
||||
for(i = 0; i < game->map_level->nbPortal; i++) {
|
||||
Portal *portal = &game->map_level->portals[i];
|
||||
if(player->x >= portal->collider.x1*PXSIZE &&
|
||||
player->x < portal->collider.x2*PXSIZE &&
|
||||
player->y >= portal->collider.y1*PXSIZE &&
|
||||
player->y < portal->collider.y2*PXSIZE){
|
||||
Portal *dest_portal = (Portal*)portal->portal;
|
||||
if(player->x >= portal->collider.x1 * PXSIZE &&
|
||||
player->x < portal->collider.x2 * PXSIZE &&
|
||||
player->y >= portal->collider.y1 * PXSIZE &&
|
||||
player->y < portal->collider.y2 * PXSIZE) {
|
||||
Portal *dest_portal = (Portal *)portal->portal;
|
||||
Collider dest_collider = dest_portal->collider;
|
||||
Map *dest_map = (Map*)portal->map;
|
||||
player->x = (dest_collider.x1+dest_collider.x2)/2*PXSIZE;
|
||||
player->y = (dest_collider.y1+dest_collider.y2)/2*PXSIZE;
|
||||
Map *dest_map = (Map *)portal->map;
|
||||
player->x = (dest_collider.x1 + dest_collider.x2) / 2 * PXSIZE;
|
||||
player->y = (dest_collider.y1 + dest_collider.y2) / 2 * PXSIZE;
|
||||
game->map_level = dest_map;
|
||||
/* TODO: Make something cleaner */
|
||||
while(keydown(KEY_SHIFT)) {
|
||||
|
|
Loading…
Reference in a new issue