├── .gitattributes ├── .gitignore ├── LICENSE ├── assets ├── font │ ├── PressStart2P-vaV7.ttf │ ├── large.font │ └── main.font ├── ogg │ └── beep.ogg └── png │ ├── splash.png │ └── tiles.png ├── game.project ├── game ├── core │ ├── camera.script │ ├── common.collection │ ├── game.camera │ ├── game.collection │ ├── game.tilesource │ └── loader.script ├── gui │ ├── clear.gui │ ├── complete.gui │ ├── default.gui_script │ ├── game.gui │ ├── game.gui_script │ ├── gameover.gui │ ├── pause.gui │ ├── pause.gui_script │ ├── shutter.gui │ └── shutter.gui_script ├── levels │ ├── level.script │ ├── level1.collection │ └── level1.tilemap └── player │ ├── player.go │ └── player.script ├── main ├── custom.render ├── custom.render_script ├── data.lua ├── game.input_binding ├── handler.script ├── main.atlas ├── main.collection └── ui.lua └── menu ├── controls.gui ├── credits.gui ├── menu.collection ├── menu.gui ├── menu.gui_script └── static.gui_script /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.internal 2 | /build 3 | .externalToolBuilders 4 | .DS_Store 5 | Thumbs.db 6 | pspbrwse.jbf 7 | .lock-wscript 8 | *.pyc 9 | .project 10 | .cproject 11 | builtins -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Ben James 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /assets/font/PressStart2P-vaV7.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benjames-171/def-shell/acdb6c8ce785c51a3fadd76a83a748a50d607735/assets/font/PressStart2P-vaV7.ttf -------------------------------------------------------------------------------- /assets/font/large.font: -------------------------------------------------------------------------------- 1 | font: "/assets/font/PressStart2P-vaV7.ttf" 2 | material: "/builtins/fonts/font.material" 3 | size: 32 4 | antialias: 0 5 | alpha: 1.0 6 | outline_alpha: 1.0 7 | outline_width: 0.0 8 | shadow_alpha: 0.0 9 | shadow_blur: 0 10 | shadow_x: 0.0 11 | shadow_y: 0.0 12 | extra_characters: "" 13 | output_format: TYPE_BITMAP 14 | all_chars: false 15 | cache_width: 0 16 | cache_height: 0 17 | render_mode: MODE_SINGLE_LAYER 18 | -------------------------------------------------------------------------------- /assets/font/main.font: -------------------------------------------------------------------------------- 1 | font: "/assets/font/PressStart2P-vaV7.ttf" 2 | material: "/builtins/fonts/font.material" 3 | size: 24 4 | antialias: 0 5 | alpha: 1.0 6 | outline_alpha: 1.0 7 | outline_width: 0.0 8 | shadow_alpha: 0.0 9 | shadow_blur: 0 10 | shadow_x: 0.0 11 | shadow_y: 0.0 12 | extra_characters: "" 13 | output_format: TYPE_BITMAP 14 | all_chars: false 15 | cache_width: 0 16 | cache_height: 0 17 | render_mode: MODE_SINGLE_LAYER 18 | -------------------------------------------------------------------------------- /assets/ogg/beep.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benjames-171/def-shell/acdb6c8ce785c51a3fadd76a83a748a50d607735/assets/ogg/beep.ogg -------------------------------------------------------------------------------- /assets/png/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benjames-171/def-shell/acdb6c8ce785c51a3fadd76a83a748a50d607735/assets/png/splash.png -------------------------------------------------------------------------------- /assets/png/tiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benjames-171/def-shell/acdb6c8ce785c51a3fadd76a83a748a50d607735/assets/png/tiles.png -------------------------------------------------------------------------------- /game.project: -------------------------------------------------------------------------------- 1 | [bootstrap] 2 | main_collection = /main/main.collectionc 3 | render = /main/custom.renderc 4 | 5 | [graphics] 6 | default_texture_min_filter = nearest 7 | default_texture_mag_filter = nearest 8 | 9 | [script] 10 | shared_state = 1 11 | 12 | [html5] 13 | splash_image = /assets/png/splash.png 14 | cssfile = /builtins/manifests/web/dark_theme.css 15 | scale_mode = fit 16 | show_console_banner = 0 17 | show_made_with_defold = 0 18 | show_fullscreen_button = 0 19 | 20 | [spine] 21 | max_count = 0 22 | 23 | [input] 24 | game_binding = /main/game.input_bindingc 25 | 26 | [project] 27 | dependencies#0 = https://github.com/subsoap/defos/archive/master.zip 28 | 29 | -------------------------------------------------------------------------------- /game/core/camera.script: -------------------------------------------------------------------------------- 1 | local data = require "main.data" 2 | 3 | local SPEED = 0.15 4 | 5 | function init(self) 6 | msg.post("#camera", "acquire_camera_focus") 7 | self.target = vmath.vector3(0) 8 | self.pos = go.get_world_position() 9 | end 10 | 11 | local function bounds(pos) 12 | if pos.x < data.bounds.x then pos.x = data.bounds.x end 13 | if pos.x > data.bounds.z then pos.x = data.bounds.z end 14 | if pos.y < data.bounds.y then pos.y = data.bounds.y end 15 | if pos.y > data.bounds.w then pos.y = data.bounds.w end 16 | 17 | return pos 18 | end 19 | 20 | local function move(self) 21 | local v = vmath.vector3((self.target.x - self.pos.x) * SPEED, (self.target.y - self.pos.y) * SPEED, 0) 22 | self.pos = self.pos + v 23 | end 24 | 25 | function update(self, dt) 26 | if data.state == data.STATE_PLAYING then 27 | move(self) 28 | local pos = bounds(self.pos - data.offset) 29 | go.set_position(pos) 30 | data.scrollpos = pos 31 | end 32 | end 33 | 34 | function on_message(self, message_id, message, sender) 35 | if message_id == hash("point") then 36 | if self.target == vmath.vector3(0) then 37 | self.pos = message.pos 38 | end 39 | self.target = message.pos + vmath.vector3(0, 0, 0) 40 | elseif message_id == hash("reset") then 41 | go.set_position(vmath.vector3(0)) 42 | end 43 | end -------------------------------------------------------------------------------- /game/core/common.collection: -------------------------------------------------------------------------------- 1 | name: "common" 2 | instances { 3 | id: "player" 4 | prototype: "/game/player/player.go" 5 | position { 6 | x: 0.0 7 | y: 0.0 8 | z: 0.0 9 | } 10 | rotation { 11 | x: 0.0 12 | y: 0.0 13 | z: 0.0 14 | w: 1.0 15 | } 16 | scale3 { 17 | x: 1.0 18 | y: 1.0 19 | z: 1.0 20 | } 21 | } 22 | scale_along_z: 0 23 | embedded_instances { 24 | id: "view" 25 | data: "components {\n" 26 | " id: \"camera\"\n" 27 | " component: \"/game/core/game.camera\"\n" 28 | " position {\n" 29 | " x: 0.0\n" 30 | " y: 0.0\n" 31 | " z: 0.0\n" 32 | " }\n" 33 | " rotation {\n" 34 | " x: 0.0\n" 35 | " y: 0.0\n" 36 | " z: 0.0\n" 37 | " w: 1.0\n" 38 | " }\n" 39 | " property_decls {\n" 40 | " }\n" 41 | "}\n" 42 | "components {\n" 43 | " id: \"game\"\n" 44 | " component: \"/game/gui/game.gui\"\n" 45 | " position {\n" 46 | " x: 0.0\n" 47 | " y: 0.0\n" 48 | " z: 0.0\n" 49 | " }\n" 50 | " rotation {\n" 51 | " x: 0.0\n" 52 | " y: 0.0\n" 53 | " z: 0.0\n" 54 | " w: 1.0\n" 55 | " }\n" 56 | " property_decls {\n" 57 | " }\n" 58 | "}\n" 59 | "components {\n" 60 | " id: \"script\"\n" 61 | " component: \"/game/core/camera.script\"\n" 62 | " position {\n" 63 | " x: 0.0\n" 64 | " y: 0.0\n" 65 | " z: 0.0\n" 66 | " }\n" 67 | " rotation {\n" 68 | " x: 0.0\n" 69 | " y: 0.0\n" 70 | " z: 0.0\n" 71 | " w: 1.0\n" 72 | " }\n" 73 | " property_decls {\n" 74 | " }\n" 75 | "}\n" 76 | "components {\n" 77 | " id: \"shutter\"\n" 78 | " component: \"/game/gui/shutter.gui\"\n" 79 | " position {\n" 80 | " x: 0.0\n" 81 | " y: 0.0\n" 82 | " z: 0.0\n" 83 | " }\n" 84 | " rotation {\n" 85 | " x: 0.0\n" 86 | " y: 0.0\n" 87 | " z: 0.0\n" 88 | " w: 1.0\n" 89 | " }\n" 90 | " property_decls {\n" 91 | " }\n" 92 | "}\n" 93 | "components {\n" 94 | " id: \"gameover\"\n" 95 | " component: \"/game/gui/gameover.gui\"\n" 96 | " position {\n" 97 | " x: 0.0\n" 98 | " y: 0.0\n" 99 | " z: 0.0\n" 100 | " }\n" 101 | " rotation {\n" 102 | " x: 0.0\n" 103 | " y: 0.0\n" 104 | " z: 0.0\n" 105 | " w: 1.0\n" 106 | " }\n" 107 | " property_decls {\n" 108 | " }\n" 109 | "}\n" 110 | "components {\n" 111 | " id: \"clear\"\n" 112 | " component: \"/game/gui/clear.gui\"\n" 113 | " position {\n" 114 | " x: 0.0\n" 115 | " y: 0.0\n" 116 | " z: 0.0\n" 117 | " }\n" 118 | " rotation {\n" 119 | " x: 0.0\n" 120 | " y: 0.0\n" 121 | " z: 0.0\n" 122 | " w: 1.0\n" 123 | " }\n" 124 | " property_decls {\n" 125 | " }\n" 126 | "}\n" 127 | "components {\n" 128 | " id: \"pause\"\n" 129 | " component: \"/game/gui/pause.gui\"\n" 130 | " position {\n" 131 | " x: 0.0\n" 132 | " y: 0.0\n" 133 | " z: 0.0\n" 134 | " }\n" 135 | " rotation {\n" 136 | " x: 0.0\n" 137 | " y: 0.0\n" 138 | " z: 0.0\n" 139 | " w: 1.0\n" 140 | " }\n" 141 | " property_decls {\n" 142 | " }\n" 143 | "}\n" 144 | "components {\n" 145 | " id: \"complete\"\n" 146 | " component: \"/game/gui/complete.gui\"\n" 147 | " position {\n" 148 | " x: 0.0\n" 149 | " y: 0.0\n" 150 | " z: 0.0\n" 151 | " }\n" 152 | " rotation {\n" 153 | " x: 0.0\n" 154 | " y: 0.0\n" 155 | " z: 0.0\n" 156 | " w: 1.0\n" 157 | " }\n" 158 | " property_decls {\n" 159 | " }\n" 160 | "}\n" 161 | "" 162 | position { 163 | x: 0.0 164 | y: 0.0 165 | z: 0.0 166 | } 167 | rotation { 168 | x: 0.0 169 | y: 0.0 170 | z: 0.0 171 | w: 1.0 172 | } 173 | scale3 { 174 | x: 1.0 175 | y: 1.0 176 | z: 1.0 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /game/core/game.camera: -------------------------------------------------------------------------------- 1 | aspect_ratio: 1.78 2 | fov: 45.0 3 | near_z: 0.1 4 | far_z: 1000.0 5 | auto_aspect_ratio: 1 6 | -------------------------------------------------------------------------------- /game/core/game.collection: -------------------------------------------------------------------------------- 1 | name: "game" 2 | scale_along_z: 0 3 | embedded_instances { 4 | id: "loader" 5 | data: "components {\n" 6 | " id: \"script\"\n" 7 | " component: \"/game/core/loader.script\"\n" 8 | " position {\n" 9 | " x: 0.0\n" 10 | " y: 0.0\n" 11 | " z: 0.0\n" 12 | " }\n" 13 | " rotation {\n" 14 | " x: 0.0\n" 15 | " y: 0.0\n" 16 | " z: 0.0\n" 17 | " w: 1.0\n" 18 | " }\n" 19 | "}\n" 20 | "embedded_components {\n" 21 | " id: \"level1\"\n" 22 | " type: \"collectionproxy\"\n" 23 | " data: \"collection: \\\"/game/levels/level1.collection\\\"\\n" 24 | "exclude: false\\n" 25 | "\"\n" 26 | " position {\n" 27 | " x: 0.0\n" 28 | " y: 0.0\n" 29 | " z: 0.0\n" 30 | " }\n" 31 | " rotation {\n" 32 | " x: 0.0\n" 33 | " y: 0.0\n" 34 | " z: 0.0\n" 35 | " w: 1.0\n" 36 | " }\n" 37 | "}\n" 38 | "" 39 | position { 40 | x: 0.0 41 | y: 0.0 42 | z: 1.0 43 | } 44 | rotation { 45 | x: 0.0 46 | y: 0.0 47 | z: 0.0 48 | w: 1.0 49 | } 50 | scale3 { 51 | x: 1.0 52 | y: 1.0 53 | z: 1.0 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /game/core/game.tilesource: -------------------------------------------------------------------------------- 1 | image: "/assets/png/tiles.png" 2 | tile_width: 16 3 | tile_height: 16 4 | tile_margin: 0 5 | tile_spacing: 0 6 | collision: "/assets/png/tiles.png" 7 | material_tag: "tile" 8 | convex_hulls { 9 | index: 0 10 | count: 4 11 | collision_group: "" 12 | } 13 | convex_hulls { 14 | index: 4 15 | count: 4 16 | collision_group: "" 17 | } 18 | convex_hulls { 19 | index: 8 20 | count: 4 21 | collision_group: "" 22 | } 23 | convex_hulls { 24 | index: 12 25 | count: 8 26 | collision_group: "" 27 | } 28 | convex_hulls { 29 | index: 20 30 | count: 0 31 | collision_group: "" 32 | } 33 | convex_hulls { 34 | index: 20 35 | count: 0 36 | collision_group: "" 37 | } 38 | convex_hulls { 39 | index: 20 40 | count: 0 41 | collision_group: "" 42 | } 43 | convex_hulls { 44 | index: 20 45 | count: 0 46 | collision_group: "" 47 | } 48 | convex_hulls { 49 | index: 20 50 | count: 0 51 | collision_group: "" 52 | } 53 | convex_hulls { 54 | index: 20 55 | count: 0 56 | collision_group: "" 57 | } 58 | convex_hulls { 59 | index: 20 60 | count: 0 61 | collision_group: "" 62 | } 63 | convex_hulls { 64 | index: 20 65 | count: 0 66 | collision_group: "" 67 | } 68 | convex_hulls { 69 | index: 20 70 | count: 0 71 | collision_group: "" 72 | } 73 | convex_hulls { 74 | index: 20 75 | count: 0 76 | collision_group: "" 77 | } 78 | convex_hulls { 79 | index: 20 80 | count: 0 81 | collision_group: "" 82 | } 83 | convex_hulls { 84 | index: 20 85 | count: 0 86 | collision_group: "" 87 | } 88 | convex_hulls { 89 | index: 20 90 | count: 0 91 | collision_group: "" 92 | } 93 | convex_hulls { 94 | index: 20 95 | count: 0 96 | collision_group: "" 97 | } 98 | convex_hulls { 99 | index: 20 100 | count: 0 101 | collision_group: "" 102 | } 103 | convex_hulls { 104 | index: 20 105 | count: 0 106 | collision_group: "" 107 | } 108 | convex_hulls { 109 | index: 20 110 | count: 0 111 | collision_group: "" 112 | } 113 | convex_hulls { 114 | index: 20 115 | count: 0 116 | collision_group: "" 117 | } 118 | convex_hulls { 119 | index: 20 120 | count: 0 121 | collision_group: "" 122 | } 123 | convex_hulls { 124 | index: 20 125 | count: 0 126 | collision_group: "" 127 | } 128 | convex_hulls { 129 | index: 20 130 | count: 0 131 | collision_group: "" 132 | } 133 | convex_hulls { 134 | index: 20 135 | count: 0 136 | collision_group: "" 137 | } 138 | convex_hulls { 139 | index: 20 140 | count: 0 141 | collision_group: "" 142 | } 143 | convex_hulls { 144 | index: 20 145 | count: 0 146 | collision_group: "" 147 | } 148 | convex_hulls { 149 | index: 20 150 | count: 4 151 | collision_group: "world" 152 | } 153 | convex_hulls { 154 | index: 24 155 | count: 0 156 | collision_group: "" 157 | } 158 | convex_hulls { 159 | index: 24 160 | count: 0 161 | collision_group: "" 162 | } 163 | convex_hulls { 164 | index: 24 165 | count: 0 166 | collision_group: "" 167 | } 168 | convex_hulls { 169 | index: 24 170 | count: 0 171 | collision_group: "" 172 | } 173 | convex_hulls { 174 | index: 24 175 | count: 0 176 | collision_group: "" 177 | } 178 | convex_hulls { 179 | index: 24 180 | count: 0 181 | collision_group: "" 182 | } 183 | convex_hulls { 184 | index: 24 185 | count: 0 186 | collision_group: "" 187 | } 188 | convex_hulls { 189 | index: 24 190 | count: 0 191 | collision_group: "" 192 | } 193 | convex_hulls { 194 | index: 24 195 | count: 0 196 | collision_group: "" 197 | } 198 | convex_hulls { 199 | index: 24 200 | count: 0 201 | collision_group: "" 202 | } 203 | convex_hulls { 204 | index: 24 205 | count: 0 206 | collision_group: "" 207 | } 208 | convex_hulls { 209 | index: 24 210 | count: 0 211 | collision_group: "" 212 | } 213 | convex_hulls { 214 | index: 24 215 | count: 0 216 | collision_group: "" 217 | } 218 | convex_hulls { 219 | index: 24 220 | count: 0 221 | collision_group: "" 222 | } 223 | convex_hulls { 224 | index: 24 225 | count: 0 226 | collision_group: "" 227 | } 228 | convex_hulls { 229 | index: 24 230 | count: 0 231 | collision_group: "" 232 | } 233 | convex_hulls { 234 | index: 24 235 | count: 0 236 | collision_group: "" 237 | } 238 | convex_hulls { 239 | index: 24 240 | count: 0 241 | collision_group: "" 242 | } 243 | convex_hulls { 244 | index: 24 245 | count: 0 246 | collision_group: "" 247 | } 248 | convex_hulls { 249 | index: 24 250 | count: 0 251 | collision_group: "" 252 | } 253 | convex_hulls { 254 | index: 24 255 | count: 0 256 | collision_group: "" 257 | } 258 | convex_hulls { 259 | index: 24 260 | count: 0 261 | collision_group: "" 262 | } 263 | convex_hulls { 264 | index: 24 265 | count: 0 266 | collision_group: "" 267 | } 268 | convex_hulls { 269 | index: 24 270 | count: 0 271 | collision_group: "" 272 | } 273 | convex_hulls { 274 | index: 24 275 | count: 0 276 | collision_group: "" 277 | } 278 | convex_hulls { 279 | index: 24 280 | count: 0 281 | collision_group: "" 282 | } 283 | convex_hulls { 284 | index: 24 285 | count: 0 286 | collision_group: "" 287 | } 288 | convex_hulls { 289 | index: 24 290 | count: 0 291 | collision_group: "" 292 | } 293 | convex_hulls { 294 | index: 24 295 | count: 0 296 | collision_group: "" 297 | } 298 | convex_hulls { 299 | index: 24 300 | count: 0 301 | collision_group: "" 302 | } 303 | convex_hulls { 304 | index: 24 305 | count: 0 306 | collision_group: "" 307 | } 308 | convex_hulls { 309 | index: 24 310 | count: 0 311 | collision_group: "" 312 | } 313 | convex_hulls { 314 | index: 24 315 | count: 0 316 | collision_group: "" 317 | } 318 | convex_hulls { 319 | index: 24 320 | count: 0 321 | collision_group: "" 322 | } 323 | convex_hulls { 324 | index: 24 325 | count: 0 326 | collision_group: "" 327 | } 328 | convex_hulls { 329 | index: 24 330 | count: 0 331 | collision_group: "" 332 | } 333 | convex_hulls { 334 | index: 24 335 | count: 0 336 | collision_group: "" 337 | } 338 | convex_hulls { 339 | index: 24 340 | count: 0 341 | collision_group: "" 342 | } 343 | convex_hulls { 344 | index: 24 345 | count: 0 346 | collision_group: "" 347 | } 348 | convex_hulls { 349 | index: 24 350 | count: 0 351 | collision_group: "" 352 | } 353 | convex_hulls { 354 | index: 24 355 | count: 0 356 | collision_group: "" 357 | } 358 | convex_hulls { 359 | index: 24 360 | count: 0 361 | collision_group: "" 362 | } 363 | convex_hulls { 364 | index: 24 365 | count: 0 366 | collision_group: "" 367 | } 368 | convex_hulls { 369 | index: 24 370 | count: 0 371 | collision_group: "" 372 | } 373 | convex_hulls { 374 | index: 24 375 | count: 0 376 | collision_group: "" 377 | } 378 | convex_hulls { 379 | index: 24 380 | count: 0 381 | collision_group: "" 382 | } 383 | convex_hulls { 384 | index: 24 385 | count: 0 386 | collision_group: "" 387 | } 388 | convex_hulls { 389 | index: 24 390 | count: 0 391 | collision_group: "" 392 | } 393 | convex_hulls { 394 | index: 24 395 | count: 0 396 | collision_group: "" 397 | } 398 | convex_hulls { 399 | index: 24 400 | count: 0 401 | collision_group: "" 402 | } 403 | convex_hulls { 404 | index: 24 405 | count: 0 406 | collision_group: "" 407 | } 408 | convex_hulls { 409 | index: 24 410 | count: 0 411 | collision_group: "" 412 | } 413 | convex_hulls { 414 | index: 24 415 | count: 0 416 | collision_group: "" 417 | } 418 | convex_hulls { 419 | index: 24 420 | count: 0 421 | collision_group: "" 422 | } 423 | convex_hulls { 424 | index: 24 425 | count: 0 426 | collision_group: "" 427 | } 428 | convex_hulls { 429 | index: 24 430 | count: 0 431 | collision_group: "" 432 | } 433 | convex_hulls { 434 | index: 24 435 | count: 0 436 | collision_group: "" 437 | } 438 | convex_hulls { 439 | index: 24 440 | count: 0 441 | collision_group: "" 442 | } 443 | convex_hulls { 444 | index: 24 445 | count: 0 446 | collision_group: "" 447 | } 448 | convex_hulls { 449 | index: 24 450 | count: 0 451 | collision_group: "" 452 | } 453 | convex_hulls { 454 | index: 24 455 | count: 0 456 | collision_group: "" 457 | } 458 | convex_hulls { 459 | index: 24 460 | count: 0 461 | collision_group: "" 462 | } 463 | convex_hulls { 464 | index: 24 465 | count: 0 466 | collision_group: "" 467 | } 468 | convex_hulls { 469 | index: 24 470 | count: 0 471 | collision_group: "" 472 | } 473 | convex_hulls { 474 | index: 24 475 | count: 0 476 | collision_group: "" 477 | } 478 | convex_hulls { 479 | index: 24 480 | count: 0 481 | collision_group: "" 482 | } 483 | convex_hulls { 484 | index: 24 485 | count: 0 486 | collision_group: "" 487 | } 488 | convex_hulls { 489 | index: 24 490 | count: 0 491 | collision_group: "" 492 | } 493 | convex_hulls { 494 | index: 24 495 | count: 0 496 | collision_group: "" 497 | } 498 | convex_hulls { 499 | index: 24 500 | count: 0 501 | collision_group: "" 502 | } 503 | convex_hulls { 504 | index: 24 505 | count: 0 506 | collision_group: "" 507 | } 508 | convex_hulls { 509 | index: 24 510 | count: 0 511 | collision_group: "" 512 | } 513 | convex_hulls { 514 | index: 24 515 | count: 0 516 | collision_group: "" 517 | } 518 | convex_hulls { 519 | index: 24 520 | count: 0 521 | collision_group: "" 522 | } 523 | convex_hulls { 524 | index: 24 525 | count: 0 526 | collision_group: "" 527 | } 528 | convex_hulls { 529 | index: 24 530 | count: 0 531 | collision_group: "" 532 | } 533 | convex_hulls { 534 | index: 24 535 | count: 0 536 | collision_group: "" 537 | } 538 | convex_hulls { 539 | index: 24 540 | count: 0 541 | collision_group: "" 542 | } 543 | convex_hulls { 544 | index: 24 545 | count: 0 546 | collision_group: "" 547 | } 548 | convex_hulls { 549 | index: 24 550 | count: 0 551 | collision_group: "" 552 | } 553 | convex_hulls { 554 | index: 24 555 | count: 0 556 | collision_group: "" 557 | } 558 | convex_hulls { 559 | index: 24 560 | count: 0 561 | collision_group: "" 562 | } 563 | convex_hulls { 564 | index: 24 565 | count: 0 566 | collision_group: "" 567 | } 568 | convex_hulls { 569 | index: 24 570 | count: 0 571 | collision_group: "" 572 | } 573 | convex_hulls { 574 | index: 24 575 | count: 0 576 | collision_group: "" 577 | } 578 | convex_hulls { 579 | index: 24 580 | count: 0 581 | collision_group: "" 582 | } 583 | convex_hulls { 584 | index: 24 585 | count: 0 586 | collision_group: "" 587 | } 588 | convex_hulls { 589 | index: 24 590 | count: 0 591 | collision_group: "" 592 | } 593 | convex_hulls { 594 | index: 24 595 | count: 0 596 | collision_group: "" 597 | } 598 | convex_hulls { 599 | index: 24 600 | count: 0 601 | collision_group: "" 602 | } 603 | convex_hulls { 604 | index: 24 605 | count: 0 606 | collision_group: "" 607 | } 608 | convex_hulls { 609 | index: 24 610 | count: 0 611 | collision_group: "" 612 | } 613 | convex_hulls { 614 | index: 24 615 | count: 0 616 | collision_group: "" 617 | } 618 | convex_hulls { 619 | index: 24 620 | count: 0 621 | collision_group: "" 622 | } 623 | convex_hulls { 624 | index: 24 625 | count: 0 626 | collision_group: "" 627 | } 628 | convex_hulls { 629 | index: 24 630 | count: 0 631 | collision_group: "" 632 | } 633 | convex_hulls { 634 | index: 24 635 | count: 0 636 | collision_group: "" 637 | } 638 | convex_hulls { 639 | index: 24 640 | count: 0 641 | collision_group: "" 642 | } 643 | convex_hulls { 644 | index: 24 645 | count: 0 646 | collision_group: "" 647 | } 648 | convex_hulls { 649 | index: 24 650 | count: 0 651 | collision_group: "" 652 | } 653 | convex_hulls { 654 | index: 24 655 | count: 0 656 | collision_group: "" 657 | } 658 | convex_hulls { 659 | index: 24 660 | count: 0 661 | collision_group: "" 662 | } 663 | convex_hulls { 664 | index: 24 665 | count: 0 666 | collision_group: "" 667 | } 668 | convex_hulls { 669 | index: 24 670 | count: 0 671 | collision_group: "" 672 | } 673 | convex_hulls { 674 | index: 24 675 | count: 0 676 | collision_group: "" 677 | } 678 | convex_hulls { 679 | index: 24 680 | count: 0 681 | collision_group: "" 682 | } 683 | convex_hulls { 684 | index: 24 685 | count: 0 686 | collision_group: "" 687 | } 688 | convex_hulls { 689 | index: 24 690 | count: 0 691 | collision_group: "" 692 | } 693 | convex_hulls { 694 | index: 24 695 | count: 0 696 | collision_group: "" 697 | } 698 | convex_hulls { 699 | index: 24 700 | count: 0 701 | collision_group: "" 702 | } 703 | convex_hulls { 704 | index: 24 705 | count: 0 706 | collision_group: "" 707 | } 708 | convex_hulls { 709 | index: 24 710 | count: 0 711 | collision_group: "" 712 | } 713 | convex_hulls { 714 | index: 24 715 | count: 0 716 | collision_group: "" 717 | } 718 | convex_hulls { 719 | index: 24 720 | count: 0 721 | collision_group: "" 722 | } 723 | convex_hulls { 724 | index: 24 725 | count: 0 726 | collision_group: "" 727 | } 728 | convex_hulls { 729 | index: 24 730 | count: 0 731 | collision_group: "" 732 | } 733 | convex_hulls { 734 | index: 24 735 | count: 0 736 | collision_group: "" 737 | } 738 | convex_hulls { 739 | index: 24 740 | count: 0 741 | collision_group: "" 742 | } 743 | convex_hulls { 744 | index: 24 745 | count: 0 746 | collision_group: "" 747 | } 748 | convex_hulls { 749 | index: 24 750 | count: 0 751 | collision_group: "" 752 | } 753 | convex_hulls { 754 | index: 24 755 | count: 0 756 | collision_group: "" 757 | } 758 | convex_hulls { 759 | index: 24 760 | count: 0 761 | collision_group: "" 762 | } 763 | convex_hulls { 764 | index: 24 765 | count: 0 766 | collision_group: "" 767 | } 768 | convex_hulls { 769 | index: 24 770 | count: 0 771 | collision_group: "" 772 | } 773 | convex_hulls { 774 | index: 24 775 | count: 0 776 | collision_group: "" 777 | } 778 | convex_hulls { 779 | index: 24 780 | count: 0 781 | collision_group: "" 782 | } 783 | convex_hulls { 784 | index: 24 785 | count: 0 786 | collision_group: "" 787 | } 788 | convex_hulls { 789 | index: 24 790 | count: 0 791 | collision_group: "" 792 | } 793 | convex_hulls { 794 | index: 24 795 | count: 0 796 | collision_group: "" 797 | } 798 | convex_hulls { 799 | index: 24 800 | count: 0 801 | collision_group: "" 802 | } 803 | convex_hulls { 804 | index: 24 805 | count: 0 806 | collision_group: "" 807 | } 808 | convex_hulls { 809 | index: 24 810 | count: 0 811 | collision_group: "" 812 | } 813 | convex_hulls { 814 | index: 24 815 | count: 0 816 | collision_group: "" 817 | } 818 | convex_hulls { 819 | index: 24 820 | count: 0 821 | collision_group: "" 822 | } 823 | convex_hulls { 824 | index: 24 825 | count: 0 826 | collision_group: "" 827 | } 828 | convex_hulls { 829 | index: 24 830 | count: 0 831 | collision_group: "" 832 | } 833 | convex_hulls { 834 | index: 24 835 | count: 0 836 | collision_group: "" 837 | } 838 | convex_hulls { 839 | index: 24 840 | count: 0 841 | collision_group: "" 842 | } 843 | convex_hulls { 844 | index: 24 845 | count: 0 846 | collision_group: "" 847 | } 848 | convex_hulls { 849 | index: 24 850 | count: 0 851 | collision_group: "" 852 | } 853 | convex_hulls { 854 | index: 24 855 | count: 0 856 | collision_group: "" 857 | } 858 | convex_hulls { 859 | index: 24 860 | count: 0 861 | collision_group: "" 862 | } 863 | convex_hulls { 864 | index: 24 865 | count: 0 866 | collision_group: "" 867 | } 868 | convex_hulls { 869 | index: 24 870 | count: 0 871 | collision_group: "" 872 | } 873 | convex_hulls { 874 | index: 24 875 | count: 0 876 | collision_group: "" 877 | } 878 | convex_hulls { 879 | index: 24 880 | count: 0 881 | collision_group: "" 882 | } 883 | convex_hulls { 884 | index: 24 885 | count: 0 886 | collision_group: "" 887 | } 888 | convex_hulls { 889 | index: 24 890 | count: 0 891 | collision_group: "" 892 | } 893 | convex_hulls { 894 | index: 24 895 | count: 0 896 | collision_group: "" 897 | } 898 | convex_hulls { 899 | index: 24 900 | count: 0 901 | collision_group: "" 902 | } 903 | convex_hulls { 904 | index: 24 905 | count: 0 906 | collision_group: "" 907 | } 908 | convex_hulls { 909 | index: 24 910 | count: 0 911 | collision_group: "" 912 | } 913 | convex_hulls { 914 | index: 24 915 | count: 0 916 | collision_group: "" 917 | } 918 | convex_hulls { 919 | index: 24 920 | count: 4 921 | collision_group: "" 922 | } 923 | convex_hulls { 924 | index: 28 925 | count: 4 926 | collision_group: "" 927 | } 928 | convex_hulls { 929 | index: 32 930 | count: 4 931 | collision_group: "" 932 | } 933 | convex_hulls { 934 | index: 36 935 | count: 4 936 | collision_group: "" 937 | } 938 | convex_hulls { 939 | index: 40 940 | count: 0 941 | collision_group: "" 942 | } 943 | convex_hulls { 944 | index: 40 945 | count: 0 946 | collision_group: "" 947 | } 948 | convex_hulls { 949 | index: 40 950 | count: 0 951 | collision_group: "" 952 | } 953 | convex_hulls { 954 | index: 40 955 | count: 0 956 | collision_group: "" 957 | } 958 | convex_hulls { 959 | index: 40 960 | count: 0 961 | collision_group: "" 962 | } 963 | convex_hulls { 964 | index: 40 965 | count: 0 966 | collision_group: "" 967 | } 968 | convex_hulls { 969 | index: 40 970 | count: 0 971 | collision_group: "" 972 | } 973 | convex_hulls { 974 | index: 40 975 | count: 0 976 | collision_group: "" 977 | } 978 | convex_hulls { 979 | index: 40 980 | count: 0 981 | collision_group: "" 982 | } 983 | convex_hulls { 984 | index: 40 985 | count: 0 986 | collision_group: "" 987 | } 988 | collision_groups: "world" 989 | animations { 990 | id: "arrow" 991 | start_tile: 2 992 | end_tile: 2 993 | playback: PLAYBACK_NONE 994 | fps: 30 995 | flip_horizontal: 0 996 | flip_vertical: 0 997 | } 998 | animations { 999 | id: "dialog" 1000 | start_tile: 3 1001 | end_tile: 3 1002 | playback: PLAYBACK_NONE 1003 | fps: 30 1004 | flip_horizontal: 0 1005 | flip_vertical: 0 1006 | } 1007 | animations { 1008 | id: "player" 1009 | start_tile: 1 1010 | end_tile: 1 1011 | playback: PLAYBACK_NONE 1012 | fps: 30 1013 | flip_horizontal: 0 1014 | flip_vertical: 0 1015 | } 1016 | extrude_borders: 1 1017 | inner_padding: 0 1018 | sprite_trim_mode: SPRITE_TRIM_MODE_OFF 1019 | -------------------------------------------------------------------------------- /game/core/loader.script: -------------------------------------------------------------------------------- 1 | local data = require "main.data" 2 | 3 | local function unloadlevel(self) 4 | if self.loaded > 0 then 5 | msg.post (string.format("#level%d", self.loaded), "unload") 6 | end 7 | end 8 | 9 | local function loadlevel(self) 10 | msg.post (string.format("#level%d", data.level), "load") 11 | self.loaded = data.level 12 | end 13 | 14 | function init(self) 15 | self.loaded = 0 16 | self.reload = false 17 | msg.post(".", "acquire_input_focus") 18 | loadlevel(self) 19 | end 20 | 21 | function on_message(self, message_id, message,sender) 22 | if message_id == hash("new_level") then 23 | unloadlevel(self) 24 | loadlevel(self) 25 | elseif message_id == hash("proxy_loaded") then 26 | msg.post(sender, "enable") 27 | elseif message_id == hash("reload_level") then 28 | unloadlevel(self) 29 | self.reload = true 30 | elseif message_id == hash("proxy_unloaded") then 31 | if self.reload then 32 | self.reload = false 33 | loadlevel(self) 34 | end 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /game/gui/clear.gui: -------------------------------------------------------------------------------- 1 | script: "/game/gui/default.gui_script" 2 | fonts { 3 | name: "main" 4 | font: "/assets/font/main.font" 5 | } 6 | background_color { 7 | x: 0.0 8 | y: 0.0 9 | z: 0.0 10 | w: 0.0 11 | } 12 | nodes { 13 | position { 14 | x: 480.0 15 | y: 320.0 16 | z: 0.0 17 | w: 1.0 18 | } 19 | rotation { 20 | x: 0.0 21 | y: 0.0 22 | z: 0.0 23 | w: 1.0 24 | } 25 | scale { 26 | x: 1.0 27 | y: 1.0 28 | z: 1.0 29 | w: 1.0 30 | } 31 | size { 32 | x: 0.0 33 | y: 0.0 34 | z: 0.0 35 | w: 1.0 36 | } 37 | color { 38 | x: 1.0 39 | y: 1.0 40 | z: 1.0 41 | w: 1.0 42 | } 43 | type: TYPE_BOX 44 | blend_mode: BLEND_MODE_ALPHA 45 | texture: "" 46 | id: "container" 47 | xanchor: XANCHOR_NONE 48 | yanchor: YANCHOR_NONE 49 | pivot: PIVOT_CENTER 50 | adjust_mode: ADJUST_MODE_STRETCH 51 | layer: "" 52 | inherit_alpha: true 53 | slice9 { 54 | x: 0.0 55 | y: 0.0 56 | z: 0.0 57 | w: 0.0 58 | } 59 | clipping_mode: CLIPPING_MODE_NONE 60 | clipping_visible: true 61 | clipping_inverted: false 62 | alpha: 1.0 63 | template_node_child: false 64 | size_mode: SIZE_MODE_MANUAL 65 | custom_type: 0 66 | enabled: true 67 | visible: true 68 | } 69 | nodes { 70 | position { 71 | x: 0.0 72 | y: 0.0 73 | z: 0.0 74 | w: 1.0 75 | } 76 | rotation { 77 | x: 0.0 78 | y: 0.0 79 | z: 0.0 80 | w: 1.0 81 | } 82 | scale { 83 | x: 1.0 84 | y: 1.0 85 | z: 1.0 86 | w: 1.0 87 | } 88 | size { 89 | x: 300.0 90 | y: 50.0 91 | z: 0.0 92 | w: 1.0 93 | } 94 | color { 95 | x: 1.0 96 | y: 1.0 97 | z: 1.0 98 | w: 1.0 99 | } 100 | type: TYPE_TEXT 101 | blend_mode: BLEND_MODE_ALPHA 102 | text: "LEVEL CLEAR!" 103 | font: "main" 104 | id: "title" 105 | xanchor: XANCHOR_NONE 106 | yanchor: YANCHOR_NONE 107 | pivot: PIVOT_CENTER 108 | outline { 109 | x: 1.0 110 | y: 1.0 111 | z: 1.0 112 | w: 1.0 113 | } 114 | shadow { 115 | x: 1.0 116 | y: 1.0 117 | z: 1.0 118 | w: 1.0 119 | } 120 | adjust_mode: ADJUST_MODE_STRETCH 121 | line_break: false 122 | parent: "container" 123 | layer: "" 124 | inherit_alpha: true 125 | alpha: 1.0 126 | outline_alpha: 0.0 127 | shadow_alpha: 0.0 128 | template_node_child: false 129 | text_leading: 1.0 130 | text_tracking: 0.0 131 | custom_type: 0 132 | enabled: true 133 | visible: true 134 | } 135 | material: "/builtins/materials/gui.material" 136 | adjust_reference: ADJUST_REFERENCE_PARENT 137 | max_nodes: 512 138 | -------------------------------------------------------------------------------- /game/gui/complete.gui: -------------------------------------------------------------------------------- 1 | script: "/game/gui/default.gui_script" 2 | fonts { 3 | name: "main" 4 | font: "/assets/font/main.font" 5 | } 6 | background_color { 7 | x: 0.0 8 | y: 0.0 9 | z: 0.0 10 | w: 0.0 11 | } 12 | nodes { 13 | position { 14 | x: 480.0 15 | y: 320.0 16 | z: 0.0 17 | w: 1.0 18 | } 19 | rotation { 20 | x: 0.0 21 | y: 0.0 22 | z: 0.0 23 | w: 1.0 24 | } 25 | scale { 26 | x: 1.0 27 | y: 1.0 28 | z: 1.0 29 | w: 1.0 30 | } 31 | size { 32 | x: 0.0 33 | y: 0.0 34 | z: 0.0 35 | w: 1.0 36 | } 37 | color { 38 | x: 1.0 39 | y: 1.0 40 | z: 1.0 41 | w: 1.0 42 | } 43 | type: TYPE_BOX 44 | blend_mode: BLEND_MODE_ALPHA 45 | texture: "" 46 | id: "container" 47 | xanchor: XANCHOR_NONE 48 | yanchor: YANCHOR_NONE 49 | pivot: PIVOT_CENTER 50 | adjust_mode: ADJUST_MODE_STRETCH 51 | layer: "" 52 | inherit_alpha: true 53 | slice9 { 54 | x: 0.0 55 | y: 0.0 56 | z: 0.0 57 | w: 0.0 58 | } 59 | clipping_mode: CLIPPING_MODE_NONE 60 | clipping_visible: true 61 | clipping_inverted: false 62 | alpha: 1.0 63 | template_node_child: false 64 | size_mode: SIZE_MODE_MANUAL 65 | custom_type: 0 66 | enabled: true 67 | visible: true 68 | } 69 | nodes { 70 | position { 71 | x: 0.0 72 | y: 0.0 73 | z: 0.0 74 | w: 1.0 75 | } 76 | rotation { 77 | x: 0.0 78 | y: 0.0 79 | z: 0.0 80 | w: 1.0 81 | } 82 | scale { 83 | x: 1.0 84 | y: 1.0 85 | z: 1.0 86 | w: 1.0 87 | } 88 | size { 89 | x: 350.0 90 | y: 50.0 91 | z: 0.0 92 | w: 1.0 93 | } 94 | color { 95 | x: 1.0 96 | y: 1.0 97 | z: 1.0 98 | w: 1.0 99 | } 100 | type: TYPE_TEXT 101 | blend_mode: BLEND_MODE_ALPHA 102 | text: "GAME COMPLETE" 103 | font: "main" 104 | id: "title" 105 | xanchor: XANCHOR_NONE 106 | yanchor: YANCHOR_NONE 107 | pivot: PIVOT_CENTER 108 | outline { 109 | x: 1.0 110 | y: 1.0 111 | z: 1.0 112 | w: 1.0 113 | } 114 | shadow { 115 | x: 1.0 116 | y: 1.0 117 | z: 1.0 118 | w: 1.0 119 | } 120 | adjust_mode: ADJUST_MODE_STRETCH 121 | line_break: false 122 | parent: "container" 123 | layer: "" 124 | inherit_alpha: true 125 | alpha: 1.0 126 | outline_alpha: 0.0 127 | shadow_alpha: 0.0 128 | template_node_child: false 129 | text_leading: 1.0 130 | text_tracking: 0.0 131 | custom_type: 0 132 | enabled: true 133 | visible: true 134 | } 135 | material: "/builtins/materials/gui.material" 136 | adjust_reference: ADJUST_REFERENCE_PARENT 137 | max_nodes: 512 138 | -------------------------------------------------------------------------------- /game/gui/default.gui_script: -------------------------------------------------------------------------------- 1 | local data = require "main.data" 2 | local ui = require "main.ui" 3 | 4 | function init(self) 5 | self.node = gui.get_node("container") 6 | ui.init(self.node) 7 | end 8 | 9 | function on_message(self, message_id, message, sender) 10 | if message_id == hash("show") then 11 | ui.show(self.node) 12 | data.state = message.state 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /game/gui/game.gui: -------------------------------------------------------------------------------- 1 | script: "/game/gui/game.gui_script" 2 | fonts { 3 | name: "main" 4 | font: "/assets/font/main.font" 5 | } 6 | background_color { 7 | x: 0.0 8 | y: 0.0 9 | z: 0.0 10 | w: 1.0 11 | } 12 | material: "/builtins/materials/gui.material" 13 | adjust_reference: ADJUST_REFERENCE_PARENT 14 | max_nodes: 512 15 | -------------------------------------------------------------------------------- /game/gui/game.gui_script: -------------------------------------------------------------------------------- 1 | local data = require "main.data" 2 | 3 | function update(self, dt) 4 | end 5 | 6 | function on_message(self, message_id, message, sender) 7 | end 8 | 9 | -------------------------------------------------------------------------------- /game/gui/gameover.gui: -------------------------------------------------------------------------------- 1 | script: "/game/gui/default.gui_script" 2 | fonts { 3 | name: "main" 4 | font: "/assets/font/main.font" 5 | } 6 | background_color { 7 | x: 0.0 8 | y: 0.0 9 | z: 0.0 10 | w: 0.0 11 | } 12 | nodes { 13 | position { 14 | x: 480.0 15 | y: 320.0 16 | z: 0.0 17 | w: 1.0 18 | } 19 | rotation { 20 | x: 0.0 21 | y: 0.0 22 | z: 0.0 23 | w: 1.0 24 | } 25 | scale { 26 | x: 1.0 27 | y: 1.0 28 | z: 1.0 29 | w: 1.0 30 | } 31 | size { 32 | x: 0.0 33 | y: 0.0 34 | z: 0.0 35 | w: 1.0 36 | } 37 | color { 38 | x: 1.0 39 | y: 1.0 40 | z: 1.0 41 | w: 1.0 42 | } 43 | type: TYPE_BOX 44 | blend_mode: BLEND_MODE_ALPHA 45 | texture: "" 46 | id: "container" 47 | xanchor: XANCHOR_NONE 48 | yanchor: YANCHOR_NONE 49 | pivot: PIVOT_CENTER 50 | adjust_mode: ADJUST_MODE_STRETCH 51 | layer: "" 52 | inherit_alpha: true 53 | slice9 { 54 | x: 0.0 55 | y: 0.0 56 | z: 0.0 57 | w: 0.0 58 | } 59 | clipping_mode: CLIPPING_MODE_NONE 60 | clipping_visible: true 61 | clipping_inverted: false 62 | alpha: 1.0 63 | template_node_child: false 64 | size_mode: SIZE_MODE_MANUAL 65 | custom_type: 0 66 | enabled: true 67 | visible: true 68 | } 69 | nodes { 70 | position { 71 | x: 0.0 72 | y: 0.0 73 | z: 0.0 74 | w: 1.0 75 | } 76 | rotation { 77 | x: 0.0 78 | y: 0.0 79 | z: 0.0 80 | w: 1.0 81 | } 82 | scale { 83 | x: 1.0 84 | y: 1.0 85 | z: 1.0 86 | w: 1.0 87 | } 88 | size { 89 | x: 240.0 90 | y: 50.0 91 | z: 0.0 92 | w: 1.0 93 | } 94 | color { 95 | x: 1.0 96 | y: 1.0 97 | z: 1.0 98 | w: 1.0 99 | } 100 | type: TYPE_TEXT 101 | blend_mode: BLEND_MODE_ALPHA 102 | text: "GAME OVER" 103 | font: "main" 104 | id: "text" 105 | xanchor: XANCHOR_NONE 106 | yanchor: YANCHOR_NONE 107 | pivot: PIVOT_CENTER 108 | outline { 109 | x: 1.0 110 | y: 1.0 111 | z: 1.0 112 | w: 1.0 113 | } 114 | shadow { 115 | x: 1.0 116 | y: 1.0 117 | z: 1.0 118 | w: 1.0 119 | } 120 | adjust_mode: ADJUST_MODE_STRETCH 121 | line_break: false 122 | parent: "container" 123 | layer: "" 124 | inherit_alpha: true 125 | alpha: 1.0 126 | outline_alpha: 0.0 127 | shadow_alpha: 0.0 128 | template_node_child: false 129 | text_leading: 1.0 130 | text_tracking: 0.0 131 | custom_type: 0 132 | enabled: true 133 | visible: true 134 | } 135 | material: "/builtins/materials/gui.material" 136 | adjust_reference: ADJUST_REFERENCE_PARENT 137 | max_nodes: 512 138 | -------------------------------------------------------------------------------- /game/gui/pause.gui: -------------------------------------------------------------------------------- 1 | script: "/game/gui/pause.gui_script" 2 | fonts { 3 | name: "main" 4 | font: "/assets/font/main.font" 5 | } 6 | textures { 7 | name: "game" 8 | texture: "/game/core/game.tilesource" 9 | } 10 | background_color { 11 | x: 0.0 12 | y: 0.0 13 | z: 0.0 14 | w: 0.0 15 | } 16 | nodes { 17 | position { 18 | x: 480.0 19 | y: 320.0 20 | z: 0.0 21 | w: 1.0 22 | } 23 | rotation { 24 | x: 0.0 25 | y: 0.0 26 | z: 0.0 27 | w: 1.0 28 | } 29 | scale { 30 | x: 1.0 31 | y: 1.0 32 | z: 1.0 33 | w: 1.0 34 | } 35 | size { 36 | x: 0.0 37 | y: 0.0 38 | z: 0.0 39 | w: 1.0 40 | } 41 | color { 42 | x: 1.0 43 | y: 1.0 44 | z: 1.0 45 | w: 1.0 46 | } 47 | type: TYPE_BOX 48 | blend_mode: BLEND_MODE_ALPHA 49 | texture: "" 50 | id: "container" 51 | xanchor: XANCHOR_NONE 52 | yanchor: YANCHOR_NONE 53 | pivot: PIVOT_CENTER 54 | adjust_mode: ADJUST_MODE_STRETCH 55 | layer: "" 56 | inherit_alpha: true 57 | slice9 { 58 | x: 0.0 59 | y: 0.0 60 | z: 0.0 61 | w: 0.0 62 | } 63 | clipping_mode: CLIPPING_MODE_NONE 64 | clipping_visible: true 65 | clipping_inverted: false 66 | alpha: 1.0 67 | template_node_child: false 68 | size_mode: SIZE_MODE_MANUAL 69 | custom_type: 0 70 | enabled: true 71 | visible: true 72 | } 73 | nodes { 74 | position { 75 | x: 0.0 76 | y: 0.0 77 | z: 0.0 78 | w: 1.0 79 | } 80 | rotation { 81 | x: 0.0 82 | y: 0.0 83 | z: 0.0 84 | w: 1.0 85 | } 86 | scale { 87 | x: 4.0 88 | y: 4.0 89 | z: 1.0 90 | w: 1.0 91 | } 92 | size { 93 | x: 80.0 94 | y: 48.0 95 | z: 0.0 96 | w: 1.0 97 | } 98 | color { 99 | x: 1.0 100 | y: 1.0 101 | z: 1.0 102 | w: 1.0 103 | } 104 | type: TYPE_BOX 105 | blend_mode: BLEND_MODE_ALPHA 106 | texture: "game/dialog" 107 | id: "bg" 108 | xanchor: XANCHOR_NONE 109 | yanchor: YANCHOR_NONE 110 | pivot: PIVOT_CENTER 111 | adjust_mode: ADJUST_MODE_FIT 112 | parent: "container" 113 | layer: "" 114 | inherit_alpha: true 115 | slice9 { 116 | x: 4.0 117 | y: 4.0 118 | z: 4.0 119 | w: 4.0 120 | } 121 | clipping_mode: CLIPPING_MODE_NONE 122 | clipping_visible: true 123 | clipping_inverted: false 124 | alpha: 1.0 125 | template_node_child: false 126 | size_mode: SIZE_MODE_MANUAL 127 | custom_type: 0 128 | enabled: true 129 | visible: true 130 | } 131 | nodes { 132 | position { 133 | x: 0.0 134 | y: 49.0 135 | z: 0.0 136 | w: 1.0 137 | } 138 | rotation { 139 | x: 0.0 140 | y: 0.0 141 | z: 0.0 142 | w: 1.0 143 | } 144 | scale { 145 | x: 1.0 146 | y: 1.0 147 | z: 1.0 148 | w: 1.0 149 | } 150 | size { 151 | x: 200.0 152 | y: 32.0 153 | z: 0.0 154 | w: 1.0 155 | } 156 | color { 157 | x: 0.827451 158 | y: 0.15294118 159 | z: 0.20392157 160 | w: 1.0 161 | } 162 | type: TYPE_TEXT 163 | blend_mode: BLEND_MODE_ALPHA 164 | text: "PAUSED" 165 | font: "main" 166 | id: "title" 167 | xanchor: XANCHOR_NONE 168 | yanchor: YANCHOR_NONE 169 | pivot: PIVOT_CENTER 170 | outline { 171 | x: 1.0 172 | y: 1.0 173 | z: 1.0 174 | w: 1.0 175 | } 176 | shadow { 177 | x: 1.0 178 | y: 1.0 179 | z: 1.0 180 | w: 1.0 181 | } 182 | adjust_mode: ADJUST_MODE_STRETCH 183 | line_break: false 184 | parent: "container" 185 | layer: "" 186 | inherit_alpha: true 187 | alpha: 1.0 188 | outline_alpha: 0.0 189 | shadow_alpha: 0.0 190 | template_node_child: false 191 | text_leading: 1.0 192 | text_tracking: 0.0 193 | custom_type: 0 194 | enabled: true 195 | visible: true 196 | } 197 | nodes { 198 | position { 199 | x: -70.0 200 | y: -15.0 201 | z: 0.0 202 | w: 1.0 203 | } 204 | rotation { 205 | x: 0.0 206 | y: 0.0 207 | z: 0.0 208 | w: 1.0 209 | } 210 | scale { 211 | x: 1.0 212 | y: 1.0 213 | z: 1.0 214 | w: 1.0 215 | } 216 | size { 217 | x: 200.0 218 | y: 32.0 219 | z: 0.0 220 | w: 1.0 221 | } 222 | color { 223 | x: 1.0 224 | y: 1.0 225 | z: 1.0 226 | w: 1.0 227 | } 228 | type: TYPE_TEXT 229 | blend_mode: BLEND_MODE_ALPHA 230 | text: "CONTINUE" 231 | font: "main" 232 | id: "1" 233 | xanchor: XANCHOR_NONE 234 | yanchor: YANCHOR_NONE 235 | pivot: PIVOT_W 236 | outline { 237 | x: 1.0 238 | y: 1.0 239 | z: 1.0 240 | w: 1.0 241 | } 242 | shadow { 243 | x: 1.0 244 | y: 1.0 245 | z: 1.0 246 | w: 1.0 247 | } 248 | adjust_mode: ADJUST_MODE_STRETCH 249 | line_break: false 250 | parent: "container" 251 | layer: "" 252 | inherit_alpha: true 253 | alpha: 1.0 254 | outline_alpha: 0.0 255 | shadow_alpha: 0.0 256 | template_node_child: false 257 | text_leading: 1.0 258 | text_tracking: 0.0 259 | custom_type: 0 260 | enabled: true 261 | visible: true 262 | } 263 | nodes { 264 | position { 265 | x: -70.0 266 | y: -53.0 267 | z: 0.0 268 | w: 1.0 269 | } 270 | rotation { 271 | x: 0.0 272 | y: 0.0 273 | z: 0.0 274 | w: 1.0 275 | } 276 | scale { 277 | x: 1.0 278 | y: 1.0 279 | z: 1.0 280 | w: 1.0 281 | } 282 | size { 283 | x: 200.0 284 | y: 32.0 285 | z: 0.0 286 | w: 1.0 287 | } 288 | color { 289 | x: 1.0 290 | y: 1.0 291 | z: 1.0 292 | w: 1.0 293 | } 294 | type: TYPE_TEXT 295 | blend_mode: BLEND_MODE_ALPHA 296 | text: "QUIT" 297 | font: "main" 298 | id: "2" 299 | xanchor: XANCHOR_NONE 300 | yanchor: YANCHOR_NONE 301 | pivot: PIVOT_W 302 | outline { 303 | x: 1.0 304 | y: 1.0 305 | z: 1.0 306 | w: 1.0 307 | } 308 | shadow { 309 | x: 1.0 310 | y: 1.0 311 | z: 1.0 312 | w: 1.0 313 | } 314 | adjust_mode: ADJUST_MODE_STRETCH 315 | line_break: false 316 | parent: "container" 317 | layer: "" 318 | inherit_alpha: true 319 | alpha: 1.0 320 | outline_alpha: 0.0 321 | shadow_alpha: 0.0 322 | template_node_child: false 323 | text_leading: 1.0 324 | text_tracking: 0.0 325 | custom_type: 0 326 | enabled: true 327 | visible: true 328 | } 329 | nodes { 330 | position { 331 | x: -91.0 332 | y: -14.0 333 | z: 0.0 334 | w: 1.0 335 | } 336 | rotation { 337 | x: 0.0 338 | y: 0.0 339 | z: 0.0 340 | w: 1.0 341 | } 342 | scale { 343 | x: 4.0 344 | y: 4.0 345 | z: 1.0 346 | w: 1.0 347 | } 348 | size { 349 | x: 16.0 350 | y: 16.0 351 | z: 0.0 352 | w: 1.0 353 | } 354 | color { 355 | x: 1.0 356 | y: 1.0 357 | z: 1.0 358 | w: 1.0 359 | } 360 | type: TYPE_BOX 361 | blend_mode: BLEND_MODE_ALPHA 362 | texture: "game/arrow" 363 | id: "arrow" 364 | xanchor: XANCHOR_NONE 365 | yanchor: YANCHOR_NONE 366 | pivot: PIVOT_CENTER 367 | adjust_mode: ADJUST_MODE_STRETCH 368 | parent: "container" 369 | layer: "" 370 | inherit_alpha: true 371 | slice9 { 372 | x: 0.0 373 | y: 0.0 374 | z: 0.0 375 | w: 0.0 376 | } 377 | clipping_mode: CLIPPING_MODE_NONE 378 | clipping_visible: true 379 | clipping_inverted: false 380 | alpha: 1.0 381 | template_node_child: false 382 | size_mode: SIZE_MODE_AUTO 383 | custom_type: 0 384 | enabled: true 385 | visible: true 386 | } 387 | material: "/builtins/materials/gui.material" 388 | adjust_reference: ADJUST_REFERENCE_PARENT 389 | max_nodes: 512 390 | -------------------------------------------------------------------------------- /game/gui/pause.gui_script: -------------------------------------------------------------------------------- 1 | local data = require "main.data" 2 | 3 | local MENU_LEN = 2 4 | 5 | function init(self) 6 | self.handpos = 1 7 | self.arrowpos = {} 8 | for n = 1, MENU_LEN do 9 | self.arrowpos[n] = gui.get_position(gui.get_node(tostring(n))) 10 | end 11 | self.node = gui.get_node("container") 12 | gui.set_enabled(self.node, false) 13 | gui.set_position(self.node, vmath.vector3(data.SCR_W/2, (data.SCR_H/2), 0)) 14 | end 15 | 16 | function update(self, dt) 17 | if data.state == data.STATE_PAUSE then 18 | local pos = vmath.vector3(self.arrowpos[self.handpos].x - 32, self.arrowpos[self.handpos].y, 0) 19 | gui.set_position(gui.get_node("arrow"), pos) 20 | end 21 | end 22 | 23 | local function close(self) 24 | gui.set_enabled(self.node, false) 25 | data.state = data.STATE_PLAYING 26 | msg.post("main:/handler", "set_time_step", {factor = 1, mode = 0}) 27 | end 28 | 29 | local function input(self, action_id, action) 30 | if action_id == hash("up") and action.pressed then 31 | self.handpos = self.handpos - 1 32 | if self.handpos < 1 then 33 | self.handpos = MENU_LEN 34 | end 35 | data.sound("beep") 36 | elseif action_id == hash("down") and action.pressed then 37 | self.handpos = self.handpos + 1 38 | if self.handpos > MENU_LEN then 39 | self.handpos = 1 40 | end 41 | data.sound("beep") 42 | elseif action_id == hash("action") and action.pressed then 43 | if self.handpos == 1 then 44 | close(self) 45 | elseif self.handpos == 2 then 46 | msg.post("main:/handler", "set_time_step", {factor = 1, mode = 0}) 47 | msg.post("/common/player", "quit") 48 | end 49 | elseif action_id == hash("exit") and action.pressed then 50 | close(self) 51 | end 52 | end 53 | 54 | function on_message(self, message_id, message, sender) 55 | if message_id == hash("show") then 56 | gui.set_enabled(self.node, true) 57 | data.state = data.STATE_PAUSE 58 | msg.post("main:/handler", "set_time_step", {factor = 0, mode = 0}) 59 | elseif message_id == hash("input") then 60 | input(self, message.action_id, message.action) 61 | end 62 | end 63 | -------------------------------------------------------------------------------- /game/gui/shutter.gui: -------------------------------------------------------------------------------- 1 | script: "/game/gui/shutter.gui_script" 2 | background_color { 3 | x: 0.0 4 | y: 0.0 5 | z: 0.0 6 | w: 0.0 7 | } 8 | nodes { 9 | position { 10 | x: 0.0 11 | y: 0.0 12 | z: 0.0 13 | w: 1.0 14 | } 15 | rotation { 16 | x: 0.0 17 | y: 0.0 18 | z: 0.0 19 | w: 1.0 20 | } 21 | scale { 22 | x: 1.0 23 | y: 1.0 24 | z: 1.0 25 | w: 1.0 26 | } 27 | size { 28 | x: 0.0 29 | y: 0.0 30 | z: 0.0 31 | w: 1.0 32 | } 33 | color { 34 | x: 1.0 35 | y: 1.0 36 | z: 1.0 37 | w: 1.0 38 | } 39 | type: TYPE_BOX 40 | blend_mode: BLEND_MODE_ALPHA 41 | texture: "" 42 | id: "container" 43 | xanchor: XANCHOR_NONE 44 | yanchor: YANCHOR_NONE 45 | pivot: PIVOT_CENTER 46 | adjust_mode: ADJUST_MODE_STRETCH 47 | layer: "" 48 | inherit_alpha: true 49 | slice9 { 50 | x: 0.0 51 | y: 0.0 52 | z: 0.0 53 | w: 0.0 54 | } 55 | clipping_mode: CLIPPING_MODE_NONE 56 | clipping_visible: true 57 | clipping_inverted: false 58 | alpha: 1.0 59 | template_node_child: false 60 | size_mode: SIZE_MODE_MANUAL 61 | custom_type: 0 62 | enabled: true 63 | visible: true 64 | } 65 | nodes { 66 | position { 67 | x: 0.0 68 | y: 0.0 69 | z: 0.0 70 | w: 1.0 71 | } 72 | rotation { 73 | x: 0.0 74 | y: 0.0 75 | z: 0.0 76 | w: 1.0 77 | } 78 | scale { 79 | x: 1.0 80 | y: 1.0 81 | z: 1.0 82 | w: 1.0 83 | } 84 | size { 85 | x: 960.0 86 | y: 640.0 87 | z: 0.0 88 | w: 1.0 89 | } 90 | color { 91 | x: 0.105882354 92 | y: 0.10980392 93 | z: 0.2 94 | w: 1.0 95 | } 96 | type: TYPE_BOX 97 | blend_mode: BLEND_MODE_ALPHA 98 | texture: "" 99 | id: "shutter" 100 | xanchor: XANCHOR_NONE 101 | yanchor: YANCHOR_NONE 102 | pivot: PIVOT_SW 103 | adjust_mode: ADJUST_MODE_STRETCH 104 | parent: "container" 105 | layer: "" 106 | inherit_alpha: true 107 | slice9 { 108 | x: 0.0 109 | y: 0.0 110 | z: 0.0 111 | w: 0.0 112 | } 113 | clipping_mode: CLIPPING_MODE_NONE 114 | clipping_visible: true 115 | clipping_inverted: false 116 | alpha: 1.0 117 | template_node_child: false 118 | size_mode: SIZE_MODE_MANUAL 119 | custom_type: 0 120 | enabled: true 121 | visible: true 122 | } 123 | material: "/builtins/materials/gui.material" 124 | adjust_reference: ADJUST_REFERENCE_PARENT 125 | max_nodes: 512 126 | -------------------------------------------------------------------------------- /game/gui/shutter.gui_script: -------------------------------------------------------------------------------- 1 | local function disablenode (self, node) 2 | gui.set_enabled(node, false) 3 | end 4 | 5 | local function fadeout(self) 6 | gui.animate(gui.get_node("container"), gui.PROP_COLOR, vmath.vector4(1, 1, 1, 0), gui.EASING_LINEAR, 0.2, 0.1, disablenode) 7 | end 8 | 9 | function init(self) 10 | fadeout(self) 11 | end 12 | 13 | function on_message(self, message_id, message, sender) 14 | if message_id == hash("fadein") then 15 | local node = gui.get_node("container") 16 | gui.set_enabled(node, true) 17 | gui.set_color(node, vmath.vector4(1)) 18 | fadeout(self) 19 | end 20 | end -------------------------------------------------------------------------------- /game/levels/level.script: -------------------------------------------------------------------------------- 1 | local data = require "main.data" 2 | 3 | local function parse(self) 4 | sx, sy, w, h = tilemap.get_bounds("#tilemap") 5 | 6 | data.bounds = vmath.vector4( 7 | (sx - 1) * data.TILE_SIZE, 8 | (sy - 1) * data.TILE_SIZE, 9 | ((sx + w - 1) * data.TILE_SIZE) - data.CANV_W, 10 | ((sy + h - 1) * data.TILE_SIZE) - data.CANV_H) 11 | 12 | for y = sy, h+sy-1 do 13 | for x = sx, w+sx-1 do 14 | local t = tilemap.get_tile("#tilemap", "world", x, y) 15 | if t == 1 then 16 | tilemap.set_tile("#tilemap", "world", x, y, 0) 17 | msg.post("common/player", "pos", {pos = data.tile2world(vmath.vector3(x, y, 0.5))}) 18 | end 19 | end 20 | end 21 | end 22 | 23 | function init(self) 24 | parse(self) 25 | end 26 | -------------------------------------------------------------------------------- /game/levels/level1.collection: -------------------------------------------------------------------------------- 1 | name: "level1" 2 | collection_instances { 3 | id: "common" 4 | collection: "/game/core/common.collection" 5 | position { 6 | x: 0.0 7 | y: 0.0 8 | z: 0.0 9 | } 10 | rotation { 11 | x: 0.0 12 | y: 0.0 13 | z: 0.0 14 | w: 1.0 15 | } 16 | scale3 { 17 | x: 1.0 18 | y: 1.0 19 | z: 1.0 20 | } 21 | } 22 | scale_along_z: 0 23 | embedded_instances { 24 | id: "level" 25 | data: "components {\n" 26 | " id: \"tilemap\"\n" 27 | " component: \"/game/levels/level1.tilemap\"\n" 28 | " position {\n" 29 | " x: 0.0\n" 30 | " y: 0.0\n" 31 | " z: 0.0\n" 32 | " }\n" 33 | " rotation {\n" 34 | " x: 0.0\n" 35 | " y: 0.0\n" 36 | " z: 0.0\n" 37 | " w: 1.0\n" 38 | " }\n" 39 | "}\n" 40 | "components {\n" 41 | " id: \"level\"\n" 42 | " component: \"/game/levels/level.script\"\n" 43 | " position {\n" 44 | " x: 0.0\n" 45 | " y: 0.0\n" 46 | " z: 0.0\n" 47 | " }\n" 48 | " rotation {\n" 49 | " x: 0.0\n" 50 | " y: 0.0\n" 51 | " z: 0.0\n" 52 | " w: 1.0\n" 53 | " }\n" 54 | "}\n" 55 | "embedded_components {\n" 56 | " id: \"co\"\n" 57 | " type: \"collisionobject\"\n" 58 | " data: \"collision_shape: \\\"/game/levels/level1.tilemap\\\"\\n" 59 | "type: COLLISION_OBJECT_TYPE_KINEMATIC\\n" 60 | "mass: 0.0\\n" 61 | "friction: 0.1\\n" 62 | "restitution: 0.5\\n" 63 | "group: \\\"world\\\"\\n" 64 | "mask: \\\"player\\\"\\n" 65 | "linear_damping: 0.0\\n" 66 | "angular_damping: 0.0\\n" 67 | "locked_rotation: false\\n" 68 | "bullet: false\\n" 69 | "\"\n" 70 | " position {\n" 71 | " x: 0.0\n" 72 | " y: 0.0\n" 73 | " z: 0.0\n" 74 | " }\n" 75 | " rotation {\n" 76 | " x: 0.0\n" 77 | " y: 0.0\n" 78 | " z: 0.0\n" 79 | " w: 1.0\n" 80 | " }\n" 81 | "}\n" 82 | "" 83 | position { 84 | x: 0.0 85 | y: 0.0 86 | z: 0.0 87 | } 88 | rotation { 89 | x: 0.0 90 | y: 0.0 91 | z: 0.0 92 | w: 1.0 93 | } 94 | scale3 { 95 | x: 1.0 96 | y: 1.0 97 | z: 1.0 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /game/levels/level1.tilemap: -------------------------------------------------------------------------------- 1 | tile_set: "/game/core/game.tilesource" 2 | layers { 3 | id: "world" 4 | z: 0.0 5 | is_visible: 1 6 | cell { 7 | x: 0 8 | y: 0 9 | tile: 28 10 | h_flip: 0 11 | v_flip: 0 12 | rotate90: 0 13 | } 14 | cell { 15 | x: 1 16 | y: 0 17 | tile: 28 18 | h_flip: 0 19 | v_flip: 0 20 | rotate90: 0 21 | } 22 | cell { 23 | x: 2 24 | y: 0 25 | tile: 28 26 | h_flip: 0 27 | v_flip: 0 28 | rotate90: 0 29 | } 30 | cell { 31 | x: 3 32 | y: 0 33 | tile: 28 34 | h_flip: 0 35 | v_flip: 0 36 | rotate90: 0 37 | } 38 | cell { 39 | x: 4 40 | y: 0 41 | tile: 28 42 | h_flip: 0 43 | v_flip: 0 44 | rotate90: 0 45 | } 46 | cell { 47 | x: 5 48 | y: 0 49 | tile: 28 50 | h_flip: 0 51 | v_flip: 0 52 | rotate90: 0 53 | } 54 | cell { 55 | x: 6 56 | y: 0 57 | tile: 28 58 | h_flip: 0 59 | v_flip: 0 60 | rotate90: 0 61 | } 62 | cell { 63 | x: 7 64 | y: 0 65 | tile: 28 66 | h_flip: 0 67 | v_flip: 0 68 | rotate90: 0 69 | } 70 | cell { 71 | x: 8 72 | y: 0 73 | tile: 28 74 | h_flip: 0 75 | v_flip: 0 76 | rotate90: 0 77 | } 78 | cell { 79 | x: 9 80 | y: 0 81 | tile: 28 82 | h_flip: 0 83 | v_flip: 0 84 | rotate90: 0 85 | } 86 | cell { 87 | x: 10 88 | y: 0 89 | tile: 28 90 | h_flip: 0 91 | v_flip: 0 92 | rotate90: 0 93 | } 94 | cell { 95 | x: 11 96 | y: 0 97 | tile: 28 98 | h_flip: 0 99 | v_flip: 0 100 | rotate90: 0 101 | } 102 | cell { 103 | x: 12 104 | y: 0 105 | tile: 28 106 | h_flip: 0 107 | v_flip: 0 108 | rotate90: 0 109 | } 110 | cell { 111 | x: 13 112 | y: 0 113 | tile: 28 114 | h_flip: 0 115 | v_flip: 0 116 | rotate90: 0 117 | } 118 | cell { 119 | x: 14 120 | y: 0 121 | tile: 28 122 | h_flip: 0 123 | v_flip: 0 124 | rotate90: 0 125 | } 126 | cell { 127 | x: 15 128 | y: 0 129 | tile: 28 130 | h_flip: 0 131 | v_flip: 0 132 | rotate90: 0 133 | } 134 | cell { 135 | x: 16 136 | y: 0 137 | tile: 28 138 | h_flip: 0 139 | v_flip: 0 140 | rotate90: 0 141 | } 142 | cell { 143 | x: 17 144 | y: 0 145 | tile: 28 146 | h_flip: 0 147 | v_flip: 0 148 | rotate90: 0 149 | } 150 | cell { 151 | x: 18 152 | y: 0 153 | tile: 28 154 | h_flip: 0 155 | v_flip: 0 156 | rotate90: 0 157 | } 158 | cell { 159 | x: 19 160 | y: 0 161 | tile: 28 162 | h_flip: 0 163 | v_flip: 0 164 | rotate90: 0 165 | } 166 | cell { 167 | x: 20 168 | y: 0 169 | tile: 28 170 | h_flip: 0 171 | v_flip: 0 172 | rotate90: 0 173 | } 174 | cell { 175 | x: 0 176 | y: 1 177 | tile: 28 178 | h_flip: 0 179 | v_flip: 0 180 | rotate90: 0 181 | } 182 | cell { 183 | x: 1 184 | y: 1 185 | tile: 28 186 | h_flip: 0 187 | v_flip: 0 188 | rotate90: 0 189 | } 190 | cell { 191 | x: 2 192 | y: 1 193 | tile: 28 194 | h_flip: 0 195 | v_flip: 0 196 | rotate90: 0 197 | } 198 | cell { 199 | x: 4 200 | y: 1 201 | tile: 3 202 | h_flip: 0 203 | v_flip: 0 204 | rotate90: 0 205 | } 206 | cell { 207 | x: 5 208 | y: 1 209 | tile: 3 210 | h_flip: 0 211 | v_flip: 0 212 | rotate90: 0 213 | } 214 | cell { 215 | x: 6 216 | y: 1 217 | tile: 3 218 | h_flip: 0 219 | v_flip: 0 220 | rotate90: 0 221 | } 222 | cell { 223 | x: 14 224 | y: 1 225 | tile: 3 226 | h_flip: 0 227 | v_flip: 0 228 | rotate90: 0 229 | } 230 | cell { 231 | x: 15 232 | y: 1 233 | tile: 3 234 | h_flip: 0 235 | v_flip: 0 236 | rotate90: 0 237 | } 238 | cell { 239 | x: 16 240 | y: 1 241 | tile: 3 242 | h_flip: 0 243 | v_flip: 0 244 | rotate90: 0 245 | } 246 | cell { 247 | x: 18 248 | y: 1 249 | tile: 28 250 | h_flip: 0 251 | v_flip: 0 252 | rotate90: 0 253 | } 254 | cell { 255 | x: 19 256 | y: 1 257 | tile: 28 258 | h_flip: 0 259 | v_flip: 0 260 | rotate90: 0 261 | } 262 | cell { 263 | x: 20 264 | y: 1 265 | tile: 28 266 | h_flip: 0 267 | v_flip: 0 268 | rotate90: 0 269 | } 270 | cell { 271 | x: 0 272 | y: 2 273 | tile: 28 274 | h_flip: 0 275 | v_flip: 0 276 | rotate90: 0 277 | } 278 | cell { 279 | x: 1 280 | y: 2 281 | tile: 28 282 | h_flip: 0 283 | v_flip: 0 284 | rotate90: 0 285 | } 286 | cell { 287 | x: 2 288 | y: 2 289 | tile: 28 290 | h_flip: 0 291 | v_flip: 0 292 | rotate90: 0 293 | } 294 | cell { 295 | x: 18 296 | y: 2 297 | tile: 28 298 | h_flip: 0 299 | v_flip: 0 300 | rotate90: 0 301 | } 302 | cell { 303 | x: 19 304 | y: 2 305 | tile: 28 306 | h_flip: 0 307 | v_flip: 0 308 | rotate90: 0 309 | } 310 | cell { 311 | x: 20 312 | y: 2 313 | tile: 28 314 | h_flip: 0 315 | v_flip: 0 316 | rotate90: 0 317 | } 318 | cell { 319 | x: 0 320 | y: 3 321 | tile: 28 322 | h_flip: 0 323 | v_flip: 0 324 | rotate90: 0 325 | } 326 | cell { 327 | x: 20 328 | y: 3 329 | tile: 28 330 | h_flip: 0 331 | v_flip: 0 332 | rotate90: 0 333 | } 334 | cell { 335 | x: 0 336 | y: 4 337 | tile: 28 338 | h_flip: 0 339 | v_flip: 0 340 | rotate90: 0 341 | } 342 | cell { 343 | x: 4 344 | y: 4 345 | tile: 28 346 | h_flip: 0 347 | v_flip: 0 348 | rotate90: 0 349 | } 350 | cell { 351 | x: 5 352 | y: 4 353 | tile: 28 354 | h_flip: 0 355 | v_flip: 0 356 | rotate90: 0 357 | } 358 | cell { 359 | x: 6 360 | y: 4 361 | tile: 28 362 | h_flip: 0 363 | v_flip: 0 364 | rotate90: 0 365 | } 366 | cell { 367 | x: 7 368 | y: 4 369 | tile: 28 370 | h_flip: 0 371 | v_flip: 0 372 | rotate90: 0 373 | } 374 | cell { 375 | x: 8 376 | y: 4 377 | tile: 28 378 | h_flip: 0 379 | v_flip: 0 380 | rotate90: 0 381 | } 382 | cell { 383 | x: 9 384 | y: 4 385 | tile: 28 386 | h_flip: 0 387 | v_flip: 0 388 | rotate90: 0 389 | } 390 | cell { 391 | x: 10 392 | y: 4 393 | tile: 28 394 | h_flip: 0 395 | v_flip: 0 396 | rotate90: 0 397 | } 398 | cell { 399 | x: 11 400 | y: 4 401 | tile: 28 402 | h_flip: 0 403 | v_flip: 0 404 | rotate90: 0 405 | } 406 | cell { 407 | x: 20 408 | y: 4 409 | tile: 28 410 | h_flip: 0 411 | v_flip: 0 412 | rotate90: 0 413 | } 414 | cell { 415 | x: 0 416 | y: 5 417 | tile: 28 418 | h_flip: 0 419 | v_flip: 0 420 | rotate90: 0 421 | } 422 | cell { 423 | x: 6 424 | y: 5 425 | tile: 3 426 | h_flip: 0 427 | v_flip: 0 428 | rotate90: 0 429 | } 430 | cell { 431 | x: 7 432 | y: 5 433 | tile: 3 434 | h_flip: 0 435 | v_flip: 0 436 | rotate90: 0 437 | } 438 | cell { 439 | x: 8 440 | y: 5 441 | tile: 3 442 | h_flip: 0 443 | v_flip: 0 444 | rotate90: 0 445 | } 446 | cell { 447 | x: 10 448 | y: 5 449 | tile: 28 450 | h_flip: 0 451 | v_flip: 0 452 | rotate90: 0 453 | } 454 | cell { 455 | x: 11 456 | y: 5 457 | tile: 28 458 | h_flip: 0 459 | v_flip: 0 460 | rotate90: 0 461 | } 462 | cell { 463 | x: 20 464 | y: 5 465 | tile: 28 466 | h_flip: 0 467 | v_flip: 0 468 | rotate90: 0 469 | } 470 | cell { 471 | x: 0 472 | y: 6 473 | tile: 28 474 | h_flip: 0 475 | v_flip: 0 476 | rotate90: 0 477 | } 478 | cell { 479 | x: 10 480 | y: 6 481 | tile: 28 482 | h_flip: 0 483 | v_flip: 0 484 | rotate90: 0 485 | } 486 | cell { 487 | x: 11 488 | y: 6 489 | tile: 28 490 | h_flip: 0 491 | v_flip: 0 492 | rotate90: 0 493 | } 494 | cell { 495 | x: 14 496 | y: 6 497 | tile: 28 498 | h_flip: 0 499 | v_flip: 0 500 | rotate90: 0 501 | } 502 | cell { 503 | x: 15 504 | y: 6 505 | tile: 28 506 | h_flip: 0 507 | v_flip: 0 508 | rotate90: 0 509 | } 510 | cell { 511 | x: 16 512 | y: 6 513 | tile: 28 514 | h_flip: 0 515 | v_flip: 0 516 | rotate90: 0 517 | } 518 | cell { 519 | x: 17 520 | y: 6 521 | tile: 28 522 | h_flip: 0 523 | v_flip: 0 524 | rotate90: 0 525 | } 526 | cell { 527 | x: 18 528 | y: 6 529 | tile: 28 530 | h_flip: 0 531 | v_flip: 0 532 | rotate90: 0 533 | } 534 | cell { 535 | x: 19 536 | y: 6 537 | tile: 28 538 | h_flip: 0 539 | v_flip: 0 540 | rotate90: 0 541 | } 542 | cell { 543 | x: 20 544 | y: 6 545 | tile: 28 546 | h_flip: 0 547 | v_flip: 0 548 | rotate90: 0 549 | } 550 | cell { 551 | x: 0 552 | y: 7 553 | tile: 28 554 | h_flip: 0 555 | v_flip: 0 556 | rotate90: 0 557 | } 558 | cell { 559 | x: 15 560 | y: 7 561 | tile: 3 562 | h_flip: 0 563 | v_flip: 0 564 | rotate90: 0 565 | } 566 | cell { 567 | x: 16 568 | y: 7 569 | tile: 3 570 | h_flip: 0 571 | v_flip: 0 572 | rotate90: 0 573 | } 574 | cell { 575 | x: 18 576 | y: 7 577 | tile: 28 578 | h_flip: 0 579 | v_flip: 0 580 | rotate90: 0 581 | } 582 | cell { 583 | x: 19 584 | y: 7 585 | tile: 28 586 | h_flip: 0 587 | v_flip: 0 588 | rotate90: 0 589 | } 590 | cell { 591 | x: 20 592 | y: 7 593 | tile: 28 594 | h_flip: 0 595 | v_flip: 0 596 | rotate90: 0 597 | } 598 | cell { 599 | x: 0 600 | y: 8 601 | tile: 28 602 | h_flip: 0 603 | v_flip: 0 604 | rotate90: 0 605 | } 606 | cell { 607 | x: 1 608 | y: 8 609 | tile: 28 610 | h_flip: 0 611 | v_flip: 0 612 | rotate90: 0 613 | } 614 | cell { 615 | x: 2 616 | y: 8 617 | tile: 28 618 | h_flip: 0 619 | v_flip: 0 620 | rotate90: 0 621 | } 622 | cell { 623 | x: 3 624 | y: 8 625 | tile: 28 626 | h_flip: 0 627 | v_flip: 0 628 | rotate90: 0 629 | } 630 | cell { 631 | x: 4 632 | y: 8 633 | tile: 28 634 | h_flip: 0 635 | v_flip: 0 636 | rotate90: 0 637 | } 638 | cell { 639 | x: 5 640 | y: 8 641 | tile: 28 642 | h_flip: 0 643 | v_flip: 0 644 | rotate90: 0 645 | } 646 | cell { 647 | x: 6 648 | y: 8 649 | tile: 28 650 | h_flip: 0 651 | v_flip: 0 652 | rotate90: 0 653 | } 654 | cell { 655 | x: 7 656 | y: 8 657 | tile: 28 658 | h_flip: 0 659 | v_flip: 0 660 | rotate90: 0 661 | } 662 | cell { 663 | x: 18 664 | y: 8 665 | tile: 28 666 | h_flip: 0 667 | v_flip: 0 668 | rotate90: 0 669 | } 670 | cell { 671 | x: 19 672 | y: 8 673 | tile: 28 674 | h_flip: 0 675 | v_flip: 0 676 | rotate90: 0 677 | } 678 | cell { 679 | x: 20 680 | y: 8 681 | tile: 28 682 | h_flip: 0 683 | v_flip: 0 684 | rotate90: 0 685 | } 686 | cell { 687 | x: 0 688 | y: 9 689 | tile: 28 690 | h_flip: 0 691 | v_flip: 0 692 | rotate90: 0 693 | } 694 | cell { 695 | x: 1 696 | y: 9 697 | tile: 28 698 | h_flip: 0 699 | v_flip: 0 700 | rotate90: 0 701 | } 702 | cell { 703 | x: 2 704 | y: 9 705 | tile: 28 706 | h_flip: 0 707 | v_flip: 0 708 | rotate90: 0 709 | } 710 | cell { 711 | x: 4 712 | y: 9 713 | tile: 3 714 | h_flip: 0 715 | v_flip: 0 716 | rotate90: 0 717 | } 718 | cell { 719 | x: 5 720 | y: 9 721 | tile: 3 722 | h_flip: 0 723 | v_flip: 0 724 | rotate90: 0 725 | } 726 | cell { 727 | x: 6 728 | y: 9 729 | tile: 3 730 | h_flip: 0 731 | v_flip: 0 732 | rotate90: 0 733 | } 734 | cell { 735 | x: 20 736 | y: 9 737 | tile: 28 738 | h_flip: 0 739 | v_flip: 0 740 | rotate90: 0 741 | } 742 | cell { 743 | x: 0 744 | y: 10 745 | tile: 28 746 | h_flip: 0 747 | v_flip: 0 748 | rotate90: 0 749 | } 750 | cell { 751 | x: 1 752 | y: 10 753 | tile: 28 754 | h_flip: 0 755 | v_flip: 0 756 | rotate90: 0 757 | } 758 | cell { 759 | x: 2 760 | y: 10 761 | tile: 28 762 | h_flip: 0 763 | v_flip: 0 764 | rotate90: 0 765 | } 766 | cell { 767 | x: 9 768 | y: 10 769 | tile: 28 770 | h_flip: 0 771 | v_flip: 0 772 | rotate90: 0 773 | } 774 | cell { 775 | x: 10 776 | y: 10 777 | tile: 28 778 | h_flip: 0 779 | v_flip: 0 780 | rotate90: 0 781 | } 782 | cell { 783 | x: 11 784 | y: 10 785 | tile: 28 786 | h_flip: 0 787 | v_flip: 0 788 | rotate90: 0 789 | } 790 | cell { 791 | x: 12 792 | y: 10 793 | tile: 28 794 | h_flip: 0 795 | v_flip: 0 796 | rotate90: 0 797 | } 798 | cell { 799 | x: 13 800 | y: 10 801 | tile: 28 802 | h_flip: 0 803 | v_flip: 0 804 | rotate90: 0 805 | } 806 | cell { 807 | x: 14 808 | y: 10 809 | tile: 28 810 | h_flip: 0 811 | v_flip: 0 812 | rotate90: 0 813 | } 814 | cell { 815 | x: 15 816 | y: 10 817 | tile: 28 818 | h_flip: 0 819 | v_flip: 0 820 | rotate90: 0 821 | } 822 | cell { 823 | x: 20 824 | y: 10 825 | tile: 28 826 | h_flip: 0 827 | v_flip: 0 828 | rotate90: 0 829 | } 830 | cell { 831 | x: 0 832 | y: 11 833 | tile: 28 834 | h_flip: 0 835 | v_flip: 0 836 | rotate90: 0 837 | } 838 | cell { 839 | x: 9 840 | y: 11 841 | tile: 28 842 | h_flip: 0 843 | v_flip: 0 844 | rotate90: 0 845 | } 846 | cell { 847 | x: 10 848 | y: 11 849 | tile: 0 850 | h_flip: 0 851 | v_flip: 0 852 | rotate90: 0 853 | } 854 | cell { 855 | x: 12 856 | y: 11 857 | tile: 3 858 | h_flip: 0 859 | v_flip: 0 860 | rotate90: 0 861 | } 862 | cell { 863 | x: 13 864 | y: 11 865 | tile: 3 866 | h_flip: 0 867 | v_flip: 0 868 | rotate90: 0 869 | } 870 | cell { 871 | x: 14 872 | y: 11 873 | tile: 3 874 | h_flip: 0 875 | v_flip: 0 876 | rotate90: 0 877 | } 878 | cell { 879 | x: 20 880 | y: 11 881 | tile: 28 882 | h_flip: 0 883 | v_flip: 0 884 | rotate90: 0 885 | } 886 | cell { 887 | x: 0 888 | y: 12 889 | tile: 28 890 | h_flip: 0 891 | v_flip: 0 892 | rotate90: 0 893 | } 894 | cell { 895 | x: 4 896 | y: 12 897 | tile: 28 898 | h_flip: 0 899 | v_flip: 0 900 | rotate90: 0 901 | } 902 | cell { 903 | x: 5 904 | y: 12 905 | tile: 28 906 | h_flip: 0 907 | v_flip: 0 908 | rotate90: 0 909 | } 910 | cell { 911 | x: 6 912 | y: 12 913 | tile: 28 914 | h_flip: 0 915 | v_flip: 0 916 | rotate90: 0 917 | } 918 | cell { 919 | x: 7 920 | y: 12 921 | tile: 28 922 | h_flip: 0 923 | v_flip: 0 924 | rotate90: 0 925 | } 926 | cell { 927 | x: 8 928 | y: 12 929 | tile: 28 930 | h_flip: 0 931 | v_flip: 0 932 | rotate90: 0 933 | } 934 | cell { 935 | x: 9 936 | y: 12 937 | tile: 28 938 | h_flip: 0 939 | v_flip: 0 940 | rotate90: 0 941 | } 942 | cell { 943 | x: 16 944 | y: 12 945 | tile: 28 946 | h_flip: 0 947 | v_flip: 0 948 | rotate90: 0 949 | } 950 | cell { 951 | x: 17 952 | y: 12 953 | tile: 28 954 | h_flip: 0 955 | v_flip: 0 956 | rotate90: 0 957 | } 958 | cell { 959 | x: 18 960 | y: 12 961 | tile: 28 962 | h_flip: 0 963 | v_flip: 0 964 | rotate90: 0 965 | } 966 | cell { 967 | x: 19 968 | y: 12 969 | tile: 28 970 | h_flip: 0 971 | v_flip: 0 972 | rotate90: 0 973 | } 974 | cell { 975 | x: 20 976 | y: 12 977 | tile: 28 978 | h_flip: 0 979 | v_flip: 0 980 | rotate90: 0 981 | } 982 | cell { 983 | x: 0 984 | y: 13 985 | tile: 28 986 | h_flip: 0 987 | v_flip: 0 988 | rotate90: 0 989 | } 990 | cell { 991 | x: 18 992 | y: 13 993 | tile: 28 994 | h_flip: 0 995 | v_flip: 0 996 | rotate90: 0 997 | } 998 | cell { 999 | x: 19 1000 | y: 13 1001 | tile: 28 1002 | h_flip: 0 1003 | v_flip: 0 1004 | rotate90: 0 1005 | } 1006 | cell { 1007 | x: 20 1008 | y: 13 1009 | tile: 28 1010 | h_flip: 0 1011 | v_flip: 0 1012 | rotate90: 0 1013 | } 1014 | cell { 1015 | x: 0 1016 | y: 14 1017 | tile: 28 1018 | h_flip: 0 1019 | v_flip: 0 1020 | rotate90: 0 1021 | } 1022 | cell { 1023 | x: 18 1024 | y: 14 1025 | tile: 28 1026 | h_flip: 0 1027 | v_flip: 0 1028 | rotate90: 0 1029 | } 1030 | cell { 1031 | x: 19 1032 | y: 14 1033 | tile: 28 1034 | h_flip: 0 1035 | v_flip: 0 1036 | rotate90: 0 1037 | } 1038 | cell { 1039 | x: 20 1040 | y: 14 1041 | tile: 28 1042 | h_flip: 0 1043 | v_flip: 0 1044 | rotate90: 0 1045 | } 1046 | cell { 1047 | x: 0 1048 | y: 15 1049 | tile: 28 1050 | h_flip: 0 1051 | v_flip: 0 1052 | rotate90: 0 1053 | } 1054 | cell { 1055 | x: 4 1056 | y: 15 1057 | tile: 28 1058 | h_flip: 0 1059 | v_flip: 0 1060 | rotate90: 0 1061 | } 1062 | cell { 1063 | x: 5 1064 | y: 15 1065 | tile: 28 1066 | h_flip: 0 1067 | v_flip: 0 1068 | rotate90: 0 1069 | } 1070 | cell { 1071 | x: 13 1072 | y: 15 1073 | tile: 28 1074 | h_flip: 0 1075 | v_flip: 0 1076 | rotate90: 0 1077 | } 1078 | cell { 1079 | x: 14 1080 | y: 15 1081 | tile: 28 1082 | h_flip: 0 1083 | v_flip: 0 1084 | rotate90: 0 1085 | } 1086 | cell { 1087 | x: 15 1088 | y: 15 1089 | tile: 28 1090 | h_flip: 0 1091 | v_flip: 0 1092 | rotate90: 0 1093 | } 1094 | cell { 1095 | x: 20 1096 | y: 15 1097 | tile: 28 1098 | h_flip: 0 1099 | v_flip: 0 1100 | rotate90: 0 1101 | } 1102 | cell { 1103 | x: 0 1104 | y: 16 1105 | tile: 28 1106 | h_flip: 0 1107 | v_flip: 0 1108 | rotate90: 0 1109 | } 1110 | cell { 1111 | x: 4 1112 | y: 16 1113 | tile: 28 1114 | h_flip: 0 1115 | v_flip: 0 1116 | rotate90: 0 1117 | } 1118 | cell { 1119 | x: 5 1120 | y: 16 1121 | tile: 28 1122 | h_flip: 0 1123 | v_flip: 0 1124 | rotate90: 0 1125 | } 1126 | cell { 1127 | x: 13 1128 | y: 16 1129 | tile: 28 1130 | h_flip: 0 1131 | v_flip: 0 1132 | rotate90: 0 1133 | } 1134 | cell { 1135 | x: 20 1136 | y: 16 1137 | tile: 28 1138 | h_flip: 0 1139 | v_flip: 0 1140 | rotate90: 0 1141 | } 1142 | cell { 1143 | x: 0 1144 | y: 17 1145 | tile: 28 1146 | h_flip: 0 1147 | v_flip: 0 1148 | rotate90: 0 1149 | } 1150 | cell { 1151 | x: 4 1152 | y: 17 1153 | tile: 28 1154 | h_flip: 0 1155 | v_flip: 0 1156 | rotate90: 0 1157 | } 1158 | cell { 1159 | x: 5 1160 | y: 17 1161 | tile: 28 1162 | h_flip: 0 1163 | v_flip: 0 1164 | rotate90: 0 1165 | } 1166 | cell { 1167 | x: 6 1168 | y: 17 1169 | tile: 28 1170 | h_flip: 0 1171 | v_flip: 0 1172 | rotate90: 0 1173 | } 1174 | cell { 1175 | x: 7 1176 | y: 17 1177 | tile: 28 1178 | h_flip: 0 1179 | v_flip: 0 1180 | rotate90: 0 1181 | } 1182 | cell { 1183 | x: 8 1184 | y: 17 1185 | tile: 28 1186 | h_flip: 0 1187 | v_flip: 0 1188 | rotate90: 0 1189 | } 1190 | cell { 1191 | x: 9 1192 | y: 17 1193 | tile: 28 1194 | h_flip: 0 1195 | v_flip: 0 1196 | rotate90: 0 1197 | } 1198 | cell { 1199 | x: 10 1200 | y: 17 1201 | tile: 28 1202 | h_flip: 0 1203 | v_flip: 0 1204 | rotate90: 0 1205 | } 1206 | cell { 1207 | x: 11 1208 | y: 17 1209 | tile: 28 1210 | h_flip: 0 1211 | v_flip: 0 1212 | rotate90: 0 1213 | } 1214 | cell { 1215 | x: 12 1216 | y: 17 1217 | tile: 28 1218 | h_flip: 0 1219 | v_flip: 0 1220 | rotate90: 0 1221 | } 1222 | cell { 1223 | x: 13 1224 | y: 17 1225 | tile: 28 1226 | h_flip: 0 1227 | v_flip: 0 1228 | rotate90: 0 1229 | } 1230 | cell { 1231 | x: 20 1232 | y: 17 1233 | tile: 28 1234 | h_flip: 0 1235 | v_flip: 0 1236 | rotate90: 0 1237 | } 1238 | cell { 1239 | x: 0 1240 | y: 18 1241 | tile: 28 1242 | h_flip: 0 1243 | v_flip: 0 1244 | rotate90: 0 1245 | } 1246 | cell { 1247 | x: 8 1248 | y: 18 1249 | tile: 3 1250 | h_flip: 0 1251 | v_flip: 0 1252 | rotate90: 0 1253 | } 1254 | cell { 1255 | x: 9 1256 | y: 18 1257 | tile: 3 1258 | h_flip: 0 1259 | v_flip: 0 1260 | rotate90: 0 1261 | } 1262 | cell { 1263 | x: 10 1264 | y: 18 1265 | tile: 3 1266 | h_flip: 0 1267 | v_flip: 0 1268 | rotate90: 0 1269 | } 1270 | cell { 1271 | x: 20 1272 | y: 18 1273 | tile: 28 1274 | h_flip: 0 1275 | v_flip: 0 1276 | rotate90: 0 1277 | } 1278 | cell { 1279 | x: 0 1280 | y: 19 1281 | tile: 28 1282 | h_flip: 0 1283 | v_flip: 0 1284 | rotate90: 0 1285 | } 1286 | cell { 1287 | x: 20 1288 | y: 19 1289 | tile: 28 1290 | h_flip: 0 1291 | v_flip: 0 1292 | rotate90: 0 1293 | } 1294 | cell { 1295 | x: 0 1296 | y: 20 1297 | tile: 28 1298 | h_flip: 0 1299 | v_flip: 0 1300 | rotate90: 0 1301 | } 1302 | cell { 1303 | x: 1 1304 | y: 20 1305 | tile: 28 1306 | h_flip: 0 1307 | v_flip: 0 1308 | rotate90: 0 1309 | } 1310 | cell { 1311 | x: 2 1312 | y: 20 1313 | tile: 28 1314 | h_flip: 0 1315 | v_flip: 0 1316 | rotate90: 0 1317 | } 1318 | cell { 1319 | x: 3 1320 | y: 20 1321 | tile: 28 1322 | h_flip: 0 1323 | v_flip: 0 1324 | rotate90: 0 1325 | } 1326 | cell { 1327 | x: 4 1328 | y: 20 1329 | tile: 28 1330 | h_flip: 0 1331 | v_flip: 0 1332 | rotate90: 0 1333 | } 1334 | cell { 1335 | x: 5 1336 | y: 20 1337 | tile: 28 1338 | h_flip: 0 1339 | v_flip: 0 1340 | rotate90: 0 1341 | } 1342 | cell { 1343 | x: 6 1344 | y: 20 1345 | tile: 28 1346 | h_flip: 0 1347 | v_flip: 0 1348 | rotate90: 0 1349 | } 1350 | cell { 1351 | x: 7 1352 | y: 20 1353 | tile: 28 1354 | h_flip: 0 1355 | v_flip: 0 1356 | rotate90: 0 1357 | } 1358 | cell { 1359 | x: 8 1360 | y: 20 1361 | tile: 28 1362 | h_flip: 0 1363 | v_flip: 0 1364 | rotate90: 0 1365 | } 1366 | cell { 1367 | x: 9 1368 | y: 20 1369 | tile: 28 1370 | h_flip: 0 1371 | v_flip: 0 1372 | rotate90: 0 1373 | } 1374 | cell { 1375 | x: 10 1376 | y: 20 1377 | tile: 28 1378 | h_flip: 0 1379 | v_flip: 0 1380 | rotate90: 0 1381 | } 1382 | cell { 1383 | x: 11 1384 | y: 20 1385 | tile: 28 1386 | h_flip: 0 1387 | v_flip: 0 1388 | rotate90: 0 1389 | } 1390 | cell { 1391 | x: 12 1392 | y: 20 1393 | tile: 28 1394 | h_flip: 0 1395 | v_flip: 0 1396 | rotate90: 0 1397 | } 1398 | cell { 1399 | x: 13 1400 | y: 20 1401 | tile: 28 1402 | h_flip: 0 1403 | v_flip: 0 1404 | rotate90: 0 1405 | } 1406 | cell { 1407 | x: 14 1408 | y: 20 1409 | tile: 28 1410 | h_flip: 0 1411 | v_flip: 0 1412 | rotate90: 0 1413 | } 1414 | cell { 1415 | x: 15 1416 | y: 20 1417 | tile: 28 1418 | h_flip: 0 1419 | v_flip: 0 1420 | rotate90: 0 1421 | } 1422 | cell { 1423 | x: 16 1424 | y: 20 1425 | tile: 28 1426 | h_flip: 0 1427 | v_flip: 0 1428 | rotate90: 0 1429 | } 1430 | cell { 1431 | x: 17 1432 | y: 20 1433 | tile: 28 1434 | h_flip: 0 1435 | v_flip: 0 1436 | rotate90: 0 1437 | } 1438 | cell { 1439 | x: 18 1440 | y: 20 1441 | tile: 28 1442 | h_flip: 0 1443 | v_flip: 0 1444 | rotate90: 0 1445 | } 1446 | cell { 1447 | x: 19 1448 | y: 20 1449 | tile: 28 1450 | h_flip: 0 1451 | v_flip: 0 1452 | rotate90: 0 1453 | } 1454 | cell { 1455 | x: 20 1456 | y: 20 1457 | tile: 28 1458 | h_flip: 0 1459 | v_flip: 0 1460 | rotate90: 0 1461 | } 1462 | } 1463 | material: "/builtins/materials/tile_map.material" 1464 | blend_mode: BLEND_MODE_ALPHA 1465 | -------------------------------------------------------------------------------- /game/player/player.go: -------------------------------------------------------------------------------- 1 | components { 2 | id: "player" 3 | component: "/game/player/player.script" 4 | position { 5 | x: 0.0 6 | y: 0.0 7 | z: 0.0 8 | } 9 | rotation { 10 | x: 0.0 11 | y: 0.0 12 | z: 0.0 13 | w: 1.0 14 | } 15 | } 16 | embedded_components { 17 | id: "sprite" 18 | type: "sprite" 19 | data: "default_animation: \"player\"\n" 20 | "material: \"/builtins/materials/sprite.material\"\n" 21 | "blend_mode: BLEND_MODE_ALPHA\n" 22 | "textures {\n" 23 | " sampler: \"texture_sampler\"\n" 24 | " texture: \"/game/core/game.tilesource\"\n" 25 | "}\n" 26 | "" 27 | position { 28 | x: 0.0 29 | y: 0.0 30 | z: 0.0 31 | } 32 | rotation { 33 | x: 0.0 34 | y: 0.0 35 | z: 0.0 36 | w: 1.0 37 | } 38 | } 39 | embedded_components { 40 | id: "co" 41 | type: "collisionobject" 42 | data: "collision_shape: \"\"\n" 43 | "type: COLLISION_OBJECT_TYPE_KINEMATIC\n" 44 | "mass: 0.0\n" 45 | "friction: 0.1\n" 46 | "restitution: 0.5\n" 47 | "group: \"player\"\n" 48 | "mask: \"world\"\n" 49 | "embedded_collision_shape {\n" 50 | " shapes {\n" 51 | " shape_type: TYPE_SPHERE\n" 52 | " position {\n" 53 | " x: 0.0\n" 54 | " y: 0.0\n" 55 | " z: 0.0\n" 56 | " }\n" 57 | " rotation {\n" 58 | " x: 0.0\n" 59 | " y: 0.0\n" 60 | " z: 0.0\n" 61 | " w: 1.0\n" 62 | " }\n" 63 | " index: 0\n" 64 | " count: 1\n" 65 | " id: \"\"\n" 66 | " }\n" 67 | " data: 5.0\n" 68 | "}\n" 69 | "linear_damping: 0.0\n" 70 | "angular_damping: 0.0\n" 71 | "locked_rotation: false\n" 72 | "bullet: false\n" 73 | "" 74 | position { 75 | x: 0.0 76 | y: 0.0 77 | z: 0.0 78 | } 79 | rotation { 80 | x: 0.0 81 | y: 0.0 82 | z: 0.0 83 | w: 1.0 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /game/player/player.script: -------------------------------------------------------------------------------- 1 | local data = require "main.data" 2 | 3 | local SPEED = 100 4 | local FALL_MAX = 180 5 | local GRAVITY = 5 6 | local JUMP = 180 7 | local BOUNCE = 1 8 | local COYOTE = 0.15 9 | local INVUL = 2 10 | 11 | function init(self) 12 | self.move = vmath.vector3(0) 13 | self.correction = vmath.vector3(0) 14 | self.onground = 0 15 | self.invul = INVUL 16 | msg.post(".", "acquire_input_focus") 17 | end 18 | 19 | local function quit2menu(self) 20 | msg.post("main:/sound", "stop_sound") 21 | msg.post("main:/handler", "show_menu") 22 | end 23 | 24 | local function enableinput() 25 | msg.post(".", "acquire_input_focus") 26 | end 27 | 28 | local function pauseinput(time) 29 | msg.post(".", "release_input_focus") 30 | timer.delay(time, false, enableinput) 31 | end 32 | 33 | local function move(self, dt) 34 | self.move.x = self.move.x * SPEED 35 | self.move.y = self.move.y - GRAVITY 36 | if self.move.y < -FALL_MAX then 37 | self.move.y = -FALL_MAX 38 | end 39 | 40 | go.set_position(go.get_position() + (self.move * dt)) 41 | self.move.x = 0 42 | msg.post("view#script", "point", {pos = go.get_position()}) 43 | end 44 | 45 | local function pick(self) 46 | local pos = data.world2tile(go.get_position()) 47 | local t = tilemap.get_tile("/level#tilemap", "world", pos.x, pos.y) 48 | 49 | if t == 4 then 50 | tilemap.set_tile("/level#tilemap", "world", pos.x, pos.y, 0) 51 | data.sound("beep") 52 | end 53 | end 54 | 55 | local function flash(self, dt) 56 | if self.invul > 0 then 57 | self.invul = self.invul - dt 58 | if (self.invul * 80) % 10 < 6 then 59 | msg.post("#sprite", "disable") 60 | else 61 | msg.post("#sprite", "enable") 62 | end 63 | end 64 | end 65 | 66 | function update(self, dt) 67 | if data.state == data.STATE_PLAYING then 68 | dt = data.capdt(dt) 69 | move(self, dt) 70 | pick(self) 71 | flash(self, dt) 72 | end 73 | 74 | if self.onground > 0 then 75 | self.onground = self.onground - dt 76 | end 77 | 78 | self.correction = vmath.vector3(0) 79 | end 80 | 81 | local function jump(self) 82 | if self.onground > 0 then 83 | self.move.y = JUMP 84 | self.onground = 0 85 | end 86 | end 87 | 88 | local function collision(self, message) 89 | if message.distance > 0 then 90 | local proj = vmath.project(self.correction, message.normal * message.distance) 91 | if proj < 1 then 92 | local comp = (message.distance - message.distance * proj) * message.normal 93 | go.set_position(go.get_position() + comp) 94 | self.correction = self.correction + comp 95 | if math.abs(message.normal.x) == 1 then 96 | self.move.x = 0 97 | end 98 | 99 | if message.normal.y > 0.9 then 100 | if self.move.y < -2 then 101 | --landed 102 | end 103 | 104 | if self.move.y < 0 then 105 | self.move.y = 0 106 | self.onground = COYOTE 107 | end 108 | elseif message.normal.y < -0.9 and self.move.y > 0 then 109 | self.move.y = -BOUNCE 110 | end 111 | end 112 | end 113 | end 114 | 115 | local function input_playing(self, action_id, action) 116 | if action_id == hash("left") then 117 | self.move.x = -1 118 | elseif action_id == hash("right") then 119 | self.move.x = 1 120 | elseif action_id == hash("action") and action.pressed then 121 | jump(self) 122 | elseif action_id == hash("exit") and action.pressed then 123 | msg.post("view#pause", "show") 124 | elseif action_id == hash("debug") and action.pressed and sys.get_engine_info().is_debug then 125 | msg.post("/common/view#clear", "show", {state = data.STATE_CLEAR}) 126 | end 127 | end 128 | 129 | local function input_clear(self, action_id, action) 130 | if action_id == hash("action") and action.pressed then 131 | data.level = data.level + 1 132 | if data.level > data.MAX_LEVELS then 133 | data.level = 1 134 | quit2menu(self) 135 | else 136 | msg.post("game:/loader", "new_level") 137 | end 138 | end 139 | end 140 | 141 | local function input_gameover(self, action_id, action) 142 | if (action_id == hash("exit") or action_id == hash("action")) and action.pressed then 143 | quit2menu(self) 144 | end 145 | end 146 | 147 | local function input_complete(self, action_id, action) 148 | if (action_id == hash("exit") or action_id == hash("action")) and action.pressed then 149 | quit2menu(self) 150 | end 151 | end 152 | 153 | function on_input(self, action_id, action) 154 | if action.value < 0.2 then return 155 | end 156 | 157 | if data.state == data.STATE_PLAYING then 158 | input_playing(self, action_id, action) 159 | elseif data.state == data.STATE_PAUSE then 160 | msg.post("view#pause", "input", {action_id = action_id, action = action}) 161 | elseif data.state == data.STATE_CLEAR then 162 | input_clear(self, action_id, action) 163 | elseif data.state == data.STATE_GAMEOVER then 164 | input_gameover(self, action_id, action) 165 | elseif data.state == data.STATE_COMPLETE then 166 | input_complete(self, action_id, action) 167 | end 168 | end 169 | 170 | function on_message(self, message_id, message, sender) 171 | if message_id == hash("pos") then 172 | go.set_position(message.pos) 173 | elseif message_id == hash("contact_point_response") then 174 | collision(self, message) 175 | elseif message_id == hash("quit") then 176 | quit2menu(self) 177 | end 178 | end -------------------------------------------------------------------------------- /main/custom.render: -------------------------------------------------------------------------------- 1 | script: "/main/custom.render_script" 2 | -------------------------------------------------------------------------------- /main/custom.render_script: -------------------------------------------------------------------------------- 1 | local data = require "main.data" 2 | 3 | function init(self) 4 | self.tile_pred = render.predicate({"tile"}) 5 | self.gui_pred = render.predicate({"gui"}) 6 | self.text_pred = render.predicate({"text"}) 7 | self.particle_pred = render.predicate({"particle"}) 8 | 9 | self.clear_color = vmath.vector4() 10 | self.clear_color.x = sys.get_config("render.clear_color_red", 0) 11 | self.clear_color.y = sys.get_config("render.clear_color_green", 0) 12 | self.clear_color.z = sys.get_config("render.clear_color_blue", 0) 13 | self.clear_color.w = sys.get_config("render.clear_color_alpha", 0) 14 | 15 | self.view = vmath.matrix4() 16 | 17 | data.SCR_W = render.get_width() 18 | data.SCR_H = render.get_height() 19 | data.CANV_W = data.SCR_W / data.PIXEL_SIZE 20 | data.CANV_H = data.SCR_H / data.PIXEL_SIZE 21 | data.offset = vmath.vector3(data.CANV_W / 2, data.CANV_H / 2, 0) 22 | end 23 | 24 | function update(self) 25 | local ASPECT_RATIO = render.get_width() / render.get_height() 26 | local w = render.get_window_width() 27 | local h = render.get_window_height() 28 | local sx = 0 29 | local sy = 0 30 | local ar = w/h 31 | 32 | if ar > ASPECT_RATIO then 33 | sx = (w - (h * ASPECT_RATIO)) / 2 34 | w = h * ASPECT_RATIO 35 | elseif ar < ASPECT_RATIO then 36 | sy = (h - (w / ASPECT_RATIO)) / 2 37 | h = w / ASPECT_RATIO 38 | end 39 | 40 | render.set_depth_mask(true) 41 | render.clear({[render.BUFFER_COLOR_BIT] = self.clear_color, [render.BUFFER_DEPTH_BIT] = 1, [render.BUFFER_STENCIL_BIT] = 0}) 42 | 43 | render.set_viewport(math.ceil(sx), math.ceil(sy), math.ceil(w), math.ceil(h)) 44 | render.set_view(self.view) 45 | 46 | render.set_depth_mask(false) 47 | render.disable_state(render.STATE_DEPTH_TEST) 48 | render.disable_state(render.STATE_STENCIL_TEST) 49 | render.enable_state(render.STATE_BLEND) 50 | render.set_blend_func(render.BLEND_SRC_ALPHA, render.BLEND_ONE_MINUS_SRC_ALPHA) 51 | render.disable_state(render.STATE_CULL_FACE) 52 | 53 | render.set_projection(vmath.matrix4_orthographic(0, render.get_width() / data.PIXEL_SIZE, 0, render.get_height() / data.PIXEL_SIZE, -1, 1)) 54 | 55 | render.draw(self.tile_pred) 56 | render.draw(self.particle_pred) 57 | render.draw_debug3d() 58 | 59 | render.set_view(vmath.matrix4()) 60 | render.set_projection(vmath.matrix4_orthographic(0, render.get_window_width(), 0, render.get_window_height(), -1, 1)) 61 | 62 | render.enable_state(render.STATE_STENCIL_TEST) 63 | render.draw(self.gui_pred) 64 | render.draw(self.text_pred) 65 | render.disable_state(render.STATE_STENCIL_TEST) 66 | 67 | render.set_depth_mask(false) 68 | end 69 | 70 | function on_message(self, message_id, message) 71 | if message_id == hash("clear_color") then 72 | self.clear_color = message.color 73 | elseif message_id == hash("set_view_projection") then 74 | self.view = message.view 75 | end 76 | end 77 | -------------------------------------------------------------------------------- /main/data.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.STATE_MENU = 1 4 | M.STATE_CONTROLS = 2 5 | M.STATE_CREDITS = 3 6 | M.STATE_PLAYING = 4 7 | M.STATE_PAUSE = 5 8 | M.STATE_CLEAR = 6 9 | M.STATE_GAMEOVER = 7 10 | M.STATE_COMPLETE = 8 11 | 12 | M.state = M.STATE_MENU 13 | 14 | M.SCR_W = 0 15 | M.SCR_H = 0 16 | M.CANV_W = 0 17 | M.CANV_H = 0 18 | M.TILE_SIZE = 16 19 | M.PIXEL_SIZE = 4 20 | M.MAX_LEVELS = 10 21 | 22 | M.level = 1 23 | M.time = 0 24 | 25 | M.offset = vmath.vector3(0) 26 | M.scrollpos = vmath.vector3(0) 27 | M.bounds = vmath.vector3(0) 28 | 29 | M.gate = {} 30 | 31 | function M.world2tile(p) 32 | return vmath.vector3(math.floor((p.x + M.TILE_SIZE) / M.TILE_SIZE), math.floor((p.y + M.TILE_SIZE) / M.TILE_SIZE), p.z) 33 | end 34 | 35 | function M.tile2world(p) 36 | return vmath.vector3((p.x * M.TILE_SIZE) - (M.TILE_SIZE / 2), (p.y * M.TILE_SIZE) - (M.TILE_SIZE / 2), p.z) 37 | end 38 | 39 | function M.hex2rgba(hex) 40 | hex = hex:gsub("#","") 41 | local rgba = vmath.vector4(tonumber("0x"..hex:sub(1,2))/255, tonumber("0x"..hex:sub(3,4))/255, tonumber("0x"..hex:sub(5,6))/255, 1) 42 | return rgba 43 | end 44 | 45 | function M.onscreen(p, m) 46 | if p.x > M.scrollpos.x - m and 47 | p.x < M.scrollpos.x + m + M.CANV_W and 48 | p.y > M.scrollpos.y - m and 49 | p.y < M.scrollpos.y + m + M.CANV_H then 50 | return true 51 | else 52 | return false 53 | end 54 | end 55 | 56 | function M.capdt(dt) 57 | if dt > 1/30 then 58 | dt = 1/30 59 | end 60 | return dt 61 | end 62 | 63 | function M.ms2str(time) 64 | local day = math.floor(time / 86400) 65 | local rem = time % 86400 66 | local hr = math.floor(rem / 3600) 67 | rem = rem % 3600 68 | local min = math.floor(rem / 60) 69 | rem = rem % 60 70 | local sec = rem 71 | 72 | local str = "" 73 | if day > 0 then str = tostring(day) .. "d " end 74 | if hr > 0 or day > 0 then str = str .. tostring(hr) .. ":" end 75 | 76 | str = string.format("%s%02d:%02d", str, min, math.floor(sec)) 77 | return str 78 | end 79 | 80 | function M.sound(id) 81 | local t = M.gate[id] or 0 82 | t = os.clock() - t 83 | 84 | if t > 0.05 then 85 | M.gate[id] = os.clock() 86 | local url = "main:/sound#"..id 87 | sound.play(url) 88 | end 89 | end 90 | 91 | function M.fullscreen(self) 92 | defos.toggle_fullscreen() 93 | defos.disable_window_resize() 94 | defos.disable_maximize_button() 95 | defos.set_cursor_visible(not defos.is_fullscreen()) 96 | end 97 | 98 | return M 99 | -------------------------------------------------------------------------------- /main/game.input_binding: -------------------------------------------------------------------------------- 1 | key_trigger { 2 | input: KEY_SPACE 3 | action: "action" 4 | } 5 | key_trigger { 6 | input: KEY_W 7 | action: "up" 8 | } 9 | key_trigger { 10 | input: KEY_A 11 | action: "left" 12 | } 13 | key_trigger { 14 | input: KEY_S 15 | action: "down" 16 | } 17 | key_trigger { 18 | input: KEY_D 19 | action: "right" 20 | } 21 | key_trigger { 22 | input: KEY_Q 23 | action: "exit" 24 | } 25 | key_trigger { 26 | input: KEY_UP 27 | action: "up" 28 | } 29 | key_trigger { 30 | input: KEY_DOWN 31 | action: "down" 32 | } 33 | key_trigger { 34 | input: KEY_LEFT 35 | action: "left" 36 | } 37 | key_trigger { 38 | input: KEY_RIGHT 39 | action: "right" 40 | } 41 | key_trigger { 42 | input: KEY_X 43 | action: "action" 44 | } 45 | key_trigger { 46 | input: KEY_ENTER 47 | action: "action" 48 | } 49 | key_trigger { 50 | input: KEY_END 51 | action: "debug" 52 | } 53 | key_trigger { 54 | input: KEY_F11 55 | action: "fullscreen" 56 | } 57 | key_trigger { 58 | input: KEY_ESC 59 | action: "exit" 60 | } 61 | gamepad_trigger { 62 | input: GAMEPAD_LSTICK_LEFT 63 | action: "left" 64 | } 65 | gamepad_trigger { 66 | input: GAMEPAD_LSTICK_RIGHT 67 | action: "right" 68 | } 69 | gamepad_trigger { 70 | input: GAMEPAD_LSTICK_UP 71 | action: "up" 72 | } 73 | gamepad_trigger { 74 | input: GAMEPAD_LSTICK_DOWN 75 | action: "down" 76 | } 77 | gamepad_trigger { 78 | input: GAMEPAD_LPAD_UP 79 | action: "up" 80 | } 81 | gamepad_trigger { 82 | input: GAMEPAD_LPAD_DOWN 83 | action: "down" 84 | } 85 | gamepad_trigger { 86 | input: GAMEPAD_LPAD_LEFT 87 | action: "left" 88 | } 89 | gamepad_trigger { 90 | input: GAMEPAD_LPAD_RIGHT 91 | action: "right" 92 | } 93 | gamepad_trigger { 94 | input: GAMEPAD_RPAD_DOWN 95 | action: "action" 96 | } 97 | gamepad_trigger { 98 | input: GAMEPAD_RPAD_LEFT 99 | action: "action" 100 | } 101 | gamepad_trigger { 102 | input: GAMEPAD_RPAD_UP 103 | action: "action" 104 | } 105 | gamepad_trigger { 106 | input: GAMEPAD_RPAD_RIGHT 107 | action: "action" 108 | } 109 | gamepad_trigger { 110 | input: GAMEPAD_START 111 | action: "start" 112 | } 113 | -------------------------------------------------------------------------------- /main/handler.script: -------------------------------------------------------------------------------- 1 | local data = require "main.data" 2 | 3 | function init(self) 4 | msg.post(".", "acquire_input_focus") 5 | msg.post("@render:", "clear_color", {color = data.hex2rgba("#1b1c33")}) 6 | msg.post("handler#menu", "load") 7 | 8 | math.randomseed(os.time()) 9 | for n = 1, 5 do 10 | local r = math.random() 11 | end 12 | end 13 | 14 | function on_message(self, message_id, message,sender) 15 | if message_id == hash("show_game") then 16 | msg.post("handler#menu", "unload") 17 | msg.post("handler#game", "load") 18 | elseif message_id == hash("show_menu") then 19 | msg.post("handler#game", "unload") 20 | msg.post("handler#menu", "load") 21 | elseif message_id == hash("proxy_loaded") then 22 | msg.post(sender, "enable") 23 | end 24 | end 25 | 26 | function on_input(self, action_id, action) 27 | if action_id == hash("fullscreen") and action.pressed then 28 | data.fullscreen(self) 29 | end 30 | end -------------------------------------------------------------------------------- /main/main.atlas: -------------------------------------------------------------------------------- 1 | margin: 0 2 | extrude_borders: 2 3 | inner_padding: 0 4 | -------------------------------------------------------------------------------- /main/main.collection: -------------------------------------------------------------------------------- 1 | name: "main" 2 | scale_along_z: 0 3 | embedded_instances { 4 | id: "handler" 5 | data: "components {\n" 6 | " id: \"script\"\n" 7 | " component: \"/main/handler.script\"\n" 8 | " position {\n" 9 | " x: 0.0\n" 10 | " y: 0.0\n" 11 | " z: 0.0\n" 12 | " }\n" 13 | " rotation {\n" 14 | " x: 0.0\n" 15 | " y: 0.0\n" 16 | " z: 0.0\n" 17 | " w: 1.0\n" 18 | " }\n" 19 | " property_decls {\n" 20 | " }\n" 21 | "}\n" 22 | "embedded_components {\n" 23 | " id: \"game\"\n" 24 | " type: \"collectionproxy\"\n" 25 | " data: \"collection: \\\"/game/core/game.collection\\\"\\n" 26 | "exclude: false\\n" 27 | "\"\n" 28 | " position {\n" 29 | " x: 0.0\n" 30 | " y: 0.0\n" 31 | " z: 0.0\n" 32 | " }\n" 33 | " rotation {\n" 34 | " x: 0.0\n" 35 | " y: 0.0\n" 36 | " z: 0.0\n" 37 | " w: 1.0\n" 38 | " }\n" 39 | "}\n" 40 | "embedded_components {\n" 41 | " id: \"menu\"\n" 42 | " type: \"collectionproxy\"\n" 43 | " data: \"collection: \\\"/menu/menu.collection\\\"\\n" 44 | "exclude: false\\n" 45 | "\"\n" 46 | " position {\n" 47 | " x: 0.0\n" 48 | " y: 0.0\n" 49 | " z: 0.0\n" 50 | " }\n" 51 | " rotation {\n" 52 | " x: 0.0\n" 53 | " y: 0.0\n" 54 | " z: 0.0\n" 55 | " w: 1.0\n" 56 | " }\n" 57 | "}\n" 58 | "" 59 | position { 60 | x: 0.0 61 | y: 0.0 62 | z: 0.0 63 | } 64 | rotation { 65 | x: 0.0 66 | y: 0.0 67 | z: 0.0 68 | w: 1.0 69 | } 70 | scale3 { 71 | x: 1.0 72 | y: 1.0 73 | z: 1.0 74 | } 75 | } 76 | embedded_instances { 77 | id: "sound" 78 | data: "embedded_components {\n" 79 | " id: \"beep\"\n" 80 | " type: \"sound\"\n" 81 | " data: \"sound: \\\"/assets/ogg/beep.ogg\\\"\\n" 82 | "looping: 0\\n" 83 | "group: \\\"master\\\"\\n" 84 | "gain: 1.0\\n" 85 | "pan: 0.0\\n" 86 | "speed: 1.0\\n" 87 | "loopcount: 0\\n" 88 | "\"\n" 89 | " position {\n" 90 | " x: 0.0\n" 91 | " y: 0.0\n" 92 | " z: 0.0\n" 93 | " }\n" 94 | " rotation {\n" 95 | " x: 0.0\n" 96 | " y: 0.0\n" 97 | " z: 0.0\n" 98 | " w: 1.0\n" 99 | " }\n" 100 | "}\n" 101 | "" 102 | position { 103 | x: 0.0 104 | y: 0.0 105 | z: 0.0 106 | } 107 | rotation { 108 | x: 0.0 109 | y: 0.0 110 | z: 0.0 111 | w: 1.0 112 | } 113 | scale3 { 114 | x: 1.0 115 | y: 1.0 116 | z: 1.0 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /main/ui.lua: -------------------------------------------------------------------------------- 1 | local data = require "main.data" 2 | 3 | local M = {} 4 | 5 | M.GUI_DROP = 10 6 | M.FADE = 0.1 7 | 8 | local function disablenode (self, node) 9 | gui.set_enabled(node, false) 10 | end 11 | 12 | function M.show(node) 13 | gui.set_enabled(node, true) 14 | gui.animate(node, gui.PROP_POSITION, vmath.vector3(data.SCR_W/2, data.SCR_H/2, 0), gui.EASING_INOUTQUAD, M.FADE) 15 | gui.animate(node, "color.w", 1, gui.EASING_INOUTQUAD, M.FADE) 16 | end 17 | 18 | function M.hide(node) 19 | gui.animate(node, gui.PROP_POSITION, vmath.vector3(data.SCR_W/2, (data.SCR_H/2) - M.GUI_DROP, 0), gui.EASING_INOUTQUAD, M.FADE, 0, disablenode) 20 | gui.animate(node, "color.w", 0, gui.EASING_INOUTQUAD, M.FADE) 21 | end 22 | 23 | function M.init(node) 24 | gui.set_position(node, vmath.vector3(data.SCR_W/2, (data.SCR_H/2) - M.GUI_DROP, 0)) 25 | gui.set_enabled(node, false) 26 | gui.set_color(node, vmath.vector4(1,1,1,0)) 27 | end 28 | 29 | return M -------------------------------------------------------------------------------- /menu/controls.gui: -------------------------------------------------------------------------------- 1 | script: "/menu/static.gui_script" 2 | fonts { 3 | name: "main" 4 | font: "/assets/font/main.font" 5 | } 6 | fonts { 7 | name: "large" 8 | font: "/assets/font/large.font" 9 | } 10 | background_color { 11 | x: 0.0 12 | y: 0.0 13 | z: 0.0 14 | w: 0.0 15 | } 16 | nodes { 17 | position { 18 | x: 480.0 19 | y: 320.0 20 | z: 0.0 21 | w: 1.0 22 | } 23 | rotation { 24 | x: 0.0 25 | y: 0.0 26 | z: 0.0 27 | w: 1.0 28 | } 29 | scale { 30 | x: 1.0 31 | y: 1.0 32 | z: 1.0 33 | w: 1.0 34 | } 35 | size { 36 | x: 0.0 37 | y: 0.0 38 | z: 0.0 39 | w: 1.0 40 | } 41 | color { 42 | x: 1.0 43 | y: 1.0 44 | z: 1.0 45 | w: 1.0 46 | } 47 | type: TYPE_BOX 48 | blend_mode: BLEND_MODE_ALPHA 49 | texture: "" 50 | id: "container" 51 | xanchor: XANCHOR_NONE 52 | yanchor: YANCHOR_NONE 53 | pivot: PIVOT_CENTER 54 | adjust_mode: ADJUST_MODE_STRETCH 55 | layer: "" 56 | inherit_alpha: true 57 | slice9 { 58 | x: 0.0 59 | y: 0.0 60 | z: 0.0 61 | w: 0.0 62 | } 63 | clipping_mode: CLIPPING_MODE_NONE 64 | clipping_visible: true 65 | clipping_inverted: false 66 | alpha: 1.0 67 | template_node_child: false 68 | size_mode: SIZE_MODE_MANUAL 69 | custom_type: 0 70 | enabled: true 71 | visible: true 72 | } 73 | nodes { 74 | position { 75 | x: 0.0 76 | y: 150.0 77 | z: 0.0 78 | w: 1.0 79 | } 80 | rotation { 81 | x: 0.0 82 | y: 0.0 83 | z: 0.0 84 | w: 1.0 85 | } 86 | scale { 87 | x: 1.0 88 | y: 1.0 89 | z: 1.0 90 | w: 1.0 91 | } 92 | size { 93 | x: 250.0 94 | y: 50.0 95 | z: 0.0 96 | w: 1.0 97 | } 98 | color { 99 | x: 1.0 100 | y: 1.0 101 | z: 1.0 102 | w: 1.0 103 | } 104 | type: TYPE_TEXT 105 | blend_mode: BLEND_MODE_ALPHA 106 | text: "CONTROLS" 107 | font: "large" 108 | id: "controls" 109 | xanchor: XANCHOR_NONE 110 | yanchor: YANCHOR_NONE 111 | pivot: PIVOT_CENTER 112 | outline { 113 | x: 1.0 114 | y: 1.0 115 | z: 1.0 116 | w: 1.0 117 | } 118 | shadow { 119 | x: 1.0 120 | y: 1.0 121 | z: 1.0 122 | w: 1.0 123 | } 124 | adjust_mode: ADJUST_MODE_STRETCH 125 | line_break: false 126 | parent: "container" 127 | layer: "" 128 | inherit_alpha: true 129 | alpha: 1.0 130 | outline_alpha: 0.0 131 | shadow_alpha: 0.0 132 | template_node_child: false 133 | text_leading: 1.0 134 | text_tracking: 0.0 135 | custom_type: 0 136 | enabled: true 137 | visible: true 138 | } 139 | nodes { 140 | position { 141 | x: -10.0 142 | y: 0.0 143 | z: 0.0 144 | w: 1.0 145 | } 146 | rotation { 147 | x: 0.0 148 | y: 0.0 149 | z: 0.0 150 | w: 1.0 151 | } 152 | scale { 153 | x: 1.0 154 | y: 1.0 155 | z: 1.0 156 | w: 1.0 157 | } 158 | size { 159 | x: 300.0 160 | y: 200.0 161 | z: 0.0 162 | w: 1.0 163 | } 164 | color { 165 | x: 1.0 166 | y: 1.0 167 | z: 1.0 168 | w: 1.0 169 | } 170 | type: TYPE_TEXT 171 | blend_mode: BLEND_MODE_ALPHA 172 | text: "move\n" 173 | "action\n" 174 | "fullscreen\n" 175 | "pause" 176 | font: "main" 177 | id: "left" 178 | xanchor: XANCHOR_NONE 179 | yanchor: YANCHOR_NONE 180 | pivot: PIVOT_E 181 | outline { 182 | x: 1.0 183 | y: 1.0 184 | z: 1.0 185 | w: 1.0 186 | } 187 | shadow { 188 | x: 1.0 189 | y: 1.0 190 | z: 1.0 191 | w: 1.0 192 | } 193 | adjust_mode: ADJUST_MODE_STRETCH 194 | line_break: false 195 | parent: "container" 196 | layer: "" 197 | inherit_alpha: true 198 | alpha: 1.0 199 | outline_alpha: 0.0 200 | shadow_alpha: 0.0 201 | template_node_child: false 202 | text_leading: 1.8 203 | text_tracking: 0.0 204 | custom_type: 0 205 | enabled: true 206 | visible: true 207 | } 208 | nodes { 209 | position { 210 | x: 10.0 211 | y: 0.0 212 | z: 0.0 213 | w: 1.0 214 | } 215 | rotation { 216 | x: 0.0 217 | y: 0.0 218 | z: 0.0 219 | w: 1.0 220 | } 221 | scale { 222 | x: 1.0 223 | y: 1.0 224 | z: 1.0 225 | w: 1.0 226 | } 227 | size { 228 | x: 300.0 229 | y: 200.0 230 | z: 0.0 231 | w: 1.0 232 | } 233 | color { 234 | x: 1.0 235 | y: 1.0 236 | z: 1.0 237 | w: 1.0 238 | } 239 | type: TYPE_TEXT 240 | blend_mode: BLEND_MODE_ALPHA 241 | text: "ARROWS\n" 242 | "X\n" 243 | "F11\n" 244 | "ESC" 245 | font: "main" 246 | id: "right" 247 | xanchor: XANCHOR_NONE 248 | yanchor: YANCHOR_NONE 249 | pivot: PIVOT_W 250 | outline { 251 | x: 1.0 252 | y: 1.0 253 | z: 1.0 254 | w: 1.0 255 | } 256 | shadow { 257 | x: 1.0 258 | y: 1.0 259 | z: 1.0 260 | w: 1.0 261 | } 262 | adjust_mode: ADJUST_MODE_STRETCH 263 | line_break: false 264 | parent: "container" 265 | layer: "" 266 | inherit_alpha: true 267 | alpha: 1.0 268 | outline_alpha: 0.0 269 | shadow_alpha: 0.0 270 | template_node_child: false 271 | text_leading: 1.8 272 | text_tracking: 0.0 273 | custom_type: 0 274 | enabled: true 275 | visible: true 276 | } 277 | nodes { 278 | position { 279 | x: 0.0 280 | y: -150.0 281 | z: 0.0 282 | w: 1.0 283 | } 284 | rotation { 285 | x: 0.0 286 | y: 0.0 287 | z: 0.0 288 | w: 1.0 289 | } 290 | scale { 291 | x: 1.0 292 | y: 1.0 293 | z: 1.0 294 | w: 1.0 295 | } 296 | size { 297 | x: 620.0 298 | y: 50.0 299 | z: 0.0 300 | w: 1.0 301 | } 302 | color { 303 | x: 1.0 304 | y: 1.0 305 | z: 1.0 306 | w: 1.0 307 | } 308 | type: TYPE_TEXT 309 | blend_mode: BLEND_MODE_ALPHA 310 | text: "GAMEPAD COMPATIBLE" 311 | font: "main" 312 | id: "controls1" 313 | xanchor: XANCHOR_NONE 314 | yanchor: YANCHOR_NONE 315 | pivot: PIVOT_CENTER 316 | outline { 317 | x: 1.0 318 | y: 1.0 319 | z: 1.0 320 | w: 1.0 321 | } 322 | shadow { 323 | x: 1.0 324 | y: 1.0 325 | z: 1.0 326 | w: 1.0 327 | } 328 | adjust_mode: ADJUST_MODE_STRETCH 329 | line_break: false 330 | parent: "container" 331 | layer: "" 332 | inherit_alpha: true 333 | alpha: 1.0 334 | outline_alpha: 0.0 335 | shadow_alpha: 0.0 336 | template_node_child: false 337 | text_leading: 1.0 338 | text_tracking: 0.0 339 | custom_type: 0 340 | enabled: true 341 | visible: true 342 | } 343 | material: "/builtins/materials/gui.material" 344 | adjust_reference: ADJUST_REFERENCE_PARENT 345 | max_nodes: 512 346 | -------------------------------------------------------------------------------- /menu/credits.gui: -------------------------------------------------------------------------------- 1 | script: "/menu/static.gui_script" 2 | fonts { 3 | name: "main" 4 | font: "/assets/font/main.font" 5 | } 6 | fonts { 7 | name: "large" 8 | font: "/assets/font/large.font" 9 | } 10 | background_color { 11 | x: 0.0 12 | y: 0.0 13 | z: 0.0 14 | w: 0.0 15 | } 16 | nodes { 17 | position { 18 | x: 480.0 19 | y: 320.0 20 | z: 0.0 21 | w: 1.0 22 | } 23 | rotation { 24 | x: 0.0 25 | y: 0.0 26 | z: 0.0 27 | w: 1.0 28 | } 29 | scale { 30 | x: 1.0 31 | y: 1.0 32 | z: 1.0 33 | w: 1.0 34 | } 35 | size { 36 | x: 0.0 37 | y: 0.0 38 | z: 0.0 39 | w: 1.0 40 | } 41 | color { 42 | x: 1.0 43 | y: 1.0 44 | z: 1.0 45 | w: 1.0 46 | } 47 | type: TYPE_BOX 48 | blend_mode: BLEND_MODE_ALPHA 49 | texture: "" 50 | id: "container" 51 | xanchor: XANCHOR_NONE 52 | yanchor: YANCHOR_NONE 53 | pivot: PIVOT_CENTER 54 | adjust_mode: ADJUST_MODE_STRETCH 55 | layer: "" 56 | inherit_alpha: true 57 | slice9 { 58 | x: 0.0 59 | y: 0.0 60 | z: 0.0 61 | w: 0.0 62 | } 63 | clipping_mode: CLIPPING_MODE_NONE 64 | clipping_visible: true 65 | clipping_inverted: false 66 | alpha: 1.0 67 | template_node_child: false 68 | size_mode: SIZE_MODE_MANUAL 69 | custom_type: 0 70 | enabled: true 71 | visible: true 72 | material: "" 73 | } 74 | nodes { 75 | position { 76 | x: 0.0 77 | y: 150.0 78 | z: 0.0 79 | w: 1.0 80 | } 81 | rotation { 82 | x: 0.0 83 | y: 0.0 84 | z: 0.0 85 | w: 1.0 86 | } 87 | scale { 88 | x: 1.0 89 | y: 1.0 90 | z: 1.0 91 | w: 1.0 92 | } 93 | size { 94 | x: 300.0 95 | y: 50.0 96 | z: 0.0 97 | w: 1.0 98 | } 99 | color { 100 | x: 1.0 101 | y: 1.0 102 | z: 1.0 103 | w: 1.0 104 | } 105 | type: TYPE_TEXT 106 | blend_mode: BLEND_MODE_ALPHA 107 | text: "CREDITS" 108 | font: "large" 109 | id: "title" 110 | xanchor: XANCHOR_NONE 111 | yanchor: YANCHOR_NONE 112 | pivot: PIVOT_CENTER 113 | outline { 114 | x: 1.0 115 | y: 1.0 116 | z: 1.0 117 | w: 1.0 118 | } 119 | shadow { 120 | x: 1.0 121 | y: 1.0 122 | z: 1.0 123 | w: 1.0 124 | } 125 | adjust_mode: ADJUST_MODE_STRETCH 126 | line_break: false 127 | parent: "container" 128 | layer: "" 129 | inherit_alpha: true 130 | alpha: 1.0 131 | outline_alpha: 0.0 132 | shadow_alpha: 0.0 133 | template_node_child: false 134 | text_leading: 1.0 135 | text_tracking: 0.0 136 | custom_type: 0 137 | enabled: true 138 | visible: true 139 | material: "" 140 | } 141 | nodes { 142 | position { 143 | x: -10.0 144 | y: 0.0 145 | z: 0.0 146 | w: 1.0 147 | } 148 | rotation { 149 | x: 0.0 150 | y: 0.0 151 | z: 0.0 152 | w: 1.0 153 | } 154 | scale { 155 | x: 1.0 156 | y: 1.0 157 | z: 1.0 158 | w: 1.0 159 | } 160 | size { 161 | x: 300.0 162 | y: 200.0 163 | z: 0.0 164 | w: 1.0 165 | } 166 | color { 167 | x: 1.0 168 | y: 1.0 169 | z: 1.0 170 | w: 1.0 171 | } 172 | type: TYPE_TEXT 173 | blend_mode: BLEND_MODE_ALPHA 174 | text: "developed by\n" 175 | "music by\n" 176 | "made with" 177 | font: "main" 178 | id: "left" 179 | xanchor: XANCHOR_NONE 180 | yanchor: YANCHOR_NONE 181 | pivot: PIVOT_E 182 | outline { 183 | x: 1.0 184 | y: 1.0 185 | z: 1.0 186 | w: 1.0 187 | } 188 | shadow { 189 | x: 1.0 190 | y: 1.0 191 | z: 1.0 192 | w: 1.0 193 | } 194 | adjust_mode: ADJUST_MODE_STRETCH 195 | line_break: false 196 | parent: "container" 197 | layer: "" 198 | inherit_alpha: true 199 | alpha: 1.0 200 | outline_alpha: 0.0 201 | shadow_alpha: 0.0 202 | template_node_child: false 203 | text_leading: 1.8 204 | text_tracking: 0.0 205 | custom_type: 0 206 | enabled: true 207 | visible: true 208 | material: "" 209 | } 210 | nodes { 211 | position { 212 | x: 10.0 213 | y: 0.0 214 | z: 0.0 215 | w: 1.0 216 | } 217 | rotation { 218 | x: 0.0 219 | y: 0.0 220 | z: 0.0 221 | w: 1.0 222 | } 223 | scale { 224 | x: 1.0 225 | y: 1.0 226 | z: 1.0 227 | w: 1.0 228 | } 229 | size { 230 | x: 300.0 231 | y: 200.0 232 | z: 0.0 233 | w: 1.0 234 | } 235 | color { 236 | x: 1.0 237 | y: 1.0 238 | z: 1.0 239 | w: 1.0 240 | } 241 | type: TYPE_TEXT 242 | blend_mode: BLEND_MODE_ALPHA 243 | text: "DEVELOPER\n" 244 | "COMPOSER\n" 245 | "DEFOLD" 246 | font: "main" 247 | id: "right" 248 | xanchor: XANCHOR_NONE 249 | yanchor: YANCHOR_NONE 250 | pivot: PIVOT_W 251 | outline { 252 | x: 1.0 253 | y: 1.0 254 | z: 1.0 255 | w: 1.0 256 | } 257 | shadow { 258 | x: 1.0 259 | y: 1.0 260 | z: 1.0 261 | w: 1.0 262 | } 263 | adjust_mode: ADJUST_MODE_STRETCH 264 | line_break: false 265 | parent: "container" 266 | layer: "" 267 | inherit_alpha: true 268 | alpha: 1.0 269 | outline_alpha: 0.0 270 | shadow_alpha: 0.0 271 | template_node_child: false 272 | text_leading: 1.8 273 | text_tracking: 0.0 274 | custom_type: 0 275 | enabled: true 276 | visible: true 277 | material: "" 278 | } 279 | material: "/builtins/materials/gui.material" 280 | adjust_reference: ADJUST_REFERENCE_PARENT 281 | max_nodes: 512 282 | -------------------------------------------------------------------------------- /menu/menu.collection: -------------------------------------------------------------------------------- 1 | name: "menu" 2 | scale_along_z: 0 3 | embedded_instances { 4 | id: "menu" 5 | data: "components {\n" 6 | " id: \"controls\"\n" 7 | " component: \"/menu/controls.gui\"\n" 8 | " position {\n" 9 | " x: 0.0\n" 10 | " y: 0.0\n" 11 | " z: 0.0\n" 12 | " }\n" 13 | " rotation {\n" 14 | " x: 0.0\n" 15 | " y: 0.0\n" 16 | " z: 0.0\n" 17 | " w: 1.0\n" 18 | " }\n" 19 | " property_decls {\n" 20 | " }\n" 21 | "}\n" 22 | "components {\n" 23 | " id: \"credits\"\n" 24 | " component: \"/menu/credits.gui\"\n" 25 | " position {\n" 26 | " x: 0.0\n" 27 | " y: 0.0\n" 28 | " z: 0.0\n" 29 | " }\n" 30 | " rotation {\n" 31 | " x: 0.0\n" 32 | " y: 0.0\n" 33 | " z: 0.0\n" 34 | " w: 1.0\n" 35 | " }\n" 36 | " property_decls {\n" 37 | " }\n" 38 | "}\n" 39 | "components {\n" 40 | " id: \"menu\"\n" 41 | " component: \"/menu/menu.gui\"\n" 42 | " position {\n" 43 | " x: 0.0\n" 44 | " y: 0.0\n" 45 | " z: 0.0\n" 46 | " }\n" 47 | " rotation {\n" 48 | " x: 0.0\n" 49 | " y: 0.0\n" 50 | " z: 0.0\n" 51 | " w: 1.0\n" 52 | " }\n" 53 | " property_decls {\n" 54 | " }\n" 55 | "}\n" 56 | "" 57 | position { 58 | x: 0.0 59 | y: 0.0 60 | z: 0.0 61 | } 62 | rotation { 63 | x: 0.0 64 | y: 0.0 65 | z: 0.0 66 | w: 1.0 67 | } 68 | scale3 { 69 | x: 1.0 70 | y: 1.0 71 | z: 1.0 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /menu/menu.gui: -------------------------------------------------------------------------------- 1 | script: "/menu/menu.gui_script" 2 | fonts { 3 | name: "main" 4 | font: "/assets/font/main.font" 5 | } 6 | textures { 7 | name: "main" 8 | texture: "/main/main.atlas" 9 | } 10 | textures { 11 | name: "game" 12 | texture: "/game/core/game.tilesource" 13 | } 14 | background_color { 15 | x: 0.0 16 | y: 0.0 17 | z: 0.0 18 | w: 1.0 19 | } 20 | nodes { 21 | position { 22 | x: 480.0 23 | y: 320.0 24 | z: 0.0 25 | w: 1.0 26 | } 27 | rotation { 28 | x: 0.0 29 | y: 0.0 30 | z: 0.0 31 | w: 1.0 32 | } 33 | scale { 34 | x: 1.0 35 | y: 1.0 36 | z: 1.0 37 | w: 1.0 38 | } 39 | size { 40 | x: 0.0 41 | y: 0.0 42 | z: 0.0 43 | w: 1.0 44 | } 45 | color { 46 | x: 1.0 47 | y: 1.0 48 | z: 1.0 49 | w: 1.0 50 | } 51 | type: TYPE_BOX 52 | blend_mode: BLEND_MODE_ALPHA 53 | texture: "" 54 | id: "container" 55 | xanchor: XANCHOR_NONE 56 | yanchor: YANCHOR_NONE 57 | pivot: PIVOT_CENTER 58 | adjust_mode: ADJUST_MODE_STRETCH 59 | layer: "" 60 | inherit_alpha: true 61 | slice9 { 62 | x: 0.0 63 | y: 0.0 64 | z: 0.0 65 | w: 0.0 66 | } 67 | clipping_mode: CLIPPING_MODE_NONE 68 | clipping_visible: true 69 | clipping_inverted: false 70 | alpha: 1.0 71 | template_node_child: false 72 | size_mode: SIZE_MODE_MANUAL 73 | custom_type: 0 74 | enabled: true 75 | visible: true 76 | } 77 | nodes { 78 | position { 79 | x: 0.0 80 | y: 0.0 81 | z: 0.0 82 | w: 1.0 83 | } 84 | rotation { 85 | x: 0.0 86 | y: 0.0 87 | z: 0.0 88 | w: 1.0 89 | } 90 | scale { 91 | x: 4.0 92 | y: 4.0 93 | z: 1.0 94 | w: 1.0 95 | } 96 | size { 97 | x: 16.0 98 | y: 16.0 99 | z: 0.0 100 | w: 1.0 101 | } 102 | color { 103 | x: 1.0 104 | y: 1.0 105 | z: 1.0 106 | w: 1.0 107 | } 108 | type: TYPE_BOX 109 | blend_mode: BLEND_MODE_ALPHA 110 | texture: "game/arrow" 111 | id: "arrow" 112 | xanchor: XANCHOR_NONE 113 | yanchor: YANCHOR_NONE 114 | pivot: PIVOT_CENTER 115 | adjust_mode: ADJUST_MODE_STRETCH 116 | parent: "container" 117 | layer: "" 118 | inherit_alpha: true 119 | slice9 { 120 | x: 0.0 121 | y: 0.0 122 | z: 0.0 123 | w: 0.0 124 | } 125 | clipping_mode: CLIPPING_MODE_NONE 126 | clipping_visible: true 127 | clipping_inverted: false 128 | alpha: 1.0 129 | template_node_child: false 130 | size_mode: SIZE_MODE_AUTO 131 | custom_type: 0 132 | enabled: true 133 | visible: true 134 | } 135 | nodes { 136 | position { 137 | x: -80.0 138 | y: -136.0 139 | z: 0.0 140 | w: 1.0 141 | } 142 | rotation { 143 | x: 0.0 144 | y: 0.0 145 | z: 0.0 146 | w: 1.0 147 | } 148 | scale { 149 | x: 1.0 150 | y: 1.0 151 | z: 1.0 152 | w: 1.0 153 | } 154 | size { 155 | x: 200.0 156 | y: 32.0 157 | z: 0.0 158 | w: 1.0 159 | } 160 | color { 161 | x: 1.0 162 | y: 1.0 163 | z: 1.0 164 | w: 1.0 165 | } 166 | type: TYPE_TEXT 167 | blend_mode: BLEND_MODE_ALPHA 168 | text: "NEW GAME" 169 | font: "main" 170 | id: "1" 171 | xanchor: XANCHOR_NONE 172 | yanchor: YANCHOR_NONE 173 | pivot: PIVOT_W 174 | outline { 175 | x: 1.0 176 | y: 1.0 177 | z: 1.0 178 | w: 1.0 179 | } 180 | shadow { 181 | x: 1.0 182 | y: 1.0 183 | z: 1.0 184 | w: 1.0 185 | } 186 | adjust_mode: ADJUST_MODE_STRETCH 187 | line_break: false 188 | parent: "container" 189 | layer: "" 190 | inherit_alpha: true 191 | alpha: 1.0 192 | outline_alpha: 0.0 193 | shadow_alpha: 0.0 194 | template_node_child: false 195 | text_leading: 1.0 196 | text_tracking: 0.0 197 | custom_type: 0 198 | enabled: true 199 | visible: true 200 | } 201 | nodes { 202 | position { 203 | x: -80.0 204 | y: -176.0 205 | z: 0.0 206 | w: 1.0 207 | } 208 | rotation { 209 | x: 0.0 210 | y: 0.0 211 | z: 0.0 212 | w: 1.0 213 | } 214 | scale { 215 | x: 1.0 216 | y: 1.0 217 | z: 1.0 218 | w: 1.0 219 | } 220 | size { 221 | x: 200.0 222 | y: 32.0 223 | z: 0.0 224 | w: 1.0 225 | } 226 | color { 227 | x: 1.0 228 | y: 1.0 229 | z: 1.0 230 | w: 1.0 231 | } 232 | type: TYPE_TEXT 233 | blend_mode: BLEND_MODE_ALPHA 234 | text: "CONTROLS" 235 | font: "main" 236 | id: "2" 237 | xanchor: XANCHOR_NONE 238 | yanchor: YANCHOR_NONE 239 | pivot: PIVOT_W 240 | outline { 241 | x: 1.0 242 | y: 1.0 243 | z: 1.0 244 | w: 1.0 245 | } 246 | shadow { 247 | x: 1.0 248 | y: 1.0 249 | z: 1.0 250 | w: 1.0 251 | } 252 | adjust_mode: ADJUST_MODE_STRETCH 253 | line_break: false 254 | parent: "container" 255 | layer: "" 256 | inherit_alpha: true 257 | alpha: 1.0 258 | outline_alpha: 0.0 259 | shadow_alpha: 0.0 260 | template_node_child: false 261 | text_leading: 1.0 262 | text_tracking: 0.0 263 | custom_type: 0 264 | enabled: true 265 | visible: true 266 | } 267 | nodes { 268 | position { 269 | x: -80.0 270 | y: -216.0 271 | z: 0.0 272 | w: 1.0 273 | } 274 | rotation { 275 | x: 0.0 276 | y: 0.0 277 | z: 0.0 278 | w: 1.0 279 | } 280 | scale { 281 | x: 1.0 282 | y: 1.0 283 | z: 1.0 284 | w: 1.0 285 | } 286 | size { 287 | x: 200.0 288 | y: 32.0 289 | z: 0.0 290 | w: 1.0 291 | } 292 | color { 293 | x: 1.0 294 | y: 1.0 295 | z: 1.0 296 | w: 1.0 297 | } 298 | type: TYPE_TEXT 299 | blend_mode: BLEND_MODE_ALPHA 300 | text: "CREDITS" 301 | font: "main" 302 | id: "3" 303 | xanchor: XANCHOR_NONE 304 | yanchor: YANCHOR_NONE 305 | pivot: PIVOT_W 306 | outline { 307 | x: 1.0 308 | y: 1.0 309 | z: 1.0 310 | w: 1.0 311 | } 312 | shadow { 313 | x: 1.0 314 | y: 1.0 315 | z: 1.0 316 | w: 1.0 317 | } 318 | adjust_mode: ADJUST_MODE_STRETCH 319 | line_break: false 320 | parent: "container" 321 | layer: "" 322 | inherit_alpha: true 323 | alpha: 1.0 324 | outline_alpha: 0.0 325 | shadow_alpha: 0.0 326 | template_node_child: false 327 | text_leading: 1.0 328 | text_tracking: 0.0 329 | custom_type: 0 330 | enabled: true 331 | visible: true 332 | } 333 | nodes { 334 | position { 335 | x: 0.0 336 | y: 0.0 337 | z: 0.0 338 | w: 1.0 339 | } 340 | rotation { 341 | x: 0.0 342 | y: 0.0 343 | z: 0.0 344 | w: 1.0 345 | } 346 | scale { 347 | x: 1.0 348 | y: 1.0 349 | z: 1.0 350 | w: 1.0 351 | } 352 | size { 353 | x: 200.0 354 | y: 32.0 355 | z: 0.0 356 | w: 1.0 357 | } 358 | color { 359 | x: 1.0 360 | y: 1.0 361 | z: 1.0 362 | w: 1.0 363 | } 364 | type: TYPE_TEXT 365 | blend_mode: BLEND_MODE_ALPHA 366 | text: "..." 367 | font: "main" 368 | id: "v" 369 | xanchor: XANCHOR_NONE 370 | yanchor: YANCHOR_NONE 371 | pivot: PIVOT_CENTER 372 | outline { 373 | x: 1.0 374 | y: 1.0 375 | z: 1.0 376 | w: 1.0 377 | } 378 | shadow { 379 | x: 1.0 380 | y: 1.0 381 | z: 1.0 382 | w: 1.0 383 | } 384 | adjust_mode: ADJUST_MODE_STRETCH 385 | line_break: false 386 | parent: "container" 387 | layer: "" 388 | inherit_alpha: true 389 | alpha: 0.2 390 | outline_alpha: 0.0 391 | shadow_alpha: 0.0 392 | template_node_child: false 393 | text_leading: 1.0 394 | text_tracking: 0.0 395 | custom_type: 0 396 | enabled: true 397 | visible: true 398 | } 399 | material: "/builtins/materials/gui.material" 400 | adjust_reference: ADJUST_REFERENCE_PARENT 401 | max_nodes: 512 402 | -------------------------------------------------------------------------------- /menu/menu.gui_script: -------------------------------------------------------------------------------- 1 | local data = require "main.data" 2 | local ui = require "main.ui" 3 | 4 | local MENU_LEN = 3 5 | 6 | function init(self) 7 | self.handpos = 1 8 | self.arrowpos = {} 9 | 10 | msg.post(".", "acquire_input_focus") 11 | self.node = gui.get_node("container") 12 | for n = 1, MENU_LEN do 13 | self.arrowpos[n] = gui.get_position(gui.get_node(tostring(n))) 14 | end 15 | gui.set_position(self.node, vmath.vector3(data.SCR_W/2, (data.SCR_H/2), 0)) 16 | gui.set_text(gui.get_node("v"), sys.get_config("project.version")) 17 | data.state = data.STATE_MENU 18 | end 19 | 20 | local function startgame(self) 21 | msg.post("main:/handler", "show_game") 22 | data.level = 1 23 | data.state = data.STATE_PLAYING 24 | end 25 | 26 | local function show(self) 27 | ui.show(self.node) 28 | data.state = data.STATE_MENU 29 | end 30 | 31 | function update(self, dt) 32 | if data.state == data.STATE_MENU then 33 | local pos = vmath.vector3(self.arrowpos[self.handpos].x - 32, self.arrowpos[self.handpos].y + 1, 0) 34 | gui.set_position(gui.get_node("arrow"), pos) 35 | end 36 | end 37 | 38 | function on_message(self, message_id, message, sender) 39 | if message_id == hash("show") then 40 | show(self) 41 | end 42 | end 43 | 44 | local function input(self, action_id, action) 45 | if action_id == hash("up") and action.pressed then 46 | self.handpos = self.handpos - 1 47 | if self.handpos < 1 then 48 | self.handpos = MENU_LEN 49 | end 50 | data.sound("beep") 51 | elseif action_id == hash("down") and action.pressed then 52 | self.handpos = self.handpos + 1 53 | if self.handpos > MENU_LEN then 54 | self.handpos = 1 55 | end 56 | data.sound("beep") 57 | elseif action_id == hash("action") and action.pressed then 58 | ui.hide(self.node) 59 | if self.handpos == 1 then 60 | startgame(self) 61 | elseif self.handpos == 2 then 62 | msg.post("#controls", "show", {state = data.STATE_CONTROLS}) 63 | elseif self.handpos == 3 then 64 | msg.post("#credits", "show", {state = data.STATE_CREDITS}) 65 | end 66 | elseif action_id == hash("start") and action.pressed then 67 | startgame(self) 68 | elseif action_id == hash("exit") and action.pressed and not html5 then 69 | msg.post("@system:", "exit", {code = 0}) 70 | end 71 | end 72 | 73 | function on_input(self, action_id, action) 74 | if action.value < 0.2 then return 75 | end 76 | 77 | if data.state == data.STATE_MENU then 78 | input(self, action_id, action) 79 | elseif data.state == data.STATE_CONTROLS then 80 | msg.post("#controls", "input", {action_id = action_id, action = action}) 81 | elseif data.state == data.STATE_CREDITS then 82 | msg.post("#credits", "input", {action_id = action_id, action = action}) 83 | end 84 | end 85 | 86 | -------------------------------------------------------------------------------- /menu/static.gui_script: -------------------------------------------------------------------------------- 1 | local data = require "main.data" 2 | local ui = require "main.ui" 3 | 4 | function init(self) 5 | self.node = gui.get_node("container") 6 | ui.init(self.node) 7 | end 8 | 9 | local function input(self, action_id, action) 10 | if (action_id == hash("action") or action_id == hash("exit")) and action.pressed then 11 | ui.hide(self.node) 12 | msg.post("#menu", "show", {}) 13 | end 14 | end 15 | 16 | function on_message(self, message_id, message, sender) 17 | if message_id == hash("show") then 18 | ui.show(self.node) 19 | data.state = message.state 20 | elseif message_id == hash("input") then 21 | input(self, message.action_id, message.action) 22 | end 23 | end 24 | --------------------------------------------------------------------------------