-
Notifications
You must be signed in to change notification settings - Fork 0
/
sokoban.h
81 lines (56 loc) · 2.55 KB
/
sokoban.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#pragma once
#include "common.h"
#include "entity_manager.h"
#include "level_set.h"
extern bool noclip;
// @Cleanup: Make a campaign state or something:
extern i32 current_level_index;
void advance_level(i32 delta, bool due_to_victory = false);
void init_level_general(bool reset);
void init_sokoban();
Entity_Manager *get_entity_manager();
Guy *get_active_hero(Entity_Manager *manager);
void simulate_sokoban();
void post_undo_reevaluate(Entity_Manager *manager);
Transaction_Id get_next_transaction_id(Entity_Manager *manager);
bool maybe_retire_next_transaction(Entity_Manager *manager);
void enact_next_buffered_move(Entity_Manager *manager, bool first_call = true);
void change_active_state(Guy *guy, bool active, bool force = false);
struct Pose_Channel;
struct Sampled_Animation;
Pose_Channel *play_animation(Entity *e, Sampled_Animation *anim, f32 t0 = 0.0f, f32 blend_out_duration = .2f, Sampled_Animation *next = NULL);
void play_animation(Entity *e, String name, bool looping = true, bool frozen = false, f32 t0 = 0.0f, bool blend = true);
void animate(Guy *guy, Human_Animation_State::Gameplay_State state);
#include "visit_struct.h"
struct Gameplay_Visuals // Strings inside here must not be literals so they must be heap allocated.
{
f32 visual_position_duration = 1.0f;
f32 general_turning_degrees_per_second = 500.0f;
f32 default_running_speed = 5.0f; // How many tiles per second
f32 move_accel_time_default = 0.15f;
f32 move_decel_distance_default = 0.15f;
f32 victory_transition_time = 0.3f;
f32 level_start_transition_time = 0.6f;
f32 distance_epsilon = 0.1f;
f32 wizard_teleport_pre_time = 0.05f;
f32 wizard_teleport_post_time = 0.13f;
f32 endpoint_teleport_pre_time = 0.05f;
f32 endpoint_teleport_post_time = 0.13f;
// f32 min_fidget_time = 0.5f;
// f32 max_fidget_time = 3.0f;
};
// @Cleanup: Because we want the default initialization goodness, we cannot use the intrusive syntax of visit_struct.h
VISITABLE_STRUCT(Gameplay_Visuals,
visual_position_duration,
general_turning_degrees_per_second,
default_running_speed,
move_accel_time_default,
move_decel_distance_default,
victory_transition_time,
level_start_transition_time,
distance_epsilon,
wizard_teleport_pre_time,
wizard_teleport_post_time,
endpoint_teleport_pre_time,
endpoint_teleport_post_time);
extern Gameplay_Visuals gameplay_visuals;