nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
walking.h
Go to the documentation of this file.
1#ifndef NANOMMO_SERVER_WALKING_H_
2#define NANOMMO_SERVER_WALKING_H_
3
4#include "terrain/terrain.h"
5
6namespace nanommo {
7
8/// In tiles a second. A tile is a metre, and walking is the walk clip's speed.
9inline constexpr float kWalkSpeed = 1.8f;
10inline constexpr float kRunSpeed = 3.1f;
11
12/// Moves to the place, or if the terrain's in the way there, as far as it can
13/// along x or along z alone, so that it slides along a coast.
14void Walk(const Terrain& terrain, float& x, float& z, float to_x, float to_z);
15
16/// Walks from x, z for that many seconds, along the direction, at the walk's
17/// speed or the run's, no faster on a diagonal, inside the land's edge and on
18/// land. The server walks a
19/// player with it each tick, and the client walks you with it before the
20/// server answers, so both have to come out the same.
21void WalkAlong(const Terrain& terrain, float& x, float& z, float direction_x,
22 float direction_z, bool run, float seconds);
23
24} // namespace nanommo
25
26#endif // NANOMMO_SERVER_WALKING_H_
Definition chat.cc:9
constexpr float kWalkSpeed
In tiles a second. A tile is a metre, and walking is the walk clip's speed.
Definition walking.h:9
constexpr float kRunSpeed
Definition walking.h:10
void Walk(const Terrain &terrain, float &x, float &z, float to_x, float to_z)
Definition walking.cc:8
void WalkAlong(const Terrain &terrain, float &x, float &z, float direction_x, float direction_z, bool run, float seconds)
Definition walking.cc:19