summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/critter.cpp5
-rw-r--r--src/critter.hpp3
2 files changed, 4 insertions, 4 deletions
diff --git a/src/critter.cpp b/src/critter.cpp
index e5341ee6..3e88d8df 100644
--- a/src/critter.cpp
+++ b/src/critter.cpp
@@ -16,9 +16,6 @@ namespace floormat {
namespace {
-constexpr double framerate = 60, move_speed = 60;
-constexpr double frame_time = 1/framerate;
-
constexpr auto arrows_to_dir(bool left, bool right, bool up, bool down)
{
constexpr unsigned L = 1 << 3, R = 1 << 2, U = 1 << 1, D = 1 << 0;
@@ -63,7 +60,7 @@ static_assert(arrows_to_dir(true, true, false, false) == rotation_COUNT);
constexpr Vector2 rotation_to_vec(rotation r)
{
- constexpr double c = move_speed * frame_time;
+ constexpr double c = critter::move_speed * critter::frame_time;
constexpr double d = c / Vector2d{1, 1}.length();
constexpr Vector2 array[8] = {
diff --git a/src/critter.hpp b/src/critter.hpp
index f3d7a316..1148b82b 100644
--- a/src/critter.hpp
+++ b/src/critter.hpp
@@ -23,6 +23,9 @@ struct critter_proto : object_proto
struct critter final : object
{
+ static constexpr double framerate = 60, move_speed = 60;
+ static constexpr double frame_time = 1/framerate;
+
object_type type() const noexcept override;
explicit operator critter_proto() const;