rogged/src/movement.h
Squirrel Modeller 4dfe52ae72 movement: generalize; use vectors (#16)
Generalized movement, so that all entities move the same.

Reviewed-on: NotAShelf/rogged#16
Reviewed-by: raf <raf@notashelf.dev>
Co-authored-by: Squirrel Modeller <squirrelmodeller@protonmail.com>
Co-committed-by: Squirrel Modeller <squirrelmodeller@protonmail.com>
2026-04-09 14:11:46 +00:00

17 lines
458 B
C

#ifndef MOVEMENT_H
#define MOVEMENT_H
#include "common.h"
typedef enum {
MOVE_RESULT_MOVED,
MOVE_RESULT_BLOCKED_WALL,
MOVE_RESULT_BLOCKED_PLAYER,
MOVE_RESULT_BLOCKED_ENEMY
} MoveResult;
// Attempts to move entity in a given direction. Returns outcome of action.
MoveResult try_move_entity(Vec2 *p, Vec2 direction, Map *map, Player *player, Enemy *enemies, int enemy_count,
bool moving_is_player);
#endif // MOVEMENT_H