about summary refs log tree commit diff stats
path: root/data/maps/the_great/rooms/Back Area.txtpb
blob: c1b8ab3b60d15b2d93feacba980015ab315fcc67 (plain) (blame)
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: "Back Area"
panel_display_name: "Back Area"
panels {
  name: "PLANT"
  path: "Panels/General/entry_14"
  clue: "plant"
  answer: "growth"
  symbols: NULL
}
panels {
  name: "TREE"
  path: "Panels/General/entry_15"
  clue: "tree"
  answer: "growth"
  symbols: NULL
}
panels {
  name: "PAINTING"
  path: "Panels/General/entry_11"
  clue: "painting"
  answer: "art"
  symbols: EXAMPLE
}
panels {
  name: "TOWEL"
  path: "Panels/Towers/tower_2"
  clue: "towel"
  answer: "tower"
  symbols: SPARKLES
}
panels {
  name: "Top Landscape Top"
  path: "Panels/Kiwi Room/kiwi_1"
  clue: ""
  answer: "one"
  symbols: QUESTION
}
panels {
  name: "Top Landscape Right"
  path: "Panels/Kiwi Room/kiwi_2"
  clue: ""
  answer: "road"
  symbols: QUESTION
}
panels {
  name: "Top Landscape Bottom"
  path: "Panels/Kiwi Room/kiwi_3"
  clue: ""
  answer: "many"
  symbols: QUESTION
}
panels {
  name: "Top Landscape Left"
  path: "Panels/Kiwi Room/kiwi_4"
  clue: ""
  answer: "turns"
  symbols: QUESTION
}
panels {
  name: "Left Landscape Top"
  path: "Panels/Kiwi Room/kiwi_5"
  clue: ""
  answer: "find"
  symbols: QUESTION
}
panels {
  name: "Left Landscape Right"
  path: "Panels/Kiwi Room/kiwi_6"
  clue: ""
  answer: "keys"
  symbols: QUESTION
}
panels {
  name: "Left Landscape Bottom"
  path: "Panels/Kiwi Room/kiwi_7"
  clue: ""
  answer: "write"
  symbols: QUESTION
}
panels {
  name: "Left Landscape Left"
  path: "Panels/Kiwi Room/kiwi_8"
  clue: ""
  answer: "words"
  symbols: QUESTION
}
panels {
  name: "Right Landscape Top"
  path: "Panels/Kiwi Room/kiwi_9"
  clue: ""
  answer: "hear"
  symbols: QUESTION
  proxies { answer: "tell" path: "Panels/Kiwi Proxies/kiwi_9_proxy_1" }
}
panels {
  name: "Right Landscape Right"
  path: "Panels/Kiwi Room/kiwi_10"
  clue: ""
  answer: "lies"
  symbols: QUESTION
}
panels {
  name: "Right Landscape Bottom"
  path: "Panels/Kiwi Room/kiwi_11"
  clue: ""
  answer: "the"
  symbols: QUESTION
}
panels {
  name: "Right Landscape Left"
  path: "Panels/Kiwi Room/kiwi_12"
  clue: ""
  answer: "ears"
  symbols: QUESTION
  proxies { answer: "eyes" path: "Panels/Kiwi Proxies/kiwi_12_proxy_1" }
}
paintings {
  name: "SPIRAL"
  path: "Components/Paintings/spiral"
  enter_only: true
  orientation: "north"
  required_door { name: "Spiral Painting" }
  # TODO: Hint painting type
}
ports {
  name: "UNKEMPT"
  path: "Meshes/Blocks/Warps/worldport5"
  orientation: "north"
}
ports {
  name: "THREEDOORS"
  path: "Meshes/Blocks/Warps/worldport16"
  orientation: "south"
}
ports {
  name: "TOWER"
  path: "Meshes/Blocks/Warps/worldport10"
  orientation: "south"
  required_door { name: "Tower Entrance" }
  # The reverse warp bypasses the door, so there needs to be two oneway connections.
}
ports {
  name: "TREE"
  path: "Meshes/Blocks/Warps/worldport17"
  orientation: "north"
}
#336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#ifndef GAME_H
#define GAME_H

class Game;

#include "map.h"
#include <memory>
#include "entity.h"
#include <functional>

const int TILE_WIDTH = 8;
const int TILE_HEIGHT = 8;
const int GAME_WIDTH = 320;
const int GAME_HEIGHT = 200;
const int MAP_WIDTH = GAME_WIDTH/TILE_WIDTH;
const int MAP_HEIGHT = GAME_HEIGHT/TILE_HEIGHT;

const int FRAMES_PER_SECOND = 60;
const double SECONDS_PER_FRAME = 1.0 / FRAMES_PER_SECOND;

struct Savefile {
  const Map* map;
  std::pair<double, double> position;
};

class Game {
  public:
    Game();
    void execute(GLFWwindow* window);
    void loadMap(const Map& map);
    void detectCollision(Entity& collider, std::pair<double, double> old_position);
    void saveGame(const Map& map, std::pair<double, double> position);
    void loadGame(const Map& curMap);
    void schedule(int frames, std::function<void ()>&& callback);
    
  private:
    friend void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods);

    std::list<std::shared_ptr<Entity>> entities;
    std::list<std::shared_ptr<Entity>> nextEntities;
    bool newWorld;
    std::shared_ptr<Entity> player;
    Map m{"../maps/embarass.txt"};
    Map m2{"../maps/second.txt"};
    Savefile save;
    std::list<std::pair<int, std::function<void ()>>> scheduled;
    bool shouldQuit = false;
};

#endif