26 for (
auto&& [tf, vel] : view) {
30 if (vel.speed > 0.0f) {
31 tf.position.x += vel.
direction.
x * vel.speed * dt;
32 tf.position.y += vel.direction.y * vel.speed * dt;
34 tf.position.x += vel.direction.x * dt;
35 tf.position.y += vel.direction.y * dt;
45 constexpr float kWindowWidth = 1280.0f;
46 constexpr float kWindowHeight = 720.0f;
48 for (
auto&& [tf, box, type] : playerView) {
53 if (tf.position.x < 0.0f) tf.position.x = 0.0f;
54 if (tf.position.y < 0.0f) tf.position.y = 0.0f;
56 const float maxX = kWindowWidth - box.width;
57 const float maxY = kWindowHeight - box.height;
59 if (tf.position.x > maxX) tf.position.x = maxX;
60 if (tf.position.y > maxY) tf.position.y = maxY;