├── .gitignore ├── .travis.yml ├── COPYING ├── Cargo.lock ├── Cargo.toml ├── Cross.toml ├── README.md ├── assets ├── data │ ├── flavors.ron │ ├── hissatsu.ron │ ├── houses.ron │ ├── palette.ron │ ├── players.ron │ ├── preparations.ron │ ├── teams.ron │ └── toppings.ron ├── font │ ├── kenney-blocks.ttf │ └── kenney-high-square.ttf ├── i18n │ └── en_us.ron ├── map │ ├── 0000.ron │ ├── 0001.ron │ ├── 0002.ron │ ├── 0003.ron │ └── freeplay.ron ├── sound │ ├── pickup.ogg │ └── pickup.wav └── texture │ ├── block-numbers.png │ ├── empty.png │ ├── empty_side.png │ ├── flavor │ ├── alaska.png │ ├── anti_scoop.png │ ├── baloon.png │ ├── blackberry.png │ ├── blue_raspberry.png │ ├── bubblegum.png │ ├── cherry.png │ ├── chocolate.png │ ├── coffee.png │ ├── cookie_dough.png │ ├── cookies_cream.png │ ├── creamsicle.png │ ├── dark_matter.png │ ├── ectoplasm.png │ ├── god.png │ ├── green_tea.png │ ├── index.ron │ ├── jalapeno.png │ ├── lemon.png │ ├── licensed.png │ ├── mint_chocolate.png │ ├── orange.png │ ├── pistachio.png │ ├── rocky_road.png │ ├── rum_raisin.png │ ├── snowball.png │ ├── strawberry.png │ ├── tiger_tail.png │ ├── tutti_frutti.png │ └── vanilla.png │ ├── item │ ├── alaska.png │ ├── anti_scoop.png │ ├── balloon.png │ ├── blackberry.png │ ├── blue_raspberry.png │ ├── bubblegum.png │ ├── cherry.png │ ├── chocolate.png │ ├── coffee.png │ ├── cookie_dough.png │ ├── cookies_cream.png │ ├── creamsicle.png │ ├── dark_matter.png │ ├── ectoplasm.png │ ├── flavors.png │ ├── flavors.ron │ ├── god.png │ ├── green_tea.png │ ├── items.png │ ├── jalapeno.png │ ├── lemon.png │ ├── licensed.png │ ├── mint_chocolate.png │ ├── old-index.ron │ ├── orange.png │ ├── pistachio.png │ ├── rocky_road.png │ ├── rum_raisin.png │ ├── snowball.png │ ├── sprinkles.png │ ├── strawberry.png │ ├── tiger_tail.png │ ├── toppings.ron │ ├── tutti_frutti.png │ └── vanilla.png │ ├── map_tiles.png │ ├── map_tiles.ron │ ├── other │ ├── bg.png │ ├── hud.png │ ├── menu.png │ ├── menu.ron │ └── title.png │ ├── player │ ├── base.png │ └── index.ron │ ├── preparation │ ├── bowl.png │ ├── cake_cone.png │ ├── chocolate_dipped_cake_cone.png │ ├── chocolate_dipped_waffle_cone.png │ ├── chocolate_sandwich.png │ ├── citrus_float.png │ ├── cola_float.png │ ├── cookie_sandwich.png │ ├── index.ron │ ├── rootbeer_float.png │ ├── shake.png │ ├── sundae.png │ └── waffle_cone.png │ ├── tall-numbers.png │ ├── topping │ ├── bananas.png │ ├── caramel_syrup.png │ ├── cherries.png │ ├── chocolate_sprinkles.png │ ├── chocolate_syrup.png │ ├── cookie_crumbles.png │ ├── gummy_candy.png │ ├── index.ron │ ├── kiwi.png │ ├── nuts.png │ ├── sprinkles.png │ ├── strawberries.png │ ├── strawberry_syrup.png │ ├── wafer_sticks.png │ └── whipped_cream.png │ └── ui │ ├── button_prompts.png │ ├── buttons.png │ ├── buttons.ron │ ├── loadout_selection.ron │ ├── map_selection.ron │ ├── melt_timers.png │ ├── progress.png │ ├── prompt_progress.png │ ├── timers.png │ ├── timers.ron │ └── tutorials.png ├── ci └── before_deploy.sh ├── resources ├── display.ron └── input.ron ├── rustfmt.toml └── src ├── bin ├── game.rs └── tool.rs ├── data ├── Cargo.lock ├── Cargo.toml └── src │ ├── animation.rs │ ├── common.rs │ ├── constants.rs │ ├── effect.rs │ ├── flavor.rs │ ├── gameplay.rs │ ├── hissatsu.rs │ ├── house.rs │ ├── lib.rs │ ├── map.rs │ ├── order.rs │ ├── player.rs │ ├── preparation.rs │ ├── sound.rs │ ├── sprite_folder.rs │ ├── team.rs │ ├── texture.rs │ ├── topping.rs │ └── ui.rs ├── ecs ├── Cargo.lock ├── Cargo.toml └── src │ ├── component.rs │ ├── component │ ├── animation.rs │ ├── background.rs │ ├── direction.rs │ ├── effect.rs │ ├── hitbox.rs │ ├── input.rs │ ├── interact.rs │ ├── interaction.rs │ ├── inventory_item.rs │ ├── layered.rs │ ├── pixel_perfect.rs │ ├── player.rs │ ├── score.rs │ ├── solid.rs │ ├── table.rs │ ├── ui.rs │ └── velocity.rs │ ├── controller.rs │ ├── frange.rs │ ├── lib.rs │ ├── system.rs │ └── system │ ├── animation.rs │ ├── autotile.rs │ ├── background_animation.rs │ ├── collision.rs │ ├── control.rs │ ├── generate.rs │ ├── input.rs │ ├── interact.rs │ ├── interaction.rs │ ├── inventory_render.rs │ ├── layer.rs │ ├── melt.rs │ ├── movement.rs │ ├── orders.rs │ ├── score.rs │ └── timer.rs ├── loader ├── Cargo.toml └── src │ ├── audio.rs │ ├── buttons.rs │ ├── data.rs │ ├── fonts.rs │ ├── item.rs │ ├── lib.rs │ ├── map.rs │ ├── player.rs │ └── ui.rs ├── state ├── Cargo.lock ├── Cargo.toml └── src │ ├── bundle.rs │ ├── freeplay.rs │ ├── game.rs │ ├── lib.rs │ └── load.rs └── util ├── Cargo.toml └── src ├── bg.rs ├── lib.rs ├── map.rs └── ui.rs /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | nk_ecs/target 3 | nk_data/target 4 | nk_loader/target 5 | nk_state/target 6 | nk_util/target 7 | **/*.rs.bk 8 | assets/texture/old 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # Based on the "trust" template v0.1.2 2 | # https://github.com/japaric/trust/tree/v0.1.2 3 | 4 | dist: trusty 5 | services: docker 6 | sudo: required 7 | 8 | language: rust 9 | 10 | rust: 11 | - stable 12 | - beta 13 | - nightly 14 | 15 | env: 16 | global: 17 | - PKG_CONFIG_ALLOW_CROSS=1 18 | - CRATE_NAME=rust-igmc-2018 19 | matrix: 20 | - TARGET=i686-unknown-linux-gnu 21 | - TARGET=x86_64-unknown-linux-gnu NO_ADD=1 22 | - TARGET=i686-pc-windows-gnu 23 | - TARGET=x86_64-pc-windows-gnu 24 | 25 | matrix: 26 | allow_failures: 27 | - rust: stable 28 | - rust: beta 29 | fast_finish: true 30 | 31 | before_cache: 32 | - chmod -R a+r $HOME/.cargo 33 | cache: cargo 34 | 35 | addons: 36 | apt: 37 | update: true 38 | packages: 39 | - pkg-config 40 | - build-essential 41 | - cmake 42 | - gcc-multilib 43 | - libasound2-dev 44 | - libsdl2-dev 45 | - libx11-xcb-dev 46 | - libssl-dev 47 | - libfreetype6-dev 48 | - libexpat1-dev 49 | - libxcb1-dev 50 | - mingw-w64 51 | 52 | before_install: 53 | - | 54 | if [ ${TRAVIS_OS_NAME} == "windows" ] 55 | then 56 | wget --no-check-certificate https://www.libsdl.org/release/SDL2-devel-2.0.8-VC.zip 57 | 7z x SDL2-devel-2.0.8-VC.zip 58 | cp SDL2-2.0.8/lib/x64/*.lib ${HOME}/.rustup/toolchains/${TRAVIS_RUST_VERSION}-x86_64-pc-windows-msvc/lib/rustlib/x86_64-pc-windows-msvc/lib 59 | cp SDL2-2.0.8/lib/x64/*.dll . 60 | rm SDL2-devel-2.0.8-VC.zip 61 | fi 62 | - set -e 63 | - rustup self update 64 | - if [ -z "$NO_ADD" ]; then rustup target add $TARGET; fi 65 | 66 | script: 67 | - cargo build --verbose --all --target $TARGET 68 | - cargo build --verbose --all --target $TARGET --release 69 | - cargo test --verbose --all --target $TARGET 70 | - cargo test --verbose --all --target $TARGET --release 71 | - cargo run --verbose --bin nk_tool --target $TARGET 72 | - cargo run --verbose --bin nk_tool --target $TARGET --release 73 | 74 | before_deploy: 75 | - sh ci/before_deploy.sh 76 | 77 | deploy: 78 | api_key: 79 | secure: "Vt4wqZ8n0cQqYXmxE+2FKEN6ZXdw9FZ/D+MYnJii17mF1G0lBGlw8Gl0C3Wf77arNIbQ9YYP6dxn/DyCAOMUCTT5y3sbdwJX3mBwLAFHtezM8VRMrIrTOaDBZ7h6mLuOeAc0rJ4SlFUtMzEl2zwaIoLctSrq9UV5ev7R43q6XaC1kLH/0cny2dG4xu+IgdlWpigxcK/ZuffjK+ZV/jy4Ly5KRiiwYNBY09vyhZfodMPCu9ekuaFGPHuRyeACwvLTusXHJjHUt4i2VJPO9tfsZ8tzzvxJDBsnNQfM+E48nRE+6jGIWq3BBMuZ4Pp7tN4aKUvWqgW0Sy9bPon8du6BbZX+j5LKFeOGhwuY5fsf+VMxpVkgLQla4jp/EUvx+/58aSBgcF6A5ng0gaunM8YbCq5DGs96T2qY8U3mRB1Sl3b9SgUk+M/OI688xZ5yzUIhgeFTQ3Ad8Jwnx40ZDBhBLCe1HqosBKxSLQ7oUGC9r1JsqfiieTNTD/ljP5oTt5GXLtRQ8OrMDKHsdHA0EJLaLr5VbKpy/odb4X/QxCUSNs0Ahs6hKLBAYRKLfbfFrjkCaewQu7UhKaB7dYs8s2r8YpmR2glzTWdoRXzlxPYS5YOqaTOvWP9JZhCi7wTlZKOcWkOL1Qs1J87IJm0EVC2KPu/UtwAT248LKTbTTCZyS3s=" 80 | file_glob: true 81 | file: $CRATE_NAME-$TRAVIS_TAG-$TARGET.* 82 | on: 83 | condition: $TRAVIS_RUST_VERSION = nightly 84 | tags: true 85 | provider: releases 86 | skip_cleanup: true 87 | 88 | branches: 89 | only: 90 | - /^v\d+\.\d+\.\d+.*$/ 91 | - master 92 | 93 | notifications: 94 | email: 95 | on_success: never 96 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-igmc-2018" 3 | description = "Game made for IGMC 2018 by MGDA" 4 | version = "0.3.0" 5 | authors = ["Tiago Nascimento "] 6 | edition = "2018" 7 | 8 | homepage = "https://gamedev.maringa.br/igmc-2018" 9 | documentation = "https://gamedev.maringa.br/igmc-2018/docs" 10 | repository = "https://github.com/maringa-gamedev/rust-igmc-2018" 11 | 12 | readme = "README.md" 13 | license = "AGPLv3" 14 | 15 | [features] 16 | nightly = ["amethyst/nightly"] 17 | 18 | [dependencies] 19 | nk_ecs = { path = "src/ecs/", version = "0.1.0" } 20 | nk_data = { path = "src/data/", version = "0.1.0" } 21 | nk_loader = { path = "src/loader/", version = "0.1.0" } 22 | nk_state = { path = "src/state/", version = "0.1.0" } 23 | nk_util = { path = "src/util/", version = "0.1.0" } 24 | amethyst = { git = "https://github.com/amethyst/amethyst.git" } 25 | serde = "1.0" 26 | serde_derive = "1.0" 27 | ron = "0.4" 28 | log = "0.4" 29 | rand = "0.5" 30 | font-kit = "0.1" 31 | gilrs = "0.6" 32 | nalgebra = "0.16" 33 | ncollide2d = "0.17" 34 | itertools = "0.7" 35 | either = "1.5" 36 | clap = "~2.32" 37 | image = "0.20" 38 | 39 | [[bin]] 40 | name = "nk_game" 41 | path = "src/bin/game.rs" 42 | 43 | [[bin]] 44 | name = "nk_tool" 45 | path = "src/bin/tool.rs" 46 | 47 | [workspace] 48 | members = ["src/ecs/", "src/data/", "src/loader/", "src/state/", "src/util/"] 49 | -------------------------------------------------------------------------------- /Cross.toml: -------------------------------------------------------------------------------- 1 | [build.env] 2 | passthrough = [ 3 | "PKG_CONFIG_ALLOW_CROSS", 4 | ] 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rust-igmc-2018 2 | [![Build Status](https://travis-ci.org/maringa-gamedev/rust-igmc-2018.svg?branch=master)](https://travis-ci.org/maringa-gamedev/rust-igmc-2018) 3 | [![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0) 4 | [![Rust: Nightly](https://img.shields.io/badge/rust-nightly-orange.svg)]() 5 | 6 | 7 | 8 | 9 | Projeto Naisu Kurimu feito em Rust com Amethyst para o Indie Game Making Contest 2018 10 | -------------------------------------------------------------------------------- /assets/data/flavors.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | [ 4 | // Classics 5 | FlavorDef ( 6 | index: 0, 7 | key: "vanilla", 8 | class: Classic, 9 | base_worth: 100.0, 10 | effect: [ 11 | OrderTotalScore(Fixed(1.2)), 12 | ], 13 | condition: [ 14 | CombinedWithClass([Classic]), 15 | ], 16 | weights: (5, 5, 5, 5, 5, 5, 5), 17 | ), 18 | FlavorDef ( 19 | index: 1, 20 | key: "chocolate", 21 | class: Classic, 22 | base_worth: 125.0, 23 | effect: [ 24 | OrderMeltTimer(Fixed(1.125)), 25 | ], 26 | condition: [], 27 | weights: (5, 5, 5, 5, 5, 5, 5), 28 | ), 29 | FlavorDef ( 30 | index: 2, 31 | key: "strawberry", 32 | class: Classic, 33 | base_worth: 75.0, 34 | effect: [ 35 | OrderMeltTimer(Fixed(0.875)), 36 | ], 37 | condition: [], 38 | weights: (5, 5, 5, 5, 5, 5, 5), 39 | ), 40 | FlavorDef ( 41 | index: 3, 42 | key: "neapolitan", 43 | class: Classic, 44 | base_worth: 300.0, 45 | effect: [], 46 | condition: [], 47 | weights: (5, 5, 5, 5, 5, 5, 5), 48 | ), 49 | FlavorDef ( 50 | index: 4, 51 | key: "cookie_dough", 52 | class: Classic, 53 | base_worth: 50.0, 54 | effect: [], 55 | condition: [], 56 | weights: (5, 5, 5, 5, 5, 5, 5), 57 | ), 58 | FlavorDef ( 59 | index: 5, 60 | key: "cookies_cream", 61 | class: Classic, 62 | base_worth: 150.0, 63 | effect: [], 64 | condition: [], 65 | weights: (5, 5, 5, 5, 5, 5, 5), 66 | ), 67 | FlavorDef ( 68 | index: 6, 69 | key: "rocky_road", 70 | class: Classic, 71 | base_worth: 160.0, 72 | effect: [ 73 | Speed(Carrier, Fixed(0.75), Indeterminate), 74 | ], 75 | condition: [], 76 | weights: (5, 5, 5, 5, 5, 5, 5), 77 | ), 78 | FlavorDef ( 79 | index: 7, 80 | key: "coffee", 81 | class: Classic, 82 | base_worth: 40.0, 83 | effect: [ 84 | Speed(Carrier, Fixed(1.25), Indeterminate), 85 | ], 86 | condition: [], 87 | weights: (5, 5, 5, 5, 5, 5, 5), 88 | ), 89 | FlavorDef ( 90 | index: 8, 91 | key: "mint_chocolate", 92 | class: Classic, 93 | base_worth: 90.0, 94 | effect: [], 95 | condition: [], 96 | weights: (5, 5, 5, 5, 5, 5, 5), 97 | ), 98 | FlavorDef ( 99 | index: 9, 100 | key: "pistachio", 101 | class: Classic, 102 | base_worth: 999.0, 103 | effect: [], 104 | condition: [], 105 | weights: (5, 5, 5, 5, 5, 5, 5), 106 | ), 107 | 108 | // Sherberts 109 | FlavorDef ( 110 | index: 10, 111 | key: "orange", 112 | class: Sherbert, 113 | base_worth: 90.0, 114 | effect: [], 115 | condition: [], 116 | weights: (5, 5, 5, 5, 5, 5, 5), 117 | ), 118 | FlavorDef ( 119 | index: 11, 120 | key: "cherry", 121 | class: Sherbert, 122 | base_worth: 80.0, 123 | effect: [], 124 | condition: [], 125 | weights: (5, 5, 5, 5, 5, 5, 5), 126 | ), 127 | FlavorDef ( 128 | index: 12, 129 | key: "blue_raspberry", 130 | class: Sherbert, 131 | base_worth: 120.0, 132 | effect: [], 133 | condition: [], 134 | weights: (5, 5, 5, 5, 5, 5, 5), 135 | ), 136 | FlavorDef ( 137 | index: 13, 138 | key: "blackberry", 139 | class: Sherbert, 140 | base_worth: 60.0, 141 | effect: [], 142 | condition: [], 143 | weights: (5, 5, 5, 5, 5, 5, 5), 144 | ), 145 | FlavorDef ( 146 | index: 14, 147 | key: "rainbow", 148 | class: Sherbert, 149 | base_worth: 360.0, 150 | effect: [], 151 | condition: [], 152 | weights: (5, 5, 5, 5, 5, 5, 5), 153 | ), 154 | FlavorDef ( 155 | index: 15, 156 | key: "lemon", 157 | class: Sherbert, 158 | base_worth: 999.0, 159 | effect: [], 160 | condition: [], 161 | weights: (5, 5, 5, 5, 5, 5, 5), 162 | ), 163 | 164 | // Specials 165 | FlavorDef ( 166 | index: 16, 167 | key: "dark_matter", 168 | class: Special, 169 | base_worth: 125.0, 170 | effect: [], 171 | condition: [], 172 | weights: (5, 5, 5, 5, 5, 5, 5), 173 | ), 174 | FlavorDef ( 175 | index: 17, 176 | key: "jalapeno", 177 | class: Special, 178 | base_worth: 150.0, 179 | effect: [], 180 | condition: [], 181 | weights: (5, 5, 5, 5, 5, 5, 5), 182 | ), 183 | FlavorDef ( 184 | index: 18, 185 | key: "snowball", 186 | class: Special, 187 | base_worth: 50.0, 188 | effect: [], 189 | condition: [], 190 | weights: (5, 5, 5, 5, 5, 5, 5), 191 | ), 192 | FlavorDef ( 193 | index: 19, 194 | key: "ectoplasm", 195 | class: Special, 196 | base_worth: 75.0, 197 | effect: [], 198 | condition: [], 199 | weights: (5, 5, 5, 5, 5, 5, 5), 200 | ), 201 | FlavorDef ( 202 | index: 20, 203 | key: "bubblegum", 204 | class: Special, 205 | base_worth: 130.0, 206 | effect: [], 207 | condition: [], 208 | weights: (5, 5, 5, 5, 5, 5, 5), 209 | ), 210 | FlavorDef ( 211 | index: 21, 212 | key: "balloon", 213 | class: Special, 214 | base_worth: 110.0, 215 | effect: [], 216 | condition: [], 217 | weights: (5, 5, 5, 5, 5, 5, 5), 218 | ), 219 | FlavorDef ( 220 | index: 22, 221 | key: "god", 222 | class: Special, 223 | base_worth: 100.0, 224 | effect: [], 225 | condition: [], 226 | weights: (5, 5, 5, 5, 5, 5, 5), 227 | ), 228 | FlavorDef ( 229 | index: 23, 230 | key: "spumoni", 231 | class: Special, 232 | base_worth: 0.0, 233 | effect: [], 234 | condition: [], 235 | weights: (5, 5, 5, 5, 5, 5, 5), 236 | ), 237 | FlavorDef ( 238 | index: 24, 239 | key: "licensed", 240 | class: Special, 241 | base_worth: 300.0, 242 | effect: [], 243 | condition: [], 244 | weights: (5, 5, 5, 5, 5, 5, 5), 245 | ), 246 | FlavorDef ( 247 | index: 25, 248 | key: "alaska", 249 | class: Special, 250 | base_worth: 200.0, 251 | effect: [], 252 | condition: [], 253 | weights: (5, 5, 5, 5, 5, 5, 5), 254 | ), 255 | FlavorDef ( 256 | index: 26, 257 | key: "green_tea", 258 | class: Special, 259 | base_worth: 80.0, 260 | effect: [], 261 | condition: [], 262 | weights: (5, 5, 5, 5, 5, 5, 5), 263 | ), 264 | FlavorDef ( 265 | index: 27, 266 | key: "tiger_tail", 267 | class: Special, 268 | base_worth: 125.0, 269 | effect: [], 270 | condition: [], 271 | weights: (5, 5, 5, 5, 5, 5, 5), 272 | ), 273 | FlavorDef ( 274 | index: 28, 275 | key: "tutti_frutti", 276 | class: Special, 277 | base_worth: 150.0, 278 | effect: [], 279 | condition: [], 280 | weights: (5, 5, 5, 5, 5, 5, 5), 281 | ), 282 | FlavorDef ( 283 | index: 29, 284 | key: "rum_raisin", 285 | class: Special, 286 | base_worth: 150.0, 287 | effect: [], 288 | condition: [], 289 | weights: (5, 5, 5, 5, 5, 5, 5), 290 | ), 291 | FlavorDef ( 292 | index: 30, 293 | key: "creamsicle", 294 | class: Special, 295 | base_worth: 500.0, 296 | effect: [], 297 | condition: [], 298 | weights: (5, 5, 5, 5, 5, 5, 5), 299 | ), 300 | FlavorDef ( 301 | index: 31, 302 | key: "anti_scoop", 303 | class: Special, 304 | base_worth: 999.0, 305 | effect: [], 306 | condition: [], 307 | weights: (5, 5, 5, 5, 5, 5, 5), 308 | ), 309 | ] 310 | -------------------------------------------------------------------------------- /assets/data/hissatsu.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | [ 4 | HissatsuDef ( 5 | index: 0, 6 | key: "of_ice_and_men", 7 | ), 8 | HissatsuDef ( 9 | index: 1, 10 | key: "jimmy_jam", 11 | ), 12 | HissatsuDef ( 13 | index: 2, 14 | key: "scoop_dreams", 15 | ), 16 | HissatsuDef ( 17 | index: 3, 18 | key: "the_inside_scoop", 19 | ), 20 | HissatsuDef ( 21 | index: 4, 22 | key: "ice_cream_of_the_crop", 23 | ), 24 | HissatsuDef ( 25 | index: 5, 26 | key: "cherry_on_top", 27 | ), 28 | HissatsuDef ( 29 | index: 6, 30 | key: "brain_freeze", 31 | ), 32 | HissatsuDef ( 33 | index: 7, 34 | key: "scoop_there_it_is", 35 | ), 36 | HissatsuDef ( 37 | index: 8, 38 | key: "the_banana_split", 39 | ), 40 | HissatsuDef ( 41 | index: 9, 42 | key: "sorbet_shuffle", 43 | ), 44 | HissatsuDef ( 45 | index: 10, 46 | key: "hokuto_no_scoop", 47 | ), 48 | HissatsuDef ( 49 | index: 11, 50 | key: "kanpa_ice", 51 | ), 52 | HissatsuDef ( 53 | index: 12, 54 | key: "ay_crumble", 55 | ), 56 | HissatsuDef ( 57 | index: 13, 58 | key: "all_ten_thousand_tastebuds", 59 | ), 60 | HissatsuDef ( 61 | index: 14, 62 | key: "chaos_conetrol", 63 | ), 64 | HissatsuDef ( 65 | index: 15, 66 | key: "untoppable", 67 | ), 68 | HissatsuDef ( 69 | index: 16, 70 | key: "i_walk_a_rocky_road", 71 | ), 72 | HissatsuDef ( 73 | index: 17, 74 | key: "the_final_strawberries", 75 | ), 76 | HissatsuDef ( 77 | index: 18, 78 | key: "carry_a_big_stick", 79 | ), 80 | HissatsuDef ( 81 | index: 19, 82 | key: "whip_it", 83 | ), 84 | ] 85 | -------------------------------------------------------------------------------- /assets/data/houses.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | [ 4 | HouseDef ( 5 | index: 0, 6 | key: "vanilla", 7 | ), 8 | HouseDef ( 9 | index: 1, 10 | key: "chocolate", 11 | ), 12 | HouseDef ( 13 | index: 2, 14 | key: "strawberry", 15 | ), 16 | ] 17 | -------------------------------------------------------------------------------- /assets/data/palette.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | ( 4 | //(0xFF, 0x00, 0x00, 0x00), // Black 5 | //(0xFF, 0x5f, 0x57, 0x50), // Dark Gray 6 | //(0xFF, 0x82, 0x75, 0x9a), // Slate Gray 7 | //(0xFF, 0xc0, 0xc1, 0xc5), // Light Gray 8 | //(0xFF, 0xff, 0xf0, 0xe7), // White 9 | //(0xFF, 0xff, 0x76, 0xa6), // Pink 10 | //(0xFF, 0xa9, 0x52, 0x38), // Brown 11 | //(0xFF, 0xff, 0xca, 0xa8), // Skin Pink? 12 | 13 | ("captain_left", 0xFF, 0xff, 0xa1, 0x08), // Orange 14 | ("server_left", 0xFF, 0x7d, 0x29, 0x53), // Purple 15 | ("scooper_one_left", 0xFF, 0x00, 0x85, 0x51), // Green 16 | ("scooper_two_left", 0xFF, 0x22, 0x2e, 0x53), // Blue 17 | 18 | ("captain_right", 0xFF, 0xfe, 0xeb, 0x2c), // Yellow 19 | ("server_right", 0xFF, 0xff, 0x07, 0x4e), // Magenta 20 | ("scooper_one_right", 0xFF, 0x00, 0xe3, 0x39), // Lime 21 | ("scooper_two_right", 0xFF, 0x2c, 0xab, 0xfe), // Cyan 22 | ) 23 | -------------------------------------------------------------------------------- /assets/data/players.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | [ 4 | PlayerDef ( 5 | index: 0, 6 | name: "james_sicle", 7 | primary_flavor: 0, 8 | secondary_flavors: [ 1, 2, ], 9 | preparations: [ 0, 2, ], 10 | toppings: [ 0, ], 11 | hissatsu: [ 1, 2, ], // Dual Scoop Dreams, True Scoop Dreams 12 | team: 0, 13 | house: 0, 14 | ), 15 | PlayerDef ( 16 | index: 2, 17 | name: "alan_bryers", 18 | primary_flavor: 4, 19 | secondary_flavors: [ 0, ], 20 | preparations: [ 0, 1, ], 21 | toppings: [ 3, 4, 9, ], 22 | hissatsu: [ 15, ], 23 | team: 0, 24 | house: 0, 25 | ), 26 | PlayerDef ( 27 | index: 3, 28 | name: "roger_rocky_road", 29 | primary_flavor: 1, 30 | secondary_flavors: [ 6, ], 31 | preparations: [ 0, 4, ], 32 | toppings: [ 3, ], 33 | hissatsu: [ 16, ], 34 | team: 0, 35 | house: 0, 36 | ), 37 | PlayerDef ( 38 | index: 4, 39 | name: "robin_klondike", 40 | primary_flavor: 2, 41 | secondary_flavors: [], 42 | preparations: [ 6, ], 43 | toppings: [ 2, 6, 10, ], 44 | hissatsu: [ 17, ], 45 | team: 0, 46 | house: 0, 47 | ), 48 | PlayerDef ( 49 | index: 5, 50 | name: "cheri_bethilloun", 51 | primary_flavor: 11, 52 | secondary_flavors: [ 2, ], 53 | preparations: [ 6, ], 54 | toppings: [ 9, ], 55 | hissatsu: [ 5, ], 56 | Team 57 | house: 2, 58 | ), 59 | PlayerDef ( 60 | index: 6, 61 | name: "hugh_sorbet", 62 | primary_flavor: 11, 63 | secondary_flavors: [ 12, 15, ], 64 | preparations: [ 1, 9, 10, 11, ], 65 | toppings: [], 66 | hissatsu: [ 9, ], 67 | team: 1, 68 | house: 1, 69 | ), 70 | PlayerDef ( 71 | index: 7, 72 | name: "benjamin", 73 | primary_flavor: 15, 74 | secondary_flavors: [ 12, ], 75 | preparations: [ 0, 7, 8, ], 76 | toppings: [ 12, ], 77 | hissatsu: [ 7, ], 78 | team: 1, 79 | house: 1, 80 | ), 81 | PlayerDef ( 82 | index: 8, 83 | name: "gerald", 84 | primary_flavor: 12, 85 | secondary_flavors: [ 15, ], 86 | preparations: [ 0, 7, 8, ], 87 | toppings: [ 10, ], 88 | hissatsu: [ 7, ], 89 | team: 1, 90 | house: 1, 91 | ), 92 | PlayerDef ( 93 | index: 9, 94 | name: "dot_dapper", 95 | primary_flavor: 13, 96 | secondary_flavors: [ 11, ], 97 | preparations: [ 0, 7, 8, ], 98 | toppings: [ 11, ], 99 | hissatsu: [ 7, ], 100 | team: 1, 101 | house: 1, 102 | ), 103 | PlayerDef ( 104 | index: 10, 105 | name: "prof_parfait", 106 | primary_flavor: 0, 107 | secondary_flavors: [], 108 | preparations: [ 1, ], 109 | toppings: [ 7, ], 110 | hissatsu: [ 19, ], 111 | team: None, 112 | house: 0, 113 | ), 114 | PlayerDef ( 115 | index: 11, 116 | name: "pop_sicle", 117 | primary_flavor: 18, 118 | secondary_flavors: [ 15, ], 119 | preparations: [ 0, ], 120 | toppings: [], 121 | hissatsu: [ 18, ], 122 | team: 2, 123 | house: None, 124 | ), 125 | ] 126 | -------------------------------------------------------------------------------- /assets/data/teams.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | [ 4 | TeamDef ( 5 | index: 0, 6 | key: "rockys_road_to_victory", 7 | ), 8 | TeamDef ( 9 | index: 1, 10 | key: "absorbet", 11 | ), 12 | TeamDef ( 13 | index: 2, 14 | key: "pappys_frozen_treats_and_sweets", 15 | ), 16 | ] 17 | -------------------------------------------------------------------------------- /assets/data/toppings.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | [ 4 | ToppingDef ( 5 | index: 0, 6 | key: "sprinkles", 7 | worth: 5.0, 8 | effect: [ 9 | BlockSpecial(Random(0.5, 0.75)), 10 | ], 11 | offsets: ( 12 | one: (0.0, 0.0), 13 | two: (0.0, 0.0), 14 | three: (0.0, 0.0), 15 | four: (0.0, 0.0), 16 | ), 17 | ), 18 | ToppingDef ( 19 | index: 1, 20 | key: "chocolate_sprinkles", 21 | worth: 0.0, 22 | effect: [ 23 | Speed(Team(Adversary, WholeTeam), Fixed(0.0), Fixed(2.5)), 24 | ], 25 | offsets: ( 26 | one: (0.0, 0.0), 27 | two: (0.0, 0.0), 28 | three: (0.0, 0.0), 29 | four: (0.0, 0.0), 30 | ), 31 | ), 32 | ToppingDef ( 33 | index: 2, 34 | key: "wafer_sticks", 35 | worth: 5.0, 36 | effect: [ 37 | PowerMeterFlatBonus(Partner, Fixed(0.10)), 38 | PowerMeterFlatBonus(Adversary, Fixed(-0.10)), 39 | ], 40 | offsets: ( 41 | one: (0.0, 0.0), 42 | two: (0.0, 0.0), 43 | three: (0.0, 0.0), 44 | four: (0.0, 0.0), 45 | ), 46 | ), 47 | ToppingDef ( 48 | index: 3, 49 | key: "nuts", 50 | worth: 5.0, 51 | effect: [ 52 | Speed(Team(Adversary, WholeTeam), Fixed(0.9), Fixed(2.5)), 53 | ], 54 | offsets: ( 55 | one: (0.0, 0.0), 56 | two: (0.0, 0.0), 57 | three: (0.0, 0.0), 58 | four: (0.0, 0.0), 59 | ), 60 | ), 61 | ToppingDef ( 62 | index: 4, 63 | key: "chocolate_syrup", 64 | worth: 10.0, 65 | effect: [ 66 | PowerMeterFlatBonus(Adversary, Fixed(-0.5)), 67 | ], 68 | offsets: ( 69 | one: (0.0, 0.0), 70 | two: (0.0, 0.0), 71 | three: (0.0, 0.0), 72 | four: (0.0, 0.0), 73 | ), 74 | ), 75 | ToppingDef ( 76 | index: 5, 77 | key: "caramel_syrup", 78 | worth: 10.0, 79 | effect: [ 80 | PowerMeterFlatBonus(Partner, Fixed(0.5)), 81 | ], 82 | offsets: ( 83 | one: (0.0, 0.0), 84 | two: (0.0, 0.0), 85 | three: (0.0, 0.0), 86 | four: (0.0, 0.0), 87 | ), 88 | ), 89 | ToppingDef ( 90 | index: 6, 91 | key: "strawberry_syrup", 92 | worth: 10.0, 93 | effect: [ 94 | GlobalMeltSpeed(Partner, Fixed(0.9)), 95 | GlobalMeltSpeed(Adversary, Fixed(0.9)), 96 | ], 97 | offsets: ( 98 | one: (0.0, 0.0), 99 | two: (0.0, 0.0), 100 | three: (0.0, 0.0), 101 | four: (0.0, 0.0), 102 | ), 103 | ), 104 | ToppingDef ( 105 | index: 7, 106 | key: "whipped_cream", 107 | worth: 5.0, 108 | effect: [ 109 | Screen(CreamClouds, Adversary, Fixed(5.0)), 110 | ], 111 | offsets: ( 112 | one: (0.0, 0.0), 113 | two: (0.0, 0.0), 114 | three: (0.0, 0.0), 115 | four: (0.0, 0.0), 116 | ), 117 | ), 118 | ToppingDef ( 119 | index: 8, 120 | key: "gummy_candy", 121 | worth: 5.0, 122 | effect: [ 123 | Screen(Dizzy, Adversary, Fixed(5.0)), 124 | ], 125 | offsets: ( 126 | one: (0.0, 0.0), 127 | two: (0.0, 0.0), 128 | three: (0.0, 0.0), 129 | four: (0.0, 0.0), 130 | ), 131 | ), 132 | ToppingDef ( 133 | index: 9, 134 | key: "cherries", 135 | worth: 15.0, 136 | effect: [], 137 | offsets: ( 138 | one: (0.0, 0.0), 139 | two: (0.0, 0.0), 140 | three: (0.0, 0.0), 141 | four: (0.0, 0.0), 142 | ), 143 | ), 144 | ToppingDef ( 145 | index: 10, 146 | key: "strawberries", 147 | worth: 10.0, 148 | effect: [ 149 | Screen(Pulse(Red), Adversary, Fixed(5.0)), 150 | ], 151 | offsets: ( 152 | one: (0.0, 0.0), 153 | two: (0.0, 0.0), 154 | three: (0.0, 0.0), 155 | four: (0.0, 0.0), 156 | ), 157 | ), 158 | ToppingDef ( 159 | index: 11, 160 | key: "kiwi", 161 | worth: 10.0, 162 | effect: [ 163 | Screen(Pulse(Green), Adversary, Fixed(5.0)), 164 | ], 165 | offsets: ( 166 | one: (0.0, 0.0), 167 | two: (0.0, 0.0), 168 | three: (0.0, 0.0), 169 | four: (0.0, 0.0), 170 | ), 171 | ), 172 | ToppingDef ( 173 | index: 12, 174 | key: "bananas", 175 | worth: 10.0, 176 | effect: [ 177 | Screen(Pulse(Yellow), Adversary, Fixed(5.0)), 178 | ], 179 | offsets: ( 180 | one: (0.0, 0.0), 181 | two: (0.0, 0.0), 182 | three: (0.0, 0.0), 183 | four: (0.0, 0.0), 184 | ), 185 | ), 186 | ToppingDef ( 187 | index: 13, 188 | key: "cookie_crumbles", 189 | worth: 0.0, 190 | effect: [], 191 | offsets: ( 192 | one: (0.0, 0.0), 193 | two: (0.0, 0.0), 194 | three: (0.0, 0.0), 195 | four: (0.0, 0.0), 196 | ), 197 | ), 198 | ] 199 | -------------------------------------------------------------------------------- /assets/font/kenney-blocks.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/font/kenney-blocks.ttf -------------------------------------------------------------------------------- /assets/font/kenney-high-square.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/font/kenney-high-square.ttf -------------------------------------------------------------------------------- /assets/i18n/en_us.ron: -------------------------------------------------------------------------------- 1 | { 2 | "vanilla_title": "Vanilla", 3 | "vanilla_desc": "Wildcard: Can combo with any other Classic flavor for a minor score bonus (1.2x).", 4 | 5 | "chocolate_title": "Chocolate", 6 | "chocolate_desc": "Slightly increases order melt time.", 7 | 8 | "strawberry_title": "Strawberry", 9 | "strawberry_desc": "Slightly decreases order melt time.", 10 | 11 | "neapolitan_title": "Neapolitan", 12 | "neapolitan_desc": "Cannot be brought in the loadout, only appears through the combination of Vanilla, Chocolate and Strawberry.", 13 | 14 | "cookie_dough_title": "Cookie Dough", 15 | "cookie_dough_desc": "Decreases order melt time", 16 | 17 | "cookies_cream_title": "Cookies and Cream", 18 | "cookies_cream_desc": "Increases order melt time", 19 | 20 | "rocky_road_title": "Rocky Road", 21 | "rocky_road_desc": "Decreases player movement speed", 22 | 23 | "coffee_title": "Coffee", 24 | "coffee_desc": "Increases Player movement speed", 25 | 26 | "mint_chocolate_title": "Mint Chocolate Chip", 27 | "mint_chocolate_desc": "Grants a small bonus to special meter", 28 | 29 | "pistachio_title": "Pistachio", 30 | "pistachio_desc": "Grants a random classic effect.", 31 | 32 | "orange_title": "Orange Sherbert", 33 | "orange_desc": "Increases scoop score when ordered with toppings (1.2x)", 34 | 35 | "cherry_title": "Cherry Sherbert", 36 | "cherry_desc": "Leaves a red trail that speeds up allies", 37 | 38 | "blue_raspberry_title": "Blue Raspberry Sherbert", 39 | "blue_raspberry_desc": "Leaves a blue trail that slows down allies", 40 | 41 | "blackberry_title": "Blackberry Sherbet", 42 | "blackberry_desc": "Negates the effect of other scoops it’s mixed with", 43 | 44 | "rainbow_title": "Rainbow Sherbert", 45 | "rainbow_desc": "Cannot be brought in the loadout, only appears through the combination of Lemon, Blue Raspberry, and Cherry Sherbert Scoops.", 46 | 47 | "lemon_title": "Lemon Sorbet", 48 | "lemon_desc": " Grants a random sherbet effect.", 49 | 50 | "dark_matter_title": "Dark Chocolate Matter", 51 | "dark_matter_desc": "Creates a gravitational pull around the player", 52 | 53 | "jalapeno_title": "Jalapeño Gelato", 54 | "jalapeno_desc": "Player continuously walks forward even when not pressing any movement keys", 55 | 56 | "snowball_title": "Snowball Daiquiri Ice", 57 | "snowball_desc": "Greatly reduces melt time", 58 | 59 | "ectoplasm_title": "Ectoplasm Swirl", 60 | "ectoplasm_desc": "Players becomes intangible", 61 | 62 | "bubblegum_title": "Bubblegum", 63 | "bubblegum_desc": "When team members collide, they stick to each other for a short period of time.", 64 | 65 | "balloon_title": "Balloon", 66 | "balloon_desc": "Adds knockback to teammates that bump into each other", 67 | 68 | "god_title": "God’s Scoop", 69 | "god_desc": "Negates the effect of other scoops it’s mixed with", 70 | 71 | "spumoni_title": "Spumoni", 72 | "spumoni_desc": "Cannot be brought in the loadout, only appears through the combination of Cherry, Vanilla, and Pistachio. Instantly fills the special meter to max for the Player.", 73 | 74 | "licensed_title": "Licensed Character", 75 | "licensed_desc": "If touched by another player, explodes destroying itself and the order it’s in. Can only be ordered in a single Scoop without toppings. Massive Special Meter Bonus when served.", 76 | 77 | "alaska_title": "Baked Alaska Crunch", 78 | "alaska_desc": "Increases melt timer for all orders until served", 79 | 80 | "green_tea_title": "Green Tea", 81 | "green_tea_desc": "Increases “Green Tea” scoop order frequency", 82 | 83 | "tiger_tail_title": "Tiger Tail Stripe", 84 | "tiger_tail_desc": "Makes the player invisible (not the order)", 85 | 86 | "tutti_frutti_title": "Tutti-Frutti", 87 | "tutti_frutti_desc": "Super bright, making it harder to see", 88 | 89 | "rum_raisin_title": "Rum Raisin", 90 | "rum_raisin_desc": "Inverted colors, making it harder to see", 91 | 92 | "creamsicle_title": "Creamsicle", 93 | "creamsicle_desc": "Can only be ordered in a single Scoop without toppings.", 94 | 95 | "anti_scoop_title": "Anti Scoop", 96 | "anti_scoop_desc": "Grants a random special effect.", 97 | } 98 | -------------------------------------------------------------------------------- /assets/map/0000.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | 3 | MapDefinition ( 4 | tables: [], 5 | spawns: [ 6 | (2.0, 8.0), 7 | (2.0, 1.0), 8 | (8.0, 1.0), 9 | (8.0, 8.0), 10 | ], 11 | ) 12 | -------------------------------------------------------------------------------- /assets/map/0001.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | 3 | MapDefinition ( 4 | tables: [ 5 | (0.0, 0.0, Flavor(Priority(0)), VerticalRight), 6 | (0.0, 2.0, Empty, HorizontalBottom), 7 | (0.0, 3.0, Flavor(Priority(1)), VerticalRight), 8 | (0.0, 5.0, Empty, HorizontalBottom), 9 | (0.0, 6.0, Flavor(Priority(2)), VerticalRight), 10 | (0.0, 8.0, Empty, HorizontalBottom), 11 | (0.0, 9.0, Flavor(Priority(3)), VerticalRight), 12 | 13 | (9.0, 0.0, Empty, HorizontalBottom), 14 | (9.0, 1.0, Delivery, VerticalLeft), 15 | (9.0, 3.0, Empty, HorizontalBottom), 16 | (9.0, 4.0, Empty, HorizontalBottom), 17 | (9.0, 5.0, Empty, HorizontalBottom), 18 | (9.0, 6.0, Preparation(Priority(0)), VerticalLeft), 19 | (9.0, 8.0, Preparation(Priority(1)), VerticalLeft), 20 | (9.0, 10.0, Empty, HorizontalBottom), 21 | 22 | (3.0, 0.0, Empty, HorizontalBottom), 23 | (4.0, 0.0, Flavor(Priority(4)), HorizontalTop), 24 | (6.0, 0.0, Empty, HorizontalBottom), 25 | (7.0, 0.0, Flavor(Priority(5)), HorizontalTop), 26 | 27 | (3.0, 3.0, Empty, HorizontalBottom), 28 | (4.0, 3.0, Flavor(Priority(6)), HorizontalBottom), 29 | (7.0, 3.0, Flavor(Priority(7)), HorizontalBottom), 30 | 31 | (3.0, 6.0, Empty, HorizontalBottom), 32 | (3.0, 7.0, Empty, HorizontalBottom), 33 | (4.0, 6.0, Topping(Priority(0)), HorizontalBottom), 34 | (4.0, 7.0, Topping(Priority(1)), HorizontalTop), 35 | (6.0, 6.0, Topping(Priority(2)), VerticalRight), 36 | 37 | (3.0, 10.0, Topping(Priority(3)), HorizontalBottom), 38 | (5.0, 10.0, Preparation(Priority(2)), HorizontalBottom), 39 | (7.0, 10.0, Preparation(Priority(3)), HorizontalBottom), 40 | ], 41 | spawns: [ 42 | (2.0, 8.0), 43 | (2.0, 4.0), 44 | (8.0, 4.0), 45 | (8.0, 8.0), 46 | ], 47 | ) 48 | -------------------------------------------------------------------------------- /assets/map/0002.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | 3 | MapDefinition ( 4 | tables: [ 5 | (0.0, 0.0, Flavor(Priority(0)), VerticalRight), 6 | (0.0, 2.0, Flavor(Priority(1)), VerticalRight), 7 | (3.0, 0.0, Flavor(Priority(2)), VerticalLeft), 8 | (3.0, 2.0, Flavor(Priority(3)), VerticalLeft), 9 | 10 | (0.0, 10.0, Flavor(Priority(4)), HorizontalBottom), 11 | (2.0, 10.0, Flavor(Priority(5)), HorizontalBottom), 12 | (5.0, 3.0, Flavor(Priority(6)), HorizontalBottom), 13 | (9.0, 1.0, Flavor(Priority(7)), VerticalLeft), 14 | 15 | (5.0, 10.0, Preparation(Priority(0)), HorizontalBottom), 16 | (7.0, 10.0, Preparation(Priority(1)), HorizontalBottom), 17 | (9.0, 6.0, Preparation(Priority(2)), VerticalLeft), 18 | (9.0, 8.0, Preparation(Priority(3)), VerticalLeft), 19 | 20 | (3.0, 6.0, Topping(Priority(0)), HorizontalBottom), 21 | (4.0, 7.0, Topping(Priority(1)), HorizontalTop), 22 | (2.0, 6.0, Topping(Priority(2)), VerticalLeft), 23 | (6.0, 6.0, Topping(Priority(3)), VerticalRight), 24 | 25 | (5.0, 0.0, Delivery, HorizontalTop), 26 | 27 | (4.0, 0.0, Empty, HorizontalBottom), 28 | (7.0, 0.0, Empty, HorizontalBottom), 29 | (8.0, 0.0, Empty, HorizontalBottom), 30 | (9.0, 0.0, Empty, HorizontalBottom), 31 | 32 | (4.0, 3.0, Empty, HorizontalBottom), 33 | (9.0, 3.0, Empty, HorizontalBottom), 34 | 35 | (9.0, 4.0, Empty, HorizontalBottom), 36 | (9.0, 5.0, Empty, HorizontalBottom), 37 | 38 | (3.0, 7.0, Empty, HorizontalBottom), 39 | (5.0, 6.0, Empty, HorizontalBottom), 40 | 41 | (4.0, 10.0, Empty, HorizontalBottom), 42 | (9.0, 10.0, Empty, HorizontalBottom), 43 | ], 44 | spawns: [ 45 | (1.0, 8.0), 46 | (1.0, 4.0), 47 | (8.0, 4.0), 48 | (8.0, 8.0), 49 | ], 50 | ) 51 | -------------------------------------------------------------------------------- /assets/map/0003.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | 3 | MapDefinition ( 4 | tables: [ 5 | (0.0, 1.0, Flavor(Priority(0)), VerticalRight), 6 | (0.0, 3.0, Flavor(Priority(1)), VerticalRight), 7 | (3.0, 1.0, Flavor(Priority(2)), VerticalLeft), 8 | (3.0, 3.0, Flavor(Priority(3)), VerticalLeft), 9 | 10 | (6.0, 1.0, Flavor(Priority(4)), VerticalRight), 11 | (6.0, 3.0, Flavor(Priority(5)), VerticalRight), 12 | (9.0, 1.0, Flavor(Priority(6)), VerticalLeft), 13 | (9.0, 3.0, Flavor(Priority(7)), VerticalLeft), 14 | 15 | (0.0, 8.0, Preparation(Priority(0)), VerticalLeft), 16 | (9.0, 8.0, Preparation(Priority(1)), VerticalRight), 17 | (1.0, 10.0, Preparation(Priority(2)), HorizontalBottom), 18 | (7.0, 10.0, Preparation(Priority(3)), HorizontalBottom), 19 | 20 | (3.0, 8.0, Topping(Priority(0)), VerticalRight), 21 | (6.0, 8.0, Topping(Priority(1)), VerticalLeft), 22 | (0.0, 6.0, Topping(Priority(2)), VerticalLeft), 23 | (9.0, 6.0, Topping(Priority(3)), VerticalRight), 24 | 25 | (1.0, 0.0, Delivery, HorizontalTop), 26 | (7.0, 0.0, Delivery, HorizontalTop), 27 | 28 | (0.0, 0.0, Empty, HorizontalBottom), 29 | (3.0, 0.0, Empty, HorizontalBottom), 30 | (6.0, 0.0, Empty, HorizontalBottom), 31 | (9.0, 0.0, Empty, HorizontalBottom), 32 | 33 | (0.0, 10.0, Empty, HorizontalBottom), 34 | (3.0, 10.0, Empty, HorizontalBottom), 35 | (6.0, 10.0, Empty, HorizontalBottom), 36 | (9.0, 10.0, Empty, HorizontalBottom), 37 | 38 | (4.0, 0.0, Empty, HorizontalBottom), 39 | (4.0, 1.0, Empty, HorizontalBottom), 40 | (4.0, 2.0, Empty, HorizontalBottom), 41 | (4.0, 3.0, Empty, HorizontalBottom), 42 | (4.0, 4.0, Empty, HorizontalBottom), 43 | (4.0, 8.0, Empty, HorizontalBottom), 44 | (4.0, 9.0, Empty, HorizontalBottom), 45 | (4.0, 10.0, Empty, HorizontalBottom), 46 | 47 | (5.0, 0.0, Empty, HorizontalBottom), 48 | (5.0, 1.0, Empty, HorizontalBottom), 49 | (5.0, 2.0, Empty, HorizontalBottom), 50 | (5.0, 3.0, Empty, HorizontalBottom), 51 | (5.0, 4.0, Empty, HorizontalBottom), 52 | (5.0, 8.0, Empty, HorizontalBottom), 53 | (5.0, 9.0, Empty, HorizontalBottom), 54 | (5.0, 10.0, Empty, HorizontalBottom), 55 | 56 | (0.0, 5.0, Empty, HorizontalBottom), 57 | (9.0, 5.0, Empty, HorizontalBottom), 58 | ], 59 | spawns: [ 60 | (2.0, 1.0), 61 | (2.0, 8.0), 62 | (8.0, 8.0), 63 | (8.0, 1.0), 64 | ], 65 | ) 66 | -------------------------------------------------------------------------------- /assets/map/freeplay.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | [ 4 | "0001", 5 | "0002", 6 | "0003", 7 | ] 8 | -------------------------------------------------------------------------------- /assets/sound/pickup.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/sound/pickup.ogg -------------------------------------------------------------------------------- /assets/sound/pickup.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/sound/pickup.wav -------------------------------------------------------------------------------- /assets/texture/block-numbers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/block-numbers.png -------------------------------------------------------------------------------- /assets/texture/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/empty.png -------------------------------------------------------------------------------- /assets/texture/empty_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/empty_side.png -------------------------------------------------------------------------------- /assets/texture/flavor/alaska.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/alaska.png -------------------------------------------------------------------------------- /assets/texture/flavor/anti_scoop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/anti_scoop.png -------------------------------------------------------------------------------- /assets/texture/flavor/baloon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/baloon.png -------------------------------------------------------------------------------- /assets/texture/flavor/blackberry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/blackberry.png -------------------------------------------------------------------------------- /assets/texture/flavor/blue_raspberry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/blue_raspberry.png -------------------------------------------------------------------------------- /assets/texture/flavor/bubblegum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/bubblegum.png -------------------------------------------------------------------------------- /assets/texture/flavor/cherry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/cherry.png -------------------------------------------------------------------------------- /assets/texture/flavor/chocolate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/chocolate.png -------------------------------------------------------------------------------- /assets/texture/flavor/coffee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/coffee.png -------------------------------------------------------------------------------- /assets/texture/flavor/cookie_dough.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/cookie_dough.png -------------------------------------------------------------------------------- /assets/texture/flavor/cookies_cream.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/cookies_cream.png -------------------------------------------------------------------------------- /assets/texture/flavor/creamsicle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/creamsicle.png -------------------------------------------------------------------------------- /assets/texture/flavor/dark_matter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/dark_matter.png -------------------------------------------------------------------------------- /assets/texture/flavor/ectoplasm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/ectoplasm.png -------------------------------------------------------------------------------- /assets/texture/flavor/god.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/god.png -------------------------------------------------------------------------------- /assets/texture/flavor/green_tea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/green_tea.png -------------------------------------------------------------------------------- /assets/texture/flavor/index.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | SpriteFolderDef ( 4 | keys: [ 5 | "strawberry", 6 | "chocolate", 7 | "vanilla", 8 | "cookie_dough", 9 | "cookies_cream", 10 | "rocky_road", 11 | "coffee", 12 | "mint_chocolate", 13 | "pistachio", 14 | "orange", 15 | "cherry", 16 | "blue_raspberry", 17 | "blackberry", 18 | "lemon", 19 | "dark_matter", 20 | "jalapeno", 21 | "snowball", 22 | "ectoplasm", 23 | "bubblegum", 24 | "baloon", 25 | "god", 26 | "licensed", 27 | "alaska", 28 | "green_tea", 29 | "tiger_tail", 30 | "tutti_frutti", 31 | "rum_raisin", 32 | "creamsicle", 33 | "anti_scoop", 34 | ], 35 | path: "texture/flavor/", 36 | width: 32.0, 37 | height: 64.0, 38 | sprites: [ 39 | ("top_h", 0.0, 0.0, 1.0, 0.25), 40 | ("top_v", 0.0, 0.25, 0.5, 0.5), 41 | ("side_h", 0.0, 0.75, 1.0, 0.125), 42 | ("side_v", 0.0, 0.875, 0.5, 0.125), 43 | ], 44 | anims: { 45 | "top_h": ([ 46 | ("top_h", 0.25), 47 | ], Once), 48 | "top_v": ([ 49 | ("top_v", 0.25), 50 | ], Once), 51 | "side_h": ([ 52 | ("side_h", 0.25), 53 | ], Once), 54 | "side_v": ([ 55 | ("side_v", 0.25), 56 | ], Once), 57 | }, 58 | ) 59 | -------------------------------------------------------------------------------- /assets/texture/flavor/jalapeno.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/jalapeno.png -------------------------------------------------------------------------------- /assets/texture/flavor/lemon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/lemon.png -------------------------------------------------------------------------------- /assets/texture/flavor/licensed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/licensed.png -------------------------------------------------------------------------------- /assets/texture/flavor/mint_chocolate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/mint_chocolate.png -------------------------------------------------------------------------------- /assets/texture/flavor/orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/orange.png -------------------------------------------------------------------------------- /assets/texture/flavor/pistachio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/pistachio.png -------------------------------------------------------------------------------- /assets/texture/flavor/rocky_road.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/rocky_road.png -------------------------------------------------------------------------------- /assets/texture/flavor/rum_raisin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/rum_raisin.png -------------------------------------------------------------------------------- /assets/texture/flavor/snowball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/snowball.png -------------------------------------------------------------------------------- /assets/texture/flavor/strawberry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/strawberry.png -------------------------------------------------------------------------------- /assets/texture/flavor/tiger_tail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/tiger_tail.png -------------------------------------------------------------------------------- /assets/texture/flavor/tutti_frutti.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/tutti_frutti.png -------------------------------------------------------------------------------- /assets/texture/flavor/vanilla.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/flavor/vanilla.png -------------------------------------------------------------------------------- /assets/texture/item/alaska.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/alaska.png -------------------------------------------------------------------------------- /assets/texture/item/anti_scoop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/anti_scoop.png -------------------------------------------------------------------------------- /assets/texture/item/balloon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/balloon.png -------------------------------------------------------------------------------- /assets/texture/item/blackberry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/blackberry.png -------------------------------------------------------------------------------- /assets/texture/item/blue_raspberry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/blue_raspberry.png -------------------------------------------------------------------------------- /assets/texture/item/bubblegum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/bubblegum.png -------------------------------------------------------------------------------- /assets/texture/item/cherry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/cherry.png -------------------------------------------------------------------------------- /assets/texture/item/chocolate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/chocolate.png -------------------------------------------------------------------------------- /assets/texture/item/coffee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/coffee.png -------------------------------------------------------------------------------- /assets/texture/item/cookie_dough.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/cookie_dough.png -------------------------------------------------------------------------------- /assets/texture/item/cookies_cream.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/cookies_cream.png -------------------------------------------------------------------------------- /assets/texture/item/creamsicle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/creamsicle.png -------------------------------------------------------------------------------- /assets/texture/item/dark_matter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/dark_matter.png -------------------------------------------------------------------------------- /assets/texture/item/ectoplasm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/ectoplasm.png -------------------------------------------------------------------------------- /assets/texture/item/flavors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/flavors.png -------------------------------------------------------------------------------- /assets/texture/item/flavors.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | SpriteFolderDef ( 4 | keys: [ 5 | "strawberry", 6 | "chocolate", 7 | "vanilla", 8 | "cookie_dough", 9 | "cookies_cream", 10 | "rocky_road", 11 | "coffee", 12 | "mint_chocolate", 13 | "pistachio", 14 | "orange", 15 | "cherry", 16 | "blue_raspberry", 17 | "blackberry", 18 | "lemon", 19 | "dark_matter", 20 | "jalapeno", 21 | "snowball", 22 | "ectoplasm", 23 | "bubblegum", 24 | "balloon", 25 | "god", 26 | "licensed", 27 | "alaska", 28 | "green_tea", 29 | "tiger_tail", 30 | "tutti_frutti", 31 | "rum_raisin", 32 | "creamsicle", 33 | "anti_scoop", 34 | ], 35 | path: "texture/item/", 36 | width: 16.0, 37 | height: 512.0, 38 | sprites: [ 39 | ("item_0", 0.0, 0.9375, 1.0, 0.03125), 40 | ("item_1", 0.0, 0.90625, 1.0, 0.03125), 41 | ("item_2", 0.0, 0.875, 1.0, 0.03125), 42 | ("item_3", 0.0, 0.84375, 1.0, 0.03125), 43 | ("scoop_0", 0.0, 0.8125, 1.0, 0.03125), 44 | ("scoop_1", 0.0, 0.78125, 1.0, 0.03125), 45 | ("scoop_2", 0.0, 0.75, 1.0, 0.03125), 46 | ("scoop_3", 0.0, 0.71875, 1.0, 0.03125), 47 | ("ball_0", 0.0, 0.6875, 1.0, 0.03125), 48 | ("ball_1", 0.0, 0.65625, 1.0, 0.03125), 49 | ("ball_2", 0.0, 0.625, 1.0, 0.03125), 50 | ("ball_3", 0.0, 0.59375, 1.0, 0.03125), 51 | ], 52 | anims: { 53 | "item": ([ 54 | ("item_0", 0.25), 55 | ("item_1", 0.25), 56 | ("item_2", 0.25), 57 | ("item_3", 0.25), 58 | ], Circular), 59 | "scoop": ([ 60 | ("scoop_0", 0.25), 61 | ("scoop_1", 0.25), 62 | ("scoop_2", 0.25), 63 | ("scoop_3", 0.25), 64 | ], Circular), 65 | "ball": ([ 66 | ("ball_0", 0.25), 67 | ("ball_1", 0.25), 68 | ("ball_2", 0.25), 69 | ("ball_3", 0.25), 70 | ], Circular), 71 | }, 72 | ) 73 | -------------------------------------------------------------------------------- /assets/texture/item/god.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/god.png -------------------------------------------------------------------------------- /assets/texture/item/green_tea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/green_tea.png -------------------------------------------------------------------------------- /assets/texture/item/items.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/items.png -------------------------------------------------------------------------------- /assets/texture/item/jalapeno.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/jalapeno.png -------------------------------------------------------------------------------- /assets/texture/item/lemon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/lemon.png -------------------------------------------------------------------------------- /assets/texture/item/licensed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/licensed.png -------------------------------------------------------------------------------- /assets/texture/item/mint_chocolate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/mint_chocolate.png -------------------------------------------------------------------------------- /assets/texture/item/old-index.ron: -------------------------------------------------------------------------------- 1 | ( 2 | TextureDefinition ( 3 | path: "texture/item/items.png", 4 | width: 64.0, 5 | height: 64.0, 6 | sprites: [ 7 | ("scoop_empty", 0.0, 0.5, 0.25, 0.25), 8 | ("empty_item", 0.0, 0.75, 0.25, 0.25), 9 | ("cake_cone", 0.25, 0.25, 0.25, 0.25), 10 | ("cone_neapolitan", 0.25, 0.0, 0.25, 0.25), 11 | ], 12 | ), 13 | { 14 | "scoop_empty": ([ 15 | ("scoop_empty", 0.25), 16 | ], Once), 17 | 18 | "empty_item": ([ 19 | ("empty_item", 0.25), 20 | ], Once), 21 | 22 | "cake_cone": ([ 23 | ("cake_cone", 0.25), 24 | ], Once), 25 | 26 | "cone_neapolitan": ([ 27 | ("cone_neapolitan", 0.25), 28 | ], Once), 29 | 30 | "order_neapolitan": ([ 31 | ("cone_neapolitan", 0.25), 32 | ], Once), 33 | }, 34 | ) 35 | -------------------------------------------------------------------------------- /assets/texture/item/orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/orange.png -------------------------------------------------------------------------------- /assets/texture/item/pistachio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/pistachio.png -------------------------------------------------------------------------------- /assets/texture/item/rocky_road.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/rocky_road.png -------------------------------------------------------------------------------- /assets/texture/item/rum_raisin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/rum_raisin.png -------------------------------------------------------------------------------- /assets/texture/item/snowball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/snowball.png -------------------------------------------------------------------------------- /assets/texture/item/sprinkles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/sprinkles.png -------------------------------------------------------------------------------- /assets/texture/item/strawberry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/strawberry.png -------------------------------------------------------------------------------- /assets/texture/item/tiger_tail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/tiger_tail.png -------------------------------------------------------------------------------- /assets/texture/item/toppings.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | SpriteFolderDef ( 4 | keys: [ 5 | "sprinkles", 6 | ], 7 | path: "texture/item/", 8 | width: 16.0, 9 | height: 160.0, 10 | sprites: [ 11 | ("item", 0.0, 0.9, 1.0, 0.1), 12 | ("single_cake_cone", 0.0, 0.8, 1.0, 0.1), 13 | ("one_cake_cone", 0.0, 0.7, 1.0, 0.1), 14 | ("two_cake_cone", 0.0, 0.6, 1.0, 0.1), 15 | ("three_cake_cone", 0.0, 0.5, 1.0, 0.1), 16 | ], 17 | anims: { 18 | "item": ([ 19 | ("item", 0.25), 20 | ], Once), 21 | "single_cake_cone": ([ 22 | ("single_cake_cone", 0.25), 23 | ], Once), 24 | "one_cake_cone": ([ 25 | ("one_cake_cone", 0.25), 26 | ], Once), 27 | "two_cake_cone": ([ 28 | ("two_cake_cone", 0.25), 29 | ], Once), 30 | "three_cake_cone": ([ 31 | ("three_cake_cone", 0.25), 32 | ], Once), 33 | }, 34 | ) 35 | -------------------------------------------------------------------------------- /assets/texture/item/tutti_frutti.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/tutti_frutti.png -------------------------------------------------------------------------------- /assets/texture/item/vanilla.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/item/vanilla.png -------------------------------------------------------------------------------- /assets/texture/map_tiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/map_tiles.png -------------------------------------------------------------------------------- /assets/texture/map_tiles.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | ( 4 | TextureDefinition ( 5 | path: "texture/map_tiles.png", 6 | width: 128.0, 7 | height: 64.0, 8 | sprites: [ 9 | ("delivery_top_h", 0.0, 0.0, 0.25, 0.25), 10 | ("delivery_top_v", 0.0, 0.25, 0.125, 0.5), 11 | ("delivery_side_h", 0.0, 0.75, 0.25, 0.125), 12 | ("delivery_side_v", 0.0, 0.875, 0.125, 0.125), 13 | 14 | ("empty_top_h", 0.25, 0.0, 0.125, 0.25), 15 | ("empty_top_v", 0.25, 0.0, 0.125, 0.25), 16 | ("empty_side_h", 0.25, 0.875, 0.125, 0.125), 17 | ("empty_side_v", 0.25, 0.875, 0.125, 0.125), 18 | 19 | ("floor_top_h", 0.5, 0.0, 0.125, 0.25), 20 | ("floor_top_v", 0.5, 0.0, 0.125, 0.25), 21 | ("floor_side_h", 0.5, 0.875, 0.125, 0.125), 22 | ("floor_side_v", 0.5, 0.875, 0.125, 0.125), 23 | ], 24 | ), 25 | { 26 | "delivery_top_h": ([ 27 | ("delivery_top_h", 0.25), 28 | ], Once), 29 | "delivery_top_v": ([ 30 | ("delivery_top_v", 0.25), 31 | ], Once), 32 | "delivery_side_h": ([ 33 | ("delivery_side_h", 0.25), 34 | ], Once), 35 | "delivery_side_v": ([ 36 | ("delivery_side_v", 0.25), 37 | ], Once), 38 | 39 | "empty_top_h": ([ 40 | ("empty_top_h", 0.25), 41 | ], Once), 42 | "empty_top_v": ([ 43 | ("empty_top_v", 0.25), 44 | ], Once), 45 | "empty_side_h": ([ 46 | ("empty_side_h", 0.25), 47 | ], Once), 48 | "empty_side_v": ([ 49 | ("empty_side_v", 0.25), 50 | ], Once), 51 | 52 | "floor_top_h": ([ 53 | ("floor_top_h", 0.25), 54 | ], Once), 55 | "floor_top_v": ([ 56 | ("floor_top_v", 0.25), 57 | ], Once), 58 | "floor_side_h": ([ 59 | ("floor_side_h", 0.25), 60 | ], Once), 61 | "floor_side_v": ([ 62 | ("floor_side_v", 0.25), 63 | ], Once), 64 | }, 65 | ) 66 | -------------------------------------------------------------------------------- /assets/texture/other/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/other/bg.png -------------------------------------------------------------------------------- /assets/texture/other/hud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/other/hud.png -------------------------------------------------------------------------------- /assets/texture/other/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/other/menu.png -------------------------------------------------------------------------------- /assets/texture/other/title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/other/title.png -------------------------------------------------------------------------------- /assets/texture/player/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/player/base.png -------------------------------------------------------------------------------- /assets/texture/player/index.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | ( 4 | TextureDefinition ( 5 | path: "texture/player/base.png", 6 | width: 192.0, 7 | height: 192.0, 8 | sprites: [ 9 | ("char_east_idle", 0.0, 0.0, 0.25, 0.25), 10 | ("char_east_step_1", 0.25, 0.0, 0.25, 0.25), 11 | ("char_east_step_2", 0.50, 0.0, 0.25, 0.25), 12 | ("char_east_step_3", 0.75, 0.0, 0.25, 0.25), 13 | 14 | ("char_north_idle", 0.0, 0.25, 0.25, 0.25), 15 | ("char_north_step_1", 0.25, 0.25, 0.25, 0.25), 16 | ("char_north_step_2", 0.50, 0.25, 0.25, 0.25), 17 | ("char_north_step_3", 0.75, 0.25, 0.25, 0.25), 18 | 19 | ("char_west_idle", 0.0, 0.5, 0.25, 0.25), 20 | ("char_west_step_1", 0.25, 0.5, 0.25, 0.25), 21 | ("char_west_step_2", 0.50, 0.5, 0.25, 0.25), 22 | ("char_west_step_3", 0.75, 0.5, 0.25, 0.25), 23 | 24 | ("char_south_idle", 0.0, 0.75, 0.25, 0.25), 25 | ("char_south_step_1", 0.25, 0.75, 0.25, 0.25), 26 | ("char_south_step_2", 0.50, 0.75, 0.25, 0.25), 27 | ("char_south_step_3", 0.75, 0.75, 0.25, 0.25), 28 | ], 29 | ), 30 | { 31 | "char_east_idle": ([ 32 | ("char_east_idle", 0.25), 33 | ], Once), 34 | 35 | "char_east_walk": ([ 36 | ("char_east_step_1", 0.150), 37 | ("char_east_step_2", 0.150), 38 | ("char_east_step_3", 0.150), 39 | ], Bounce), 40 | 41 | "char_north_idle": ([ 42 | ("char_north_idle", 0.25), 43 | ], Once), 44 | "char_north_walk": ([ 45 | ("char_north_step_1", 0.150), 46 | ("char_north_step_2", 0.150), 47 | ("char_north_step_3", 0.150), 48 | ], Bounce), 49 | 50 | "char_west_idle": ([ 51 | ("char_west_idle", 0.25), 52 | ], Once), 53 | "char_west_walk": ([ 54 | ("char_west_step_1", 0.150), 55 | ("char_west_step_2", 0.150), 56 | ("char_west_step_3", 0.150), 57 | ], Bounce), 58 | 59 | "char_south_idle": ([ 60 | ("char_south_idle", 0.25), 61 | ], Once), 62 | "char_south_walk": ([ 63 | ("char_south_step_1", 0.150), 64 | ("char_south_step_2", 0.150), 65 | ("char_south_step_3", 0.150), 66 | ], Bounce), 67 | }, 68 | ) 69 | -------------------------------------------------------------------------------- /assets/texture/preparation/bowl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/preparation/bowl.png -------------------------------------------------------------------------------- /assets/texture/preparation/cake_cone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/preparation/cake_cone.png -------------------------------------------------------------------------------- /assets/texture/preparation/chocolate_dipped_cake_cone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/preparation/chocolate_dipped_cake_cone.png -------------------------------------------------------------------------------- /assets/texture/preparation/chocolate_dipped_waffle_cone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/preparation/chocolate_dipped_waffle_cone.png -------------------------------------------------------------------------------- /assets/texture/preparation/chocolate_sandwich.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/preparation/chocolate_sandwich.png -------------------------------------------------------------------------------- /assets/texture/preparation/citrus_float.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/preparation/citrus_float.png -------------------------------------------------------------------------------- /assets/texture/preparation/cola_float.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/preparation/cola_float.png -------------------------------------------------------------------------------- /assets/texture/preparation/cookie_sandwich.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/preparation/cookie_sandwich.png -------------------------------------------------------------------------------- /assets/texture/preparation/index.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | SpriteFolderDef ( 4 | keys: [ 5 | "cake_cone", 6 | "waffle_cone", 7 | "chocolate_dipped_cake_cone", 8 | "chocolate_dipped_waffle_cone", 9 | "bowl", 10 | "sundae", 11 | "shake", 12 | "cookie_sandwich", 13 | "chocolate_sandwich", 14 | "cola_float", 15 | "citrus_float", 16 | "rootbeer_float", 17 | ], 18 | path: "texture/preparation/", 19 | width: 32.0, 20 | height: 64.0, 21 | sprites: [ 22 | ("top_h", 0.0, 0.0, 1.0, 0.25), 23 | ("top_v", 0.0, 0.25, 0.5, 0.5), 24 | ("side_h", 0.0, 0.75, 1.0, 0.125), 25 | ("side_v", 0.0, 0.875, 0.5, 0.125), 26 | ], 27 | anims: { 28 | "top_h": ([ 29 | ("top_h", 0.25), 30 | ], Once), 31 | "top_v": ([ 32 | ("top_v", 0.25), 33 | ], Once), 34 | "side_h": ([ 35 | ("side_h", 0.25), 36 | ], Once), 37 | "side_v": ([ 38 | ("side_v", 0.25), 39 | ], Once), 40 | }, 41 | ) 42 | -------------------------------------------------------------------------------- /assets/texture/preparation/rootbeer_float.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/preparation/rootbeer_float.png -------------------------------------------------------------------------------- /assets/texture/preparation/shake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/preparation/shake.png -------------------------------------------------------------------------------- /assets/texture/preparation/sundae.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/preparation/sundae.png -------------------------------------------------------------------------------- /assets/texture/preparation/waffle_cone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/preparation/waffle_cone.png -------------------------------------------------------------------------------- /assets/texture/tall-numbers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/tall-numbers.png -------------------------------------------------------------------------------- /assets/texture/topping/bananas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/topping/bananas.png -------------------------------------------------------------------------------- /assets/texture/topping/caramel_syrup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/topping/caramel_syrup.png -------------------------------------------------------------------------------- /assets/texture/topping/cherries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/topping/cherries.png -------------------------------------------------------------------------------- /assets/texture/topping/chocolate_sprinkles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/topping/chocolate_sprinkles.png -------------------------------------------------------------------------------- /assets/texture/topping/chocolate_syrup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/topping/chocolate_syrup.png -------------------------------------------------------------------------------- /assets/texture/topping/cookie_crumbles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/topping/cookie_crumbles.png -------------------------------------------------------------------------------- /assets/texture/topping/gummy_candy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/topping/gummy_candy.png -------------------------------------------------------------------------------- /assets/texture/topping/index.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | SpriteFolderDef ( 4 | keys: [ 5 | "sprinkles", 6 | "chocolate_sprinkles", 7 | "wafer_sticks", 8 | "nuts", 9 | "chocolate_syrup", 10 | "caramel_syrup", 11 | "strawberry_syrup", 12 | "whipped_cream", 13 | "gummy_candy", 14 | "cherries", 15 | "strawberries", 16 | "kiwi", 17 | "bananas", 18 | "cookie_crumbles", 19 | ], 20 | path: "texture/topping/", 21 | width: 32.0, 22 | height: 64.0, 23 | sprites: [ 24 | ("top_h", 0.0, 0.0, 1.0, 0.25), 25 | ("top_v", 0.0, 0.25, 0.5, 0.5), 26 | ("side_h", 0.0, 0.75, 1.0, 0.125), 27 | ("side_v", 0.0, 0.875, 0.5, 0.125), 28 | ], 29 | anims: { 30 | "top_h": ([ 31 | ("top_h", 0.25), 32 | ], Once), 33 | "top_v": ([ 34 | ("top_v", 0.25), 35 | ], Once), 36 | "side_h": ([ 37 | ("side_h", 0.25), 38 | ], Once), 39 | "side_v": ([ 40 | ("side_v", 0.25), 41 | ], Once), 42 | }, 43 | ) 44 | -------------------------------------------------------------------------------- /assets/texture/topping/kiwi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/topping/kiwi.png -------------------------------------------------------------------------------- /assets/texture/topping/nuts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/topping/nuts.png -------------------------------------------------------------------------------- /assets/texture/topping/sprinkles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/topping/sprinkles.png -------------------------------------------------------------------------------- /assets/texture/topping/strawberries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/topping/strawberries.png -------------------------------------------------------------------------------- /assets/texture/topping/strawberry_syrup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/topping/strawberry_syrup.png -------------------------------------------------------------------------------- /assets/texture/topping/wafer_sticks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/topping/wafer_sticks.png -------------------------------------------------------------------------------- /assets/texture/topping/whipped_cream.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/topping/whipped_cream.png -------------------------------------------------------------------------------- /assets/texture/ui/button_prompts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/ui/button_prompts.png -------------------------------------------------------------------------------- /assets/texture/ui/buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/ui/buttons.png -------------------------------------------------------------------------------- /assets/texture/ui/buttons.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | ( 4 | TextureDefinition ( 5 | path: "texture/ui/button_prompts.png", 6 | width: 256.0, 7 | height: 32.0, 8 | sprites: [ 9 | ("button_circle_empty_down", 0.0, 0.0, 0.0625, 0.5), 10 | ("button_circle_empty_up", 0.0, 0.5, 0.0625, 0.5), 11 | 12 | ("button_square_empty_down", 0.0625, 0.0, 0.0625, 0.5), 13 | ("button_square_empty_up", 0.0625, 0.5, 0.0625, 0.5), 14 | 15 | ("prompt_north_right_down", 0.125, 0.0, 0.0625, 0.5), 16 | ("prompt_north_right_up", 0.125, 0.5, 0.0625, 0.5), 17 | 18 | ("prompt_south_right_down", 0.1875, 0.0, 0.0625, 0.5), 19 | ("prompt_south_right_up", 0.1875, 0.5, 0.0625, 0.5), 20 | 21 | ("prompt_west_right_down", 0.25, 0.0, 0.0625, 0.5), 22 | ("prompt_west_right_up", 0.25, 0.5, 0.0625, 0.5), 23 | 24 | ("prompt_east_right_down", 0.3125, 0.0, 0.0625, 0.5), 25 | ("prompt_east_right_up", 0.3125, 0.5, 0.0625, 0.5), 26 | 27 | ("prompt_north_left_down", 0.375, 0.0, 0.0625, 0.5), 28 | ("prompt_north_left_up", 0.375, 0.5, 0.0625, 0.5), 29 | 30 | ("prompt_south_left_down", 0.4375, 0.0, 0.0625, 0.5), 31 | ("prompt_south_left_up", 0.4375, 0.5, 0.0625, 0.5), 32 | 33 | ("prompt_west_left_down", 0.5, 0.0, 0.0625, 0.5), 34 | ("prompt_west_left_up", 0.5, 0.5, 0.0625, 0.5), 35 | 36 | ("prompt_east_left_down", 0.5625, 0.0, 0.0625, 0.5), 37 | ("prompt_east_left_up", 0.5625, 0.5, 0.0625, 0.5), 38 | 39 | ("prompt_failure_down", 0.625, 0.0, 0.0625, 0.5), 40 | ("prompt_failure_up", 0.625, 0.5, 0.0625, 0.5), 41 | 42 | ("prompt_success_down", 0.6875, 0.0, 0.0625, 0.5), 43 | ("prompt_success_up", 0.6875, 0.5, 0.0625, 0.5), 44 | ], 45 | ), 46 | { 47 | "button_circle_empty": ([ 48 | ("button_circle_empty_up", 0.25), 49 | ("button_circle_empty_down", 0.25), 50 | ], Circular), 51 | "button_square_empty": ([ 52 | ("button_square_empty_up", 0.25), 53 | ("button_square_empty_down", 0.25), 54 | ], Circular), 55 | 56 | "prompt_north_left": ([ 57 | ("prompt_north_left_up", 0.25), 58 | ("prompt_north_left_down", 0.25), 59 | ], Circular), 60 | "prompt_south_left": ([ 61 | ("prompt_south_left_up", 0.25), 62 | ("prompt_south_left_down", 0.25), 63 | ], Circular), 64 | "prompt_west_left": ([ 65 | ("prompt_west_left_up", 0.25), 66 | ("prompt_west_left_down", 0.25), 67 | ], Circular), 68 | "prompt_east_left": ([ 69 | ("prompt_east_left_up", 0.25), 70 | ("prompt_east_left_down", 0.25), 71 | ], Circular), 72 | 73 | "prompt_north_right": ([ 74 | ("prompt_north_right_up", 0.25), 75 | ("prompt_north_right_down", 0.25), 76 | ], Circular), 77 | "prompt_south_right": ([ 78 | ("prompt_south_right_up", 0.25), 79 | ("prompt_south_right_down", 0.25), 80 | ], Circular), 81 | "prompt_west_right": ([ 82 | ("prompt_west_right_up", 0.25), 83 | ("prompt_west_right_down", 0.25), 84 | ], Circular), 85 | "prompt_east_right": ([ 86 | ("prompt_east_right_up", 0.25), 87 | ("prompt_east_right_down", 0.25), 88 | ], Circular), 89 | 90 | "prompt_failure": ([ 91 | ("prompt_failure_up", 0.25), 92 | ("prompt_failure_down", 0.25), 93 | ], Circular), 94 | "prompt_success": ([ 95 | ("prompt_success_up", 0.25), 96 | ("prompt_success_down", 0.25), 97 | ], Circular), 98 | }, 99 | ) 100 | -------------------------------------------------------------------------------- /assets/texture/ui/loadout_selection.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | UiDefinition ( 4 | sprites: [ 5 | (11.0, 2.0, Button(Back)), 6 | (15.0, 2.0, Button(Confirm)), 7 | 8 | (10.5, 12.0, ToggleFlavor(0, 0, 0)), 9 | (11.5, 12.0, ToggleFlavor(0, 1, 1)), 10 | (12.5, 12.0, ToggleFlavor(0, 2, 2)), 11 | (13.5, 12.0, ToggleFlavor(0, 3, 4)), 12 | (14.5, 12.0, ToggleFlavor(0, 4, 5)), 13 | (15.5, 12.0, ToggleFlavor(0, 5, 6)), 14 | (16.5, 12.0, ToggleFlavor(0, 6, 7)), 15 | (17.5, 12.0, ToggleFlavor(0, 7, 8)), 16 | (18.5, 12.0, ToggleFlavor(0, 8, 9)), 17 | 18 | (12.5, 11.0, ToggleFlavor(1, 0, 10)), 19 | (13.5, 11.0, ToggleFlavor(1, 1, 11)), 20 | (14.5, 11.0, ToggleFlavor(1, 2, 12)), 21 | (15.5, 11.0, ToggleFlavor(1, 3, 13)), 22 | (16.5, 11.0, ToggleFlavor(1, 4, 15)), 23 | 24 | (11.0, 10.0, ToggleFlavor(2, 0, 16)), 25 | (12.0, 10.0, ToggleFlavor(2, 1, 17)), 26 | (13.0, 10.0, ToggleFlavor(2, 2, 18)), 27 | (14.0, 10.0, ToggleFlavor(2, 3, 19)), 28 | (15.0, 10.0, ToggleFlavor(2, 4, 20)), 29 | (16.0, 10.0, ToggleFlavor(2, 5, 21)), 30 | (17.0, 10.0, ToggleFlavor(2, 6, 22)), 31 | (18.0, 10.0, ToggleFlavor(2, 7, 24)), 32 | 33 | (11.5, 9.0, ToggleFlavor(3, 0, 25)), 34 | (12.5, 9.0, ToggleFlavor(3, 1, 26)), 35 | (13.5, 9.0, ToggleFlavor(3, 2, 27)), 36 | (14.5, 9.0, ToggleFlavor(3, 3, 28)), 37 | (15.5, 9.0, ToggleFlavor(3, 4, 29)), 38 | (16.5, 9.0, ToggleFlavor(3, 5, 30)), 39 | (17.5, 9.0, ToggleFlavor(3, 6, 31)), 40 | 41 | ( 9.0, 7.0, TogglePreparation(4, 0, 0)), 42 | (10.0, 7.0, TogglePreparation(4, 1, 1)), 43 | (11.0, 7.0, TogglePreparation(4, 2, 2)), 44 | (12.0, 7.0, TogglePreparation(4, 3, 3)), 45 | (13.0, 7.0, TogglePreparation(4, 4, 4)), 46 | (14.0, 7.0, TogglePreparation(4, 5, 5)), 47 | (15.0, 7.0, TogglePreparation(4, 6, 6)), 48 | (16.0, 7.0, TogglePreparation(4, 7, 7)), 49 | (17.0, 7.0, TogglePreparation(4, 8, 8)), 50 | (18.0, 7.0, TogglePreparation(4, 9, 9)), 51 | (19.0, 7.0, TogglePreparation(4, 10, 10)), 52 | (20.0, 7.0, TogglePreparation(4, 11, 11)), 53 | 54 | ( 8.0, 5.0, ToggleTopping(5, 0, 0)), 55 | ( 9.0, 5.0, ToggleTopping(5, 1, 1)), 56 | (10.0, 5.0, ToggleTopping(5, 2, 2)), 57 | (11.0, 5.0, ToggleTopping(5, 3, 3)), 58 | (12.0, 5.0, ToggleTopping(5, 4, 4)), 59 | (13.0, 5.0, ToggleTopping(5, 5, 5)), 60 | (14.0, 5.0, ToggleTopping(5, 6, 6)), 61 | (15.0, 5.0, ToggleTopping(5, 7, 7)), 62 | (16.0, 5.0, ToggleTopping(5, 8, 8)), 63 | (17.0, 5.0, ToggleTopping(5, 9, 9)), 64 | (18.0, 5.0, ToggleTopping(5, 10, 10)), 65 | (19.0, 5.0, ToggleTopping(5, 11, 11)), 66 | (20.0, 5.0, ToggleTopping(5, 12, 12)), 67 | (21.0, 5.0, ToggleTopping(5, 13, 13)), 68 | ], 69 | ) 70 | -------------------------------------------------------------------------------- /assets/texture/ui/map_selection.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | UiDefinition ( 4 | sprites: [ 5 | (6.0, 5.0, HalfCorner(BottomLeft)), 6 | (6.0, 11.0, HalfCorner(TopLeft)), 7 | (23.0, 5.0, HalfCorner(BottomRight)), 8 | (23.0, 11.0, HalfCorner(TopRight)), 9 | 10 | (11.0, 4.0, CutCorner(BottomLeft)), 11 | (11.0, 12.0, CutCorner(TopLeft)), 12 | (18.0, 4.0, CutCorner(BottomRight)), 13 | (18.0, 12.0, CutCorner(TopRight)), 14 | 15 | (11.0, 5.0, ConnectCorner(BottomLeft)), 16 | (11.0, 11.0, ConnectCorner(TopLeft)), 17 | (18.0, 5.0, ConnectCorner(BottomRight)), 18 | (18.0, 11.0, ConnectCorner(TopRight)), 19 | 20 | (7.0, 5.0, HalfSide(Bottom)), 21 | (8.0, 5.0, HalfSide(Bottom)), 22 | (9.0, 5.0, HalfSide(Bottom)), 23 | (10.0, 5.0, HalfSide(Bottom)), 24 | (19.0, 5.0, HalfSide(Bottom)), 25 | (20.0, 5.0, HalfSide(Bottom)), 26 | (21.0, 5.0, HalfSide(Bottom)), 27 | (22.0, 5.0, HalfSide(Bottom)), 28 | 29 | (7.0, 11.0, HalfSide(Top)), 30 | (8.0, 11.0, HalfSide(Top)), 31 | (9.0, 11.0, HalfSide(Top)), 32 | (10.0, 11.0, HalfSide(Top)), 33 | (19.0, 11.0, HalfSide(Top)), 34 | (20.0, 11.0, HalfSide(Top)), 35 | (21.0, 11.0, HalfSide(Top)), 36 | (22.0, 11.0, HalfSide(Top)), 37 | 38 | (12.0, 4.0, FullSide(Bottom)), 39 | (13.0, 4.0, FullSide(Bottom)), 40 | (14.0, 4.0, FullSide(Bottom)), 41 | (15.0, 4.0, FullSide(Bottom)), 42 | (16.0, 4.0, FullSide(Bottom)), 43 | (17.0, 4.0, FullSide(Bottom)), 44 | 45 | (12.0, 12.0, FullSide(Top)), 46 | (13.0, 12.0, FullSide(Top)), 47 | (14.0, 12.0, FullSide(Top)), 48 | (15.0, 12.0, FullSide(Top)), 49 | (16.0, 12.0, FullSide(Top)), 50 | (17.0, 12.0, FullSide(Top)), 51 | 52 | (6.0, 6.0, FullSide(Left)), 53 | (6.0, 7.0, FullSide(Left)), 54 | (6.0, 8.0, FullSide(Left)), 55 | (6.0, 9.0, FullSide(Left)), 56 | (6.0, 10.0, FullSide(Left)), 57 | 58 | (23.0, 6.0, FullSide(Right)), 59 | (23.0, 7.0, FullSide(Right)), 60 | (23.0, 8.0, FullSide(Right)), 61 | (23.0, 9.0, FullSide(Right)), 62 | (23.0, 10.0, FullSide(Right)), 63 | 64 | (12.0, 5.0, Center), 65 | (13.0, 5.0, Center), 66 | (14.0, 5.0, Center), 67 | (15.0, 5.0, Center), 68 | (16.0, 5.0, Center), 69 | (17.0, 5.0, Center), 70 | 71 | (12.0, 11.0, Center), 72 | (13.0, 11.0, Center), 73 | (14.0, 11.0, Center), 74 | (15.0, 11.0, Center), 75 | (16.0, 11.0, Center), 76 | (17.0, 11.0, Center), 77 | 78 | (7.0, 6.0, Center), 79 | (8.0, 6.0, Center), 80 | (9.0, 6.0, Center), 81 | (10.0, 6.0, Center), 82 | (11.0, 6.0, Center), 83 | (12.0, 6.0, Center), 84 | (13.0, 6.0, Center), 85 | (14.0, 6.0, Center), 86 | (15.0, 6.0, Center), 87 | (16.0, 6.0, Center), 88 | (17.0, 6.0, Center), 89 | (18.0, 6.0, Center), 90 | (19.0, 6.0, Center), 91 | (20.0, 6.0, Center), 92 | (21.0, 6.0, Center), 93 | (22.0, 6.0, Center), 94 | 95 | (7.0, 7.0, Center), 96 | (8.0, 7.0, Center), 97 | (9.0, 7.0, Center), 98 | (10.0, 7.0, Center), 99 | (11.0, 7.0, Center), 100 | (12.0, 7.0, Center), 101 | (13.0, 7.0, Center), 102 | (14.0, 7.0, Center), 103 | (15.0, 7.0, Center), 104 | (16.0, 7.0, Center), 105 | (17.0, 7.0, Center), 106 | (18.0, 7.0, Center), 107 | (19.0, 7.0, Center), 108 | (20.0, 7.0, Center), 109 | (21.0, 7.0, Center), 110 | (22.0, 7.0, Center), 111 | 112 | (7.0, 8.0, Center), 113 | (8.0, 8.0, Center), 114 | (9.0, 8.0, Center), 115 | (10.0, 8.0, Center), 116 | (11.0, 8.0, Center), 117 | (12.0, 8.0, Center), 118 | (13.0, 8.0, Center), 119 | (14.0, 8.0, Center), 120 | (15.0, 8.0, Center), 121 | (16.0, 8.0, Center), 122 | (17.0, 8.0, Center), 123 | (18.0, 8.0, Center), 124 | (19.0, 8.0, Center), 125 | (20.0, 8.0, Center), 126 | (21.0, 8.0, Center), 127 | (22.0, 8.0, Center), 128 | 129 | (7.0, 9.0, Center), 130 | (8.0, 9.0, Center), 131 | (9.0, 9.0, Center), 132 | (10.0, 9.0, Center), 133 | (11.0, 9.0, Center), 134 | (12.0, 9.0, Center), 135 | (13.0, 9.0, Center), 136 | (14.0, 9.0, Center), 137 | (15.0, 9.0, Center), 138 | (16.0, 9.0, Center), 139 | (17.0, 9.0, Center), 140 | (18.0, 9.0, Center), 141 | (19.0, 9.0, Center), 142 | (20.0, 9.0, Center), 143 | (21.0, 9.0, Center), 144 | (22.0, 9.0, Center), 145 | 146 | (7.0, 10.0, Center), 147 | (8.0, 10.0, Center), 148 | (9.0, 10.0, Center), 149 | (10.0, 10.0, Center), 150 | (11.0, 10.0, Center), 151 | (12.0, 10.0, Center), 152 | (13.0, 10.0, Center), 153 | (14.0, 10.0, Center), 154 | (15.0, 10.0, Center), 155 | (16.0, 10.0, Center), 156 | (17.0, 10.0, Center), 157 | (18.0, 10.0, Center), 158 | (19.0, 10.0, Center), 159 | (20.0, 10.0, Center), 160 | (21.0, 10.0, Center), 161 | (22.0, 10.0, Center), 162 | 163 | (7.25, 7.125, MapPreview(Previous)), 164 | (12.5, 5.75, MapPreview(Current)), 165 | (20.25, 7.125, MapPreview(Next)), 166 | 167 | (11.0, 2.0, Button(Back)), 168 | (15.0, 2.0, Button(Confirm)), 169 | 170 | (10.5, 8.0, Arrow(Previous)), 171 | (18.5, 8.0, Arrow(Next)), 172 | ], 173 | ) 174 | -------------------------------------------------------------------------------- /assets/texture/ui/melt_timers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/ui/melt_timers.png -------------------------------------------------------------------------------- /assets/texture/ui/progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/ui/progress.png -------------------------------------------------------------------------------- /assets/texture/ui/prompt_progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/ui/prompt_progress.png -------------------------------------------------------------------------------- /assets/texture/ui/timers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/ui/timers.png -------------------------------------------------------------------------------- /assets/texture/ui/timers.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | ( 4 | TextureDefinition ( 5 | path: "texture/ui/timers.png", 6 | width: 64.0, 7 | height: 256.0, 8 | sprites: [ 9 | ("white_progress_0", 0.0, 0.0, 0.5, 0.03125), 10 | ("white_progress_1", 0.0, 0.03125, 0.5, 0.03125), 11 | ("white_progress_2", 0.0, 0.0625, 0.5, 0.03125), 12 | ("white_progress_3", 0.0, 0.09375, 0.5, 0.03125), 13 | ("white_progress_4", 0.0, 0.125, 0.5, 0.03125), 14 | ("white_progress_5", 0.0, 0.15625, 0.5, 0.03125), 15 | ("white_progress_6", 0.0, 0.1875, 0.5, 0.03125), 16 | ("white_progress_7", 0.0, 0.21875, 0.5, 0.03125), 17 | ("white_progress_8", 0.0, 0.25, 0.5, 0.03125), 18 | ("white_progress_9", 0.0, 0.28125, 0.5, 0.03125), 19 | ("white_progress_11", 0.0, 0.3125, 0.5, 0.03125), 20 | ("white_progress_12", 0.0, 0.34375, 0.5, 0.03125), 21 | ("white_progress_13", 0.0, 0.375, 0.5, 0.03125), 22 | ("white_progress_14", 0.0, 0.40625, 0.5, 0.03125), 23 | ("white_progress_15", 0.0, 0.4375, 0.5, 0.03125), 24 | ("white_progress_16", 0.0, 0.46875, 0.5, 0.03125), 25 | ("white_progress_17", 0.0, 0.5, 0.5, 0.03125), 26 | ("white_progress_18", 0.0, 0.53125, 0.5, 0.03125), 27 | ("white_progress_19", 0.0, 0.5625, 0.5, 0.03125), 28 | ("white_progress_20", 0.0, 0.59375, 0.5, 0.03125), 29 | ("white_progress_21", 0.0, 0.625, 0.5, 0.03125), 30 | ("white_progress_22", 0.0, 0.65625, 0.5, 0.03125), 31 | ("white_progress_23", 0.0, 0.6875, 0.5, 0.03125), 32 | 33 | ("color_progress_0", 0.5, 0.0, 0.5, 0.03125), 34 | ("color_progress_1", 0.5, 0.03125, 0.5, 0.03125), 35 | ("color_progress_2", 0.5, 0.0625, 0.5, 0.03125), 36 | ("color_progress_3", 0.5, 0.09375, 0.5, 0.03125), 37 | ("color_progress_4", 0.5, 0.125, 0.5, 0.03125), 38 | ("color_progress_5", 0.5, 0.15625, 0.5, 0.03125), 39 | ("color_progress_6", 0.5, 0.1875, 0.5, 0.03125), 40 | ("color_progress_7", 0.5, 0.21875, 0.5, 0.03125), 41 | ("color_progress_8", 0.5, 0.25, 0.5, 0.03125), 42 | ("color_progress_9", 0.5, 0.28125, 0.5, 0.03125), 43 | ("color_progress_11", 0.5, 0.3125, 0.5, 0.03125), 44 | ("color_progress_12", 0.5, 0.34375, 0.5, 0.03125), 45 | ("color_progress_13", 0.5, 0.375, 0.5, 0.03125), 46 | ("color_progress_14", 0.5, 0.40625, 0.5, 0.03125), 47 | ("color_progress_15", 0.5, 0.4375, 0.5, 0.03125), 48 | ("color_progress_16", 0.5, 0.46875, 0.5, 0.03125), 49 | ("color_progress_17", 0.5, 0.5, 0.5, 0.03125), 50 | ("color_progress_18", 0.5, 0.53125, 0.5, 0.03125), 51 | ("color_progress_19", 0.5, 0.5625, 0.5, 0.03125), 52 | ("color_progress_20", 0.5, 0.59375, 0.5, 0.03125), 53 | ("color_progress_21", 0.5, 0.625, 0.5, 0.03125), 54 | ("color_progress_22", 0.5, 0.65625, 0.5, 0.03125), 55 | ("color_progress_23", 0.5, 0.6875, 0.5, 0.03125), 56 | ], 57 | ), 58 | { 59 | "white_progress": ([ 60 | ("white_progress_0", 0.04167), 61 | ("white_progress_1", 0.04167), 62 | ("white_progress_2", 0.04167), 63 | ("white_progress_3", 0.04167), 64 | ("white_progress_4", 0.04167), 65 | ("white_progress_5", 0.04167), 66 | ("white_progress_6", 0.04167), 67 | ("white_progress_7", 0.04167), 68 | ("white_progress_8", 0.04167), 69 | ("white_progress_9", 0.04167), 70 | ("white_progress_11", 0.04167), 71 | ("white_progress_12", 0.04167), 72 | ("white_progress_13", 0.04167), 73 | ("white_progress_14", 0.04167), 74 | ("white_progress_15", 0.04167), 75 | ("white_progress_16", 0.04167), 76 | ("white_progress_17", 0.04167), 77 | ("white_progress_18", 0.04167), 78 | ("white_progress_19", 0.04167), 79 | ("white_progress_20", 0.04167), 80 | ("white_progress_21", 0.04167), 81 | ("white_progress_22", 0.04167), 82 | ("white_progress_23", 0.04167), 83 | ], Once), 84 | "color_progress": ([ 85 | ("color_progress_0", 0.04167), 86 | ("color_progress_1", 0.04167), 87 | ("color_progress_2", 0.04167), 88 | ("color_progress_3", 0.04167), 89 | ("color_progress_4", 0.04167), 90 | ("color_progress_5", 0.04167), 91 | ("color_progress_6", 0.04167), 92 | ("color_progress_7", 0.04167), 93 | ("color_progress_8", 0.04167), 94 | ("color_progress_9", 0.04167), 95 | ("color_progress_11", 0.04167), 96 | ("color_progress_12", 0.04167), 97 | ("color_progress_13", 0.04167), 98 | ("color_progress_14", 0.04167), 99 | ("color_progress_15", 0.04167), 100 | ("color_progress_16", 0.04167), 101 | ("color_progress_17", 0.04167), 102 | ("color_progress_18", 0.04167), 103 | ("color_progress_19", 0.04167), 104 | ("color_progress_20", 0.04167), 105 | ("color_progress_21", 0.04167), 106 | ("color_progress_22", 0.04167), 107 | ("color_progress_23", 0.04167), 108 | ], Once), 109 | }, 110 | ) 111 | -------------------------------------------------------------------------------- /assets/texture/ui/tutorials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maringa-gamedev/rust-igmc-2018/ede6b2e71a14dcb771282dd968ae519d0813115e/assets/texture/ui/tutorials.png -------------------------------------------------------------------------------- /ci/before_deploy.sh: -------------------------------------------------------------------------------- 1 | # This script takes care of building your crate and packaging it for release 2 | 3 | set -ex 4 | 5 | main() { 6 | local src=$(pwd) \ 7 | stage= 8 | 9 | case $TRAVIS_OS_NAME in 10 | linux) 11 | stage=$(mktemp -d) 12 | ;; 13 | osx) 14 | stage=$(mktemp -d -t tmp) 15 | ;; 16 | esac 17 | 18 | test -f Cargo.lock || cargo generate-lockfile 19 | 20 | export PKG_CONFIG_ALLOW_CROSS=1 21 | cargo rustc --bin nk_tool --target $TARGET --release -- -C lto 22 | cargo rustc --bin nk_game --target $TARGET --release -- -C lto 23 | 24 | cp target/$TARGET/release/nk_tool $stage/ 25 | cp target/$TARGET/release/nk_game $stage/ 26 | cp -r assets/ $stage/ 27 | cp -r resources/ $stage/ 28 | 29 | cd $stage 30 | tar czf $src/$CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz * 31 | cd $src 32 | 33 | rm -rf $stage 34 | } 35 | 36 | main 37 | -------------------------------------------------------------------------------- /resources/display.ron: -------------------------------------------------------------------------------- 1 | #![enable(implicit_some)] 2 | #![enable(unwrap_newtypes)] 3 | ( 4 | //dimensions: (800, 600), 5 | dimensions: (960, 544), 6 | max_dimensions: (1920, 1080), 7 | min_dimensions: (480, 272), 8 | fullscreen: false, 9 | multisampling: 0, 10 | title: "Naisu Kurimu", 11 | visibility: true, 12 | vsync: true, 13 | ) 14 | -------------------------------------------------------------------------------- /resources/input.ron: -------------------------------------------------------------------------------- 1 | ( 2 | axes: { 3 | "player_one_horizontal_controller": Controller( 4 | controller_id: 0, 5 | axis: LeftX, 6 | invert: false, 7 | dead_zone: 0.2, 8 | ), 9 | "player_one_vertical_controller": Controller( 10 | controller_id: 0, 11 | axis: LeftY, 12 | invert: false, 13 | dead_zone: 0.2, 14 | ), 15 | "player_one_horizontal_keyboard": Emulated( 16 | pos: Key(L), 17 | neg: Key(H), 18 | ), 19 | "player_one_vertical_keyboard": Emulated( 20 | pos: Key(K), 21 | neg: Key(J), 22 | ), 23 | "player_one_horizontal_aim_controller": Controller( 24 | controller_id: 0, 25 | axis: RightX, 26 | invert: false, 27 | dead_zone: 0.2, 28 | ), 29 | "player_one_vertical_aim_controller": Controller( 30 | controller_id: 0, 31 | axis: RightY, 32 | invert: false, 33 | dead_zone: 0.2, 34 | ), 35 | "player_one_horizontal_aim_keyboard": Emulated( 36 | pos: Key(V), 37 | neg: Key(Z), 38 | ), 39 | "player_one_vertical_aim_keyboard": Emulated( 40 | pos: Key(X), 41 | neg: Key(C), 42 | ), 43 | 44 | "player_two_horizontal_controller": Controller( 45 | controller_id: 1, 46 | axis: LeftX, 47 | invert: false, 48 | dead_zone: 0.2, 49 | ), 50 | "player_two_vertical_controller": Controller( 51 | controller_id: 1, 52 | axis: LeftY, 53 | invert: false, 54 | dead_zone: 0.2, 55 | ), 56 | "player_two_horizontal_keyboard": Emulated( 57 | pos: Key(Right), 58 | neg: Key(Left), 59 | ), 60 | "player_two_vertical_keyboard": Emulated( 61 | pos: Key(Up), 62 | neg: Key(Down), 63 | ), 64 | "player_two_horizontal_aim_controller": Controller( 65 | controller_id: 1, 66 | axis: RightX, 67 | invert: false, 68 | dead_zone: 0.2, 69 | ), 70 | "player_two_vertical_aim_controller": Controller( 71 | controller_id: 1, 72 | axis: RightY, 73 | invert: false, 74 | dead_zone: 0.2, 75 | ), 76 | "player_two_horizontal_aim_keyboard": Emulated( 77 | pos: Key(D), 78 | neg: Key(A), 79 | ), 80 | "player_two_vertical_aim_keyboard": Emulated( 81 | pos: Key(W), 82 | neg: Key(S), 83 | ), 84 | }, 85 | actions: {}, 86 | ) 87 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | merge_imports = true 2 | -------------------------------------------------------------------------------- /src/bin/game.rs: -------------------------------------------------------------------------------- 1 | #![feature(box_patterns)] 2 | #![feature(exclusive_range_pattern)] 3 | #![feature(type_ascription)] 4 | 5 | use amethyst::{ 6 | animation::AnimationBundle, 7 | assets::Processor, 8 | audio::{AudioBundle, Source}, 9 | config::*, 10 | core::{frame_limiter::FrameRateLimitStrategy, transform::TransformBundle}, 11 | input::InputBundle, 12 | prelude::*, 13 | renderer::{ 14 | ColorMask, DepthMode, DisplayConfig, DrawSprite, Pipeline, RenderBundle, SpriteRender, 15 | Stage, ALPHA, 16 | }, 17 | shrev::*, 18 | ui::{DrawUi, UiBundle}, 19 | utils::application_root_dir, 20 | }; 21 | use clap::{App, Arg}; 22 | use gilrs::*; 23 | use log::*; 24 | use nk_ecs::*; 25 | use nk_state::*; 26 | use std::{collections::HashMap, sync::*, time::Duration}; 27 | 28 | pub struct NoMusic; 29 | 30 | fn main() -> amethyst::Result<()> { 31 | amethyst::start_logger(Default::default()); 32 | 33 | let matches = App::new("Naisu Kurimu") 34 | .version("preview-003") 35 | .author("Tiago Nascimento ") 36 | .about("Lançador do Jogo Naisu Kurimu") 37 | .arg( 38 | Arg::with_name("map") 39 | .short("m") 40 | .long("map") 41 | .value_name("MAP") 42 | .help("Specifies which map to open as default") 43 | .takes_value(true), 44 | ) 45 | .get_matches(); 46 | 47 | std::env::set_var("RUST_LOG", "gfx_device_gl=warn"); 48 | 49 | let channel = Arc::new(Mutex::new(EventChannel::::new())); 50 | { 51 | let channel = channel.clone(); 52 | std::thread::spawn(move || { 53 | let mut gilrs = Gilrs::new().unwrap(); 54 | for (_id, gamepad) in gilrs.gamepads() { 55 | info!( 56 | "{} (id:{}) is {:?}", 57 | gamepad.os_name(), 58 | gamepad.id(), 59 | gamepad.power_info() 60 | ); 61 | } 62 | loop { 63 | while let Some(event) = gilrs.next_event() { 64 | channel.lock().unwrap().single_write(event); 65 | } 66 | } 67 | }); 68 | } 69 | 70 | let app_root = application_root_dir(); 71 | let path = format!("{}/resources/display.ron", app_root); 72 | let display_config = DisplayConfig::load(&path); 73 | let assets_directory = format!("{}/assets/", app_root); 74 | let key_bindings_path = format!("{}/resources/input.ron", app_root); 75 | 76 | let pipe = Pipeline::build().with_stage( 77 | Stage::with_backbuffer() 78 | //21 38 66 79 | .clear_target([21.0 / 255.0, 38.0 / 255.0, 66.0 / 255.0, 1.0], 1.0) 80 | .with_pass(DrawSprite::new().with_transparency( 81 | ColorMask::all(), 82 | ALPHA, 83 | Some(DepthMode::LessEqualWrite), 84 | )) 85 | .with_pass(DrawUi::new()), 86 | ); 87 | let game_data = GameDataBuilder::default() 88 | .with_bundle(AnimationBundle::::new( 89 | "animation_control_system", 90 | "sampler_interpolation_system", 91 | ))? 92 | .with_bundle( 93 | InputBundle::::new().with_bindings_from_file(&key_bindings_path)?, 94 | )? 95 | .with_bundle(GameBundle)? 96 | .with_bundle(TransformBundle::new().with_dep(&["xto_movement"]))? 97 | .with_bundle(UiBundle::::new())? 98 | .with_bundle(AudioBundle::new(|_: &mut NoMusic| None))? 99 | //.with(Processor::::new(), "source_processor", &[]) 100 | .with_bundle( 101 | RenderBundle::new(pipe, Some(display_config)) 102 | .with_sprite_sheet_processor() 103 | .with_sprite_visibility_sorting(&["transform_system"]), 104 | )?; 105 | 106 | let game_state = Load::default(); 107 | 108 | let controllers: HashMap = HashMap::new(); 109 | let mut game = Application::build(assets_directory, game_state)? 110 | .with_resource(Arc::new(Mutex::new(controllers))) 111 | .with_resource(channel) 112 | .with_resource(matches) 113 | .with_resource(NoMusic) 114 | .with_frame_limit( 115 | FrameRateLimitStrategy::SleepAndYield(Duration::from_millis(2)), 116 | 30, 117 | ) 118 | .build(game_data)?; 119 | game.run(); 120 | Ok(()) 121 | } 122 | -------------------------------------------------------------------------------- /src/bin/tool.rs: -------------------------------------------------------------------------------- 1 | #![feature(box_patterns)] 2 | #![feature(exclusive_range_pattern)] 3 | #![feature(type_ascription)] 4 | 5 | use clap::{App, Arg, SubCommand}; 6 | use nk_data::*; 7 | use ron::de::from_reader; 8 | use std::fs::File; 9 | 10 | fn main() { 11 | let map_sub = SubCommand::with_name("map") 12 | .version("0.1.0") 13 | .author("Tiago Nascimento ") 14 | .about("NK maps tool") 15 | .arg( 16 | Arg::with_name("map") 17 | .short("m") 18 | .long("map") 19 | .value_name("MAP_FILE") 20 | .help("Specifies which map to open as default") 21 | .takes_value(true) 22 | .multiple(true), 23 | ); 24 | 25 | let data_sub = SubCommand::with_name("data") 26 | .version("0.1.0") 27 | .author("Tiago Nascimento ") 28 | .about("NK data tool") 29 | .arg( 30 | Arg::with_name("flavor") 31 | .short("f") 32 | .long("flavor") 33 | .value_name("RON_FILE") 34 | .help("Specifies the file from which to try and parse flavor definitions from") 35 | .takes_value(true) 36 | .multiple(true), 37 | ) 38 | .arg( 39 | Arg::with_name("preparation") 40 | .short("p") 41 | .long("preparation") 42 | .value_name("RON_FILE") 43 | .help("Specifies the file from which to try and parse preparation definitions from") 44 | .takes_value(true) 45 | .multiple(true), 46 | ) 47 | .arg( 48 | Arg::with_name("topping") 49 | .short("t") 50 | .long("topping") 51 | .value_name("RON_FILE") 52 | .help("Specifies the file from which to try and parse topping definitions from") 53 | .takes_value(true) 54 | .multiple(true), 55 | ) 56 | .arg( 57 | Arg::with_name("hissatsu") 58 | .long("hissatsu") 59 | .value_name("RON_FILE") 60 | .help("Specifies the file from which to try and parse hissatsu definitions from") 61 | .takes_value(true) 62 | .multiple(true), 63 | ) 64 | .arg( 65 | Arg::with_name("house") 66 | .long("house") 67 | .value_name("RON_FILE") 68 | .help("Specifies the file from which to try and parse house definitions from") 69 | .takes_value(true) 70 | .multiple(true), 71 | ) 72 | .arg( 73 | Arg::with_name("team") 74 | .long("team") 75 | .value_name("RON_FILE") 76 | .help("Specifies the file from which to try and parse team definitions from") 77 | .takes_value(true) 78 | .multiple(true), 79 | ) 80 | .arg( 81 | Arg::with_name("player") 82 | .long("player") 83 | .value_name("RON_FILE") 84 | .help("Specifies the file from which to try and parse player definitions from") 85 | .takes_value(true) 86 | .multiple(true), 87 | ); 88 | 89 | let matches = App::new("Naisu Kurimu") 90 | .version("preview-003") 91 | .author("Tiago Nascimento ") 92 | .about("Ferramentas do Jogo Naisu Kurimu") 93 | .subcommand(map_sub) 94 | .subcommand(data_sub) 95 | .get_matches(); 96 | 97 | if let Some(_map_matches) = matches.subcommand_matches("map") { 98 | println!("[ERROR] map not implemented!"); 99 | } 100 | 101 | if let Some(data_matches) = matches.subcommand_matches("data") { 102 | if let Some(flavors) = data_matches.values_of("flavor") { 103 | flavors.into_iter().for_each(move |path| { 104 | println!("[INFO] file '{}'", path); 105 | if match from_reader(File::open(&path).expect("[ERROR] failed to open!")): 106 | Result, _> 107 | { 108 | Ok(x) => { 109 | let mut res = false; 110 | if x.iter().any(|f: &FlavorDef| f.key.is_empty()) { 111 | res = true; 112 | println!("[WARNING] flavors with empty keys detected!"); 113 | } 114 | res 115 | } 116 | Err(e) => { 117 | println!("[ERROR] could not parse file as flavor definition: {}", e); 118 | return; 119 | } 120 | } { 121 | println!("[WARNING] file has been correctly parsed but has problems!"); 122 | } else { 123 | println!("[INFO] file is valid!"); 124 | } 125 | }); 126 | } 127 | 128 | if let Some(preparations) = data_matches.values_of("preparation") { 129 | preparations.into_iter().for_each(move |path| { 130 | println!("[INFO] file '{}'", path); 131 | if match from_reader(File::open(&path).expect("[ERROR] failed to open!")): 132 | Result, _> 133 | { 134 | Ok(x) => { 135 | let mut res = false; 136 | if x.iter().any(|p: &PreparationDef| p.key.is_empty()) { 137 | res = true; 138 | println!("[WARNING] preparations with empty keys detected!"); 139 | } 140 | res 141 | } 142 | Err(e) => { 143 | println!( 144 | "[ERROR] could not parse file as preparation definition: {}", 145 | e 146 | ); 147 | return; 148 | } 149 | } { 150 | println!("[WARNING] file has been correctly parsed but has problems!"); 151 | } else { 152 | println!("[INFO] file is valid!"); 153 | } 154 | }); 155 | } 156 | 157 | if let Some(toppings) = data_matches.values_of("topping") { 158 | toppings.into_iter().for_each(move |path| { 159 | println!("[INFO] file '{}'", path); 160 | if match from_reader(File::open(&path).expect("[ERROR] failed to open!")): 161 | Result, _> 162 | { 163 | Ok(x) => { 164 | let mut res = false; 165 | if x.iter().any(|t: &ToppingDef| t.key.is_empty()) { 166 | res = true; 167 | println!("[WARNING] toppings with empty keys detected!"); 168 | } 169 | res 170 | } 171 | Err(e) => { 172 | println!("[ERROR] could not parse file as topping definition: {}", e); 173 | return; 174 | } 175 | } { 176 | println!("[WARNING] file has been correctly parsed but has problems!"); 177 | } else { 178 | println!("[INFO] file is valid!"); 179 | } 180 | }); 181 | } 182 | 183 | if let Some(_hissatsu) = data_matches.values_of("hissatsu") { 184 | println!("[ERROR] hissatsu not implemented!"); 185 | } 186 | 187 | if let Some(_houses) = data_matches.values_of("house") { 188 | println!("[ERROR] house not implemented!"); 189 | } 190 | 191 | if let Some(_teams) = data_matches.values_of("team") { 192 | println!("[ERROR] team not implemented!"); 193 | } 194 | 195 | if let Some(_players) = data_matches.values_of("player") { 196 | println!("[ERROR] player not implemented!"); 197 | } 198 | } 199 | } 200 | -------------------------------------------------------------------------------- /src/data/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "nk_data" 3 | description = "Game made for IGMC 2018 by MGDA" 4 | version = "0.1.0" 5 | authors = ["Tiago Nascimento "] 6 | edition = "2018" 7 | 8 | homepage = "https://gamedev.maringa.br/igmc-2018" 9 | documentation = "https://gamedev.maringa.br/igmc-2018/docs/nk_data" 10 | repository = "https://github.com/maringa-gamedev/rust-igmc-2018" 11 | 12 | readme = "README.md" 13 | license = "AGPLv3" 14 | 15 | [features] 16 | nightly = ["amethyst/nightly"] 17 | 18 | [dependencies] 19 | amethyst = { git = "https://github.com/amethyst/amethyst.git" } 20 | serde = "1.0" 21 | serde_derive = "1.0" 22 | log = "0.4" 23 | either = "1.5" 24 | -------------------------------------------------------------------------------- /src/data/src/animation.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{renderer::SpriteSheetHandle, ui::FontHandle}; 2 | use serde_derive::*; 3 | use std::collections::HashMap; 4 | 5 | #[derive(Debug, Serialize, Deserialize)] 6 | pub struct AnimationFrame(pub String, pub f32); 7 | #[derive(Debug, Serialize, Deserialize)] 8 | pub struct AnimationDef(pub Vec, pub AnimationLoop); 9 | 10 | #[derive(Debug)] 11 | pub struct Animation { 12 | pub vec: Vec<(usize, f32, f32, f32)>, // index, duration, end_time, rev_end_time 13 | pub loop_type: AnimationLoop, 14 | pub timer: f32, 15 | handle: SpriteSheetHandle, 16 | total_time: f32, 17 | bounce: bool, 18 | first: bool, 19 | } 20 | 21 | #[derive(Clone, Copy, Debug, Serialize, Deserialize)] 22 | pub enum AnimationLoop { 23 | Circular, 24 | Bounce, 25 | Once, 26 | } 27 | 28 | impl Animation { 29 | pub fn new( 30 | handle: SpriteSheetHandle, 31 | vec: Vec<(usize, f32)>, 32 | loop_type: AnimationLoop, 33 | ) -> Self { 34 | let total_time = vec.iter().fold(0.0, |acc, e| acc + e.1); 35 | let mut acc = 0.0; 36 | Animation { 37 | vec: vec 38 | .iter() 39 | .map(|(i, d)| { 40 | let rev = total_time - acc; 41 | acc += d; 42 | (*i, *d, acc, rev) 43 | }) 44 | .collect(), 45 | loop_type, 46 | handle, 47 | timer: 0.0, 48 | total_time, 49 | bounce: false, 50 | first: true, 51 | } 52 | } 53 | 54 | pub fn with_same_frame_step( 55 | handle: SpriteSheetHandle, 56 | vec: Vec, 57 | loop_type: AnimationLoop, 58 | frame_step: f32, 59 | ) -> Self { 60 | let total_time = vec.len() as f32 * frame_step; 61 | let mut acc = 0.0; 62 | Animation { 63 | vec: vec 64 | .iter() 65 | .map(|e| { 66 | let rev = total_time - acc; 67 | acc += frame_step; 68 | (*e, frame_step, acc, rev) 69 | }) 70 | .collect(), 71 | loop_type, 72 | handle, 73 | timer: 0.0, 74 | total_time, 75 | bounce: false, 76 | first: true, 77 | } 78 | } 79 | 80 | pub fn reset(&mut self) { 81 | self.timer = 0.0; 82 | self.first = true; 83 | } 84 | 85 | pub fn update_timer(&mut self, delta: f32) { 86 | self.timer += delta; 87 | while self.timer > self.total_time { 88 | self.timer -= self.total_time; 89 | self.bounce = !self.bounce; 90 | self.first = false; 91 | } 92 | } 93 | 94 | pub fn get_frame(&self) -> usize { 95 | match self.loop_type { 96 | AnimationLoop::Circular => self.vec.iter().find(|&&a| self.timer < a.2).unwrap().0, 97 | AnimationLoop::Bounce => { 98 | if self.bounce { 99 | self.vec 100 | .iter() 101 | .rev() 102 | .find(|&&a| self.timer < a.3) 103 | .unwrap() 104 | .0 105 | } else { 106 | self.vec.iter().find(|&&a| self.timer < a.2).unwrap().0 107 | } 108 | } 109 | AnimationLoop::Once => { 110 | if self.first { 111 | self.vec.iter().find(|&&a| self.timer < a.2).unwrap().0 112 | } else { 113 | self.vec.iter().last().unwrap().0 114 | } 115 | } 116 | } 117 | } 118 | 119 | pub fn get_frame_at(&self, timer: f32, rev: bool) -> usize { 120 | match rev { 121 | true => { 122 | self.vec 123 | .iter() 124 | .rev() 125 | .find(|&&a| timer < a.3) 126 | .unwrap_or(self.vec.iter().rev().last().unwrap()) 127 | .0 128 | } 129 | false => { 130 | self.vec 131 | .iter() 132 | .find(|&&a| timer < a.2) 133 | .unwrap_or(self.vec.iter().last().unwrap()) 134 | .0 135 | } 136 | } 137 | } 138 | 139 | pub fn obtain_handle(&self) -> SpriteSheetHandle { 140 | self.handle.clone() 141 | } 142 | } 143 | 144 | pub struct Animations { 145 | pub animations: HashMap, 146 | } 147 | 148 | impl Default for Animations { 149 | fn default() -> Self { 150 | Animations { 151 | animations: HashMap::new(), 152 | } 153 | } 154 | } 155 | 156 | pub struct Handles { 157 | pub player_handle: SpriteSheetHandle, 158 | pub items_handle: SpriteSheetHandle, 159 | pub map_handle: SpriteSheetHandle, 160 | pub bg_handle: SpriteSheetHandle, 161 | pub empty_handle: SpriteSheetHandle, 162 | pub hud_handle: SpriteSheetHandle, 163 | pub buttons_handle: SpriteSheetHandle, 164 | pub progress_handle: SpriteSheetHandle, 165 | pub score_font: SpriteSheetHandle, 166 | pub timer_font: SpriteSheetHandle, 167 | } 168 | -------------------------------------------------------------------------------- /src/data/src/common.rs: -------------------------------------------------------------------------------- 1 | use super::constants::*; 2 | use serde_derive::*; 3 | 4 | #[derive(Debug, Eq, PartialEq, Serialize, Deserialize)] 5 | pub enum FlavorClass { 6 | Classic, 7 | Sherbert, 8 | Special, 9 | } 10 | 11 | #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)] 12 | pub struct FlavorIndex(pub usize); 13 | #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)] 14 | pub struct ToppingIndex(pub usize); 15 | #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)] 16 | pub struct PreparationIndex(pub usize); 17 | #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)] 18 | pub struct HissatsuIndex(pub usize); 19 | #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)] 20 | pub struct TeamIndex(pub usize); 21 | #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)] 22 | pub struct HouseIndex(pub usize); 23 | #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)] 24 | pub struct PlayerIndex(pub usize); 25 | 26 | #[derive(PartialEq, Eq, Clone, Copy)] 27 | pub enum Cardinal { 28 | North, // Up 29 | NorthWest, // Up Left 30 | NorthEast, // Up Right 31 | 32 | South, // Down 33 | SouthWest, // Down Left 34 | SouthEast, // Down Right 35 | 36 | West, // Left 37 | East, // Right 38 | } 39 | 40 | impl Cardinal { 41 | pub fn get_x(&self) -> f32 { 42 | match self { 43 | Cardinal::West => -1.0, 44 | Cardinal::NorthWest => -0.7071, 45 | Cardinal::SouthWest => -0.7071, 46 | 47 | Cardinal::East => 1.0, 48 | Cardinal::NorthEast => 0.7071, 49 | Cardinal::SouthEast => 0.7071, 50 | 51 | Cardinal::North => 0.0, 52 | Cardinal::South => 0.0, 53 | } 54 | } 55 | 56 | pub fn get_y(&self) -> f32 { 57 | match self { 58 | Cardinal::North => 1.0, 59 | Cardinal::NorthWest => 0.7071, 60 | Cardinal::NorthEast => 0.7071, 61 | 62 | Cardinal::South => -1.0, 63 | Cardinal::SouthWest => -0.7071, 64 | Cardinal::SouthEast => -0.7071, 65 | 66 | Cardinal::West => 0.0, 67 | Cardinal::East => 0.0, 68 | } 69 | } 70 | 71 | pub fn make_interaction_offset_x(&self) -> f32 { 72 | match self { 73 | Cardinal::North => 0.0, 74 | Cardinal::NorthWest => -BASE / 2.0, 75 | Cardinal::NorthEast => BASE / 2.0, 76 | 77 | Cardinal::South => 0.0, 78 | Cardinal::SouthWest => -BASE / 2.0, 79 | Cardinal::SouthEast => BASE / 2.0, 80 | 81 | Cardinal::West => -BASE / 2.0, 82 | Cardinal::East => BASE / 2.0, 83 | } 84 | } 85 | 86 | pub fn make_interaction_offset_y(&self) -> f32 { 87 | match self { 88 | Cardinal::North => BASE / 2.0, 89 | Cardinal::NorthWest => BASE / 2.0, 90 | Cardinal::NorthEast => BASE / 2.0, 91 | 92 | Cardinal::South => -BASE / 2.0, 93 | Cardinal::SouthWest => -BASE / 2.0, 94 | Cardinal::SouthEast => -BASE / 2.0, 95 | 96 | Cardinal::West => 0.0, 97 | Cardinal::East => 0.0, 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/data/src/constants.rs: -------------------------------------------------------------------------------- 1 | pub const VIEW_WIDTH: f32 = 480.0; 2 | pub const VIEW_HEIGHT: f32 = 272.0; 3 | 4 | pub const SPRITE_WIDTH: f32 = 48.0; 5 | pub const SPRITE_HEIGHT: f32 = 48.0; 6 | pub const PLAYER_HITBOX_WIDTH: f32 = 16.0; 7 | pub const PLAYER_HITBOX_HEIGHT: f32 = 16.0; 8 | 9 | pub const TILE_WIDTH: f32 = 16.0; 10 | pub const TILE_HEIGHT: f32 = 16.0; 11 | 12 | pub const BASE: f32 = 16.0; 13 | 14 | pub const MAP_WIDTH: f32 = 480.0; 15 | pub const MAP_HEIGHT: f32 = 272.0; 16 | pub const MAP_OFFSET_X: f32 = 3.5 * BASE; 17 | pub const MAP_OFFSET_Y: f32 = 3.0 * BASE; 18 | 19 | //pub const ENEMY_RADIUS: f32 = 0.8125; 20 | //pub const PLAYER_RADIUS: f32 = 0.4375; 21 | //pub const BULLET_RADIUS: f32 = 0.0625; 22 | 23 | //pub const LAYER_MAP_GROUND: f32 = -1019.0; 24 | //pub const LAYER_PLAYER_FOUR: f32 = -9.0; 25 | //pub const LAYER_FRONT_PLAYER_FOUR: f32 = -8.0; 26 | //pub const LAYER_PLAYER_THREE: f32 = -7.0; 27 | //pub const LAYER_FRONT_PLAYER_THREE: f32 = -6.0; 28 | //pub const LAYER_PLAYER_TWO: f32 = -5.0; 29 | //pub const LAYER_FRONT_PLAYER_TWO: f32 = -4.0; 30 | //pub const LAYER_PLAYER_ONE: f32 = -3.0; 31 | //pub const LAYER_FRONT_PLAYER_ONE: f32 = -2.0; 32 | //pub const LAYER_FRONT_ALL: f32 = -1.0; 33 | 34 | //pub const LAYER_PUT_IN_FRONT: f32 = 1.0; 35 | //pub const LAYER_PUT_BEHIND: f32 = -1.0; 36 | 37 | pub const PLAYERS_TEXTURE_INDEX: u64 = 0; 38 | pub const MAP_INDEX: u64 = 1; 39 | pub const ITEMS_TEXTURE_INDEX: u64 = 2; 40 | pub const UI_TEXTURE_INDEX: u64 = 3; 41 | -------------------------------------------------------------------------------- /src/data/src/effect.rs: -------------------------------------------------------------------------------- 1 | use super::common::*; 2 | use serde_derive::*; 3 | 4 | #[derive(Debug, Serialize, Deserialize)] 5 | pub enum FloatValue { 6 | Fixed(f32), 7 | Random(f32, f32), 8 | } 9 | 10 | #[derive(Debug, Serialize, Deserialize)] 11 | pub enum DurationValue { 12 | Indeterminate, 13 | Fixed(f32), 14 | Random(f32, f32), 15 | } 16 | 17 | #[derive(Debug, Serialize, Deserialize)] 18 | pub enum TeamMember { 19 | Captain, 20 | ScooperOne, 21 | ScooperTwo, 22 | Server, 23 | } 24 | 25 | #[derive(Debug, Serialize, Deserialize)] 26 | pub enum MemberCount { 27 | One, 28 | Two, 29 | Three, 30 | } 31 | 32 | #[derive(Debug, Serialize, Deserialize)] 33 | pub enum FilterQuantity { 34 | WholeTeam, 35 | One(TeamMember), 36 | Two(TeamMember, TeamMember), 37 | Three(TeamMember, TeamMember, TeamMember), 38 | Random(MemberCount), 39 | } 40 | 41 | #[derive(Debug, Serialize, Deserialize)] 42 | pub enum TeamSide { 43 | Partner, 44 | Adversary, 45 | } 46 | 47 | #[derive(Debug, Serialize, Deserialize)] 48 | pub enum EffectFilter { 49 | Carrier, 50 | Team(TeamSide, FilterQuantity), 51 | } 52 | 53 | #[derive(Debug, Serialize, Deserialize)] 54 | pub enum EffectCondition { 55 | Alone, 56 | CombinedWithFlavor(Vec), 57 | CombinedWithClass(Vec), 58 | } 59 | 60 | #[derive(Debug, Serialize, Deserialize)] 61 | pub enum Color { 62 | Red, 63 | Yellow, 64 | Green, 65 | } 66 | 67 | #[derive(Debug, Serialize, Deserialize)] 68 | pub enum ScreenEffect { 69 | CreamClouds, 70 | Dizzy, 71 | Pulse(Color), 72 | } 73 | 74 | #[derive(Debug, Serialize, Deserialize)] 75 | pub enum EffectDefinition { 76 | OrderTotalScore(FloatValue), 77 | Speed(EffectFilter, FloatValue, DurationValue), 78 | OrderMeltTimer(FloatValue), 79 | GlobalMeltSpeed(TeamSide, FloatValue), 80 | PowerMeterFlatBonus(TeamSide, FloatValue), 81 | BlockSpecial(DurationValue), 82 | Screen(ScreenEffect, TeamSide, DurationValue), 83 | Negate, 84 | } 85 | -------------------------------------------------------------------------------- /src/data/src/flavor.rs: -------------------------------------------------------------------------------- 1 | use super::{common::*, effect::*}; 2 | use serde_derive::*; 3 | 4 | #[derive(Debug, Serialize, Deserialize)] 5 | pub struct FlavorDef { 6 | pub index: FlavorIndex, 7 | pub key: String, 8 | pub class: FlavorClass, 9 | pub base_worth: f32, 10 | pub effect: Vec, 11 | pub condition: Vec, 12 | pub weights: [usize; 7], 13 | } 14 | -------------------------------------------------------------------------------- /src/data/src/gameplay.rs: -------------------------------------------------------------------------------- 1 | use super::{common::*, order::*}; 2 | use amethyst::ecs::prelude::*; 3 | 4 | #[derive(Debug)] 5 | pub struct Team { 6 | pub captain: Entity, 7 | pub server: Entity, 8 | pub scooper_one: Option, 9 | pub scooper_two: Option, 10 | pub flavors: Vec, 11 | pub preparations: Vec, 12 | pub toppings: Vec, 13 | pub power_meter: f32, 14 | pub score: isize, 15 | pub orders: Vec, 16 | pub parent: Entity, 17 | } 18 | 19 | #[derive(Debug, Default)] 20 | pub struct Match { 21 | pub teams: Vec, 22 | pub flavors: Vec, 23 | pub preparations: Vec, 24 | pub toppings: Vec, 25 | pub order_gen_timer: f32, 26 | pub timer: f32, 27 | } 28 | -------------------------------------------------------------------------------- /src/data/src/hissatsu.rs: -------------------------------------------------------------------------------- 1 | use super::common::*; 2 | use serde_derive::*; 3 | 4 | #[derive(Debug, Serialize, Deserialize)] 5 | pub struct HissatsuDef { 6 | pub index: HissatsuIndex, 7 | pub key: String, 8 | } 9 | -------------------------------------------------------------------------------- /src/data/src/house.rs: -------------------------------------------------------------------------------- 1 | use super::common::*; 2 | use serde_derive::*; 3 | 4 | #[derive(Debug, Serialize, Deserialize)] 5 | pub struct HouseDef { 6 | pub index: HouseIndex, 7 | pub key: String, 8 | } 9 | -------------------------------------------------------------------------------- /src/data/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod animation; 2 | mod common; 3 | mod constants; 4 | mod effect; 5 | mod flavor; 6 | mod gameplay; 7 | mod hissatsu; 8 | mod house; 9 | mod map; 10 | mod order; 11 | mod player; 12 | mod preparation; 13 | mod sound; 14 | mod sprite_folder; 15 | mod team; 16 | mod texture; 17 | mod topping; 18 | mod ui; 19 | 20 | mod def { 21 | #[derive(Debug, Default)] 22 | pub struct Definitions { 23 | flavors: Vec, 24 | preparations: Vec, 25 | toppings: Vec, 26 | hissatsu: Vec, 27 | houses: Vec, 28 | teams: Vec, 29 | players: Vec, 30 | } 31 | 32 | impl Definitions { 33 | pub fn new(f: Vec, p: Vec, t: Vec) -> Self { 34 | Definitions { 35 | flavors: f, 36 | preparations: p, 37 | toppings: t, 38 | hissatsu: Vec::new(), 39 | houses: Vec::new(), 40 | teams: Vec::new(), 41 | players: Vec::new(), 42 | } 43 | } 44 | 45 | pub fn flavors(&self) -> std::slice::Iter { 46 | self.flavors.iter() 47 | } 48 | 49 | pub fn preparations(&self) -> std::slice::Iter { 50 | self.preparations.iter() 51 | } 52 | 53 | pub fn toppings(&self) -> std::slice::Iter { 54 | self.toppings.iter() 55 | } 56 | } 57 | 58 | pub use super::{ 59 | flavor::FlavorDef, hissatsu::HissatsuDef, house::HouseDef, player::PlayerDef, 60 | preparation::PreparationDef, team::TeamDef, topping::ToppingDef, 61 | }; 62 | } 63 | 64 | pub use self::{ 65 | animation::*, common::*, constants::*, def::*, effect::*, flavor::*, gameplay::*, hissatsu::*, 66 | house::*, map::*, order::*, player::*, preparation::*, sound::*, sprite_folder::*, team::*, 67 | texture::*, topping::*, ui::*, 68 | }; 69 | -------------------------------------------------------------------------------- /src/data/src/map.rs: -------------------------------------------------------------------------------- 1 | use amethyst::core::cgmath::*; 2 | use serde_derive::*; 3 | 4 | #[derive(Debug, Clone, Serialize, Deserialize)] 5 | pub enum TableOrientation { 6 | VerticalLeft, 7 | VerticalRight, 8 | HorizontalTop, 9 | HorizontalBottom, 10 | } 11 | 12 | impl Default for TableOrientation { 13 | fn default() -> Self { 14 | TableOrientation::HorizontalBottom 15 | } 16 | } 17 | 18 | impl TableOrientation { 19 | pub fn flip_vertical(&self) -> bool { 20 | match self { 21 | TableOrientation::VerticalLeft => true, 22 | TableOrientation::VerticalRight => false, 23 | TableOrientation::HorizontalTop => true, 24 | TableOrientation::HorizontalBottom => false, 25 | } 26 | } 27 | 28 | pub fn make_dim(&self, w: f32, h: f32) -> (f32, f32) { 29 | match self { 30 | TableOrientation::VerticalLeft => (h, w), 31 | TableOrientation::VerticalRight => (h, w), 32 | TableOrientation::HorizontalTop => (w, h), 33 | TableOrientation::HorizontalBottom => (w, h), 34 | } 35 | } 36 | 37 | pub fn make_rot(&self) -> Deg { 38 | match self { 39 | TableOrientation::VerticalLeft => Deg(90.0), 40 | TableOrientation::VerticalRight => Deg(90.0), 41 | TableOrientation::HorizontalTop => Deg(0.0), 42 | TableOrientation::HorizontalBottom => Deg(0.0), 43 | } 44 | } 45 | 46 | pub fn make_scale(&self) -> f32 { 47 | match self { 48 | TableOrientation::VerticalLeft => 1.0, 49 | TableOrientation::VerticalRight => 1.0, 50 | TableOrientation::HorizontalTop => 2.0, 51 | TableOrientation::HorizontalBottom => 2.0, 52 | } 53 | } 54 | 55 | pub fn hitbox_height_multiplier(&self) -> f32 { 56 | match self { 57 | TableOrientation::VerticalLeft => 0.75, 58 | TableOrientation::VerticalRight => 0.75, 59 | TableOrientation::HorizontalTop => 0.5, 60 | TableOrientation::HorizontalBottom => 0.5, 61 | } 62 | } 63 | 64 | pub fn make_orientation_string(&self) -> String { 65 | match self { 66 | TableOrientation::VerticalLeft => String::from("v"), 67 | TableOrientation::VerticalRight => String::from("v"), 68 | TableOrientation::HorizontalTop => String::from("h"), 69 | TableOrientation::HorizontalBottom => String::from("h"), 70 | } 71 | } 72 | } 73 | 74 | #[derive(Debug, Clone, Serialize, Deserialize)] 75 | pub struct Priority(pub usize); 76 | 77 | #[derive(Debug, Clone, Serialize, Deserialize)] 78 | pub enum TableType { 79 | Flavor(Priority), 80 | Preparation(Priority), 81 | Topping(Priority), 82 | Delivery, 83 | Empty, 84 | } 85 | 86 | impl Default for TableType { 87 | fn default() -> Self { 88 | TableType::Empty 89 | } 90 | } 91 | 92 | #[derive(Debug, Clone, Default, Serialize, Deserialize)] 93 | pub struct MapDefinition { 94 | pub tables: Vec<(f32, f32, TableType, TableOrientation)>, 95 | pub spawns: Vec<(f32, f32)>, 96 | } 97 | 98 | impl MapDefinition { 99 | pub fn count_flavor_tables(&self) -> usize { 100 | self.tables 101 | .iter() 102 | .filter(|t| { 103 | if let TableType::Flavor(_) = t.2 { 104 | true 105 | } else { 106 | false 107 | } 108 | }) 109 | .count() 110 | } 111 | 112 | pub fn count_preparation_tables(&self) -> usize { 113 | self.tables 114 | .iter() 115 | .filter(|t| { 116 | if let TableType::Preparation(_) = t.2 { 117 | true 118 | } else { 119 | false 120 | } 121 | }) 122 | .count() 123 | } 124 | 125 | pub fn count_topping_tables(&self) -> usize { 126 | self.tables 127 | .iter() 128 | .filter(|t| { 129 | if let TableType::Topping(_) = t.2 { 130 | true 131 | } else { 132 | false 133 | } 134 | }) 135 | .count() 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /src/data/src/player.rs: -------------------------------------------------------------------------------- 1 | use super::common::*; 2 | use serde_derive::*; 3 | 4 | #[derive(Debug, Serialize, Deserialize)] 5 | pub struct PlayerDef { 6 | pub index: PlayerIndex, 7 | pub name: String, 8 | pub primary_flavor: FlavorIndex, 9 | pub secondary_flavors: Vec, 10 | pub preparations: Vec, 11 | pub toppings: Vec, 12 | pub hissatsu: Vec, 13 | pub team: Option, 14 | pub house: Option, 15 | } 16 | -------------------------------------------------------------------------------- /src/data/src/preparation.rs: -------------------------------------------------------------------------------- 1 | use super::{common::*, effect::*}; 2 | use serde_derive::*; 3 | 4 | pub type Position = (f32, f32); 5 | 6 | #[derive(Debug, Serialize, Deserialize)] 7 | pub struct PreparationFlavorOffsets { 8 | pub one: [Position; 1], 9 | pub two: [Position; 2], 10 | pub three: [Position; 3], 11 | pub four: [Position; 4], 12 | } 13 | 14 | #[derive(Debug, Serialize, Deserialize)] 15 | pub struct PreparationDef { 16 | pub index: PreparationIndex, 17 | pub key: String, 18 | pub score_multiplier: f32, 19 | pub melt_multiplier: Option, 20 | pub effect_area_multiplier: f32, 21 | pub max_scoops: usize, 22 | pub effect: Vec, 23 | pub score_multiplier_condition: Vec, 24 | pub takes_topping: bool, 25 | pub offsets: PreparationFlavorOffsets, 26 | } 27 | -------------------------------------------------------------------------------- /src/data/src/sound.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{ 2 | assets::AssetStorage, 3 | audio::{output::Output, Source, SourceHandle}, 4 | }; 5 | 6 | pub struct Sounds { 7 | pub pickup_sfx: SourceHandle, 8 | } 9 | 10 | pub fn play_pickup(sounds: &Sounds, storage: &AssetStorage, output: Option<&Output>) { 11 | if let Some(ref output) = output.as_ref() { 12 | if let Some(sound) = storage.get(&sounds.pickup_sfx) { 13 | output.play_once(sound, 1.0); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/data/src/sprite_folder.rs: -------------------------------------------------------------------------------- 1 | use super::animation::*; 2 | use serde_derive::*; 3 | use std::collections::HashMap; 4 | 5 | #[derive(Debug, Serialize, Deserialize)] 6 | pub struct TextureSlice(pub String, pub f32, pub f32, pub f32, pub f32); 7 | 8 | #[derive(Debug, Serialize, Deserialize)] 9 | pub struct SpriteFolderDef { 10 | pub keys: Vec, 11 | pub path: String, 12 | pub width: f32, 13 | pub height: f32, 14 | pub sprites: Vec, 15 | pub anims: HashMap, 16 | } 17 | -------------------------------------------------------------------------------- /src/data/src/team.rs: -------------------------------------------------------------------------------- 1 | use super::common::*; 2 | use serde_derive::*; 3 | 4 | #[derive(Debug, Serialize, Deserialize)] 5 | pub struct TeamDef { 6 | pub index: TeamIndex, 7 | pub key: String, 8 | } 9 | -------------------------------------------------------------------------------- /src/data/src/texture.rs: -------------------------------------------------------------------------------- 1 | use amethyst::renderer::SpriteSheetHandle; 2 | use serde_derive::*; 3 | use std::collections::HashMap; 4 | 5 | #[derive(Debug, Default, Serialize, Deserialize)] 6 | pub struct TextureDefinition { 7 | pub path: String, 8 | pub width: f32, 9 | pub height: f32, 10 | pub sprites: Vec<(String, f32, f32, f32, f32)>, 11 | } 12 | 13 | #[derive(Debug)] 14 | pub struct SpriteDefinition { 15 | pub handle: SpriteSheetHandle, 16 | pub sprites: HashMap, 17 | } 18 | -------------------------------------------------------------------------------- /src/data/src/topping.rs: -------------------------------------------------------------------------------- 1 | use super::{common::*, effect::*}; 2 | use serde_derive::*; 3 | 4 | pub type Position = (f32, f32); 5 | 6 | #[derive(Debug, Serialize, Deserialize)] 7 | pub struct ToppingFlavorOffsets { 8 | pub one: Position, 9 | pub two: Position, 10 | pub three: Position, 11 | pub four: Position, 12 | } 13 | 14 | #[derive(Debug, Serialize, Deserialize)] 15 | pub struct ToppingDef { 16 | pub index: ToppingIndex, 17 | pub key: String, 18 | pub worth: f32, 19 | pub effect: Vec, 20 | pub offsets: ToppingFlavorOffsets, 21 | } 22 | -------------------------------------------------------------------------------- /src/data/src/ui.rs: -------------------------------------------------------------------------------- 1 | use crate::common::*; 2 | use serde_derive::*; 3 | 4 | #[derive(Debug, Serialize, Deserialize)] 5 | pub enum UiSide { 6 | Top, 7 | Left, 8 | Bottom, 9 | Right, 10 | } 11 | 12 | #[derive(Debug, Serialize, Deserialize)] 13 | pub enum UiCorner { 14 | TopLeft, 15 | TopRight, 16 | BottomLeft, 17 | BottomRight, 18 | } 19 | 20 | #[derive(Debug, Serialize, Deserialize)] 21 | pub enum UiAction { 22 | Back, 23 | Confirm, 24 | } 25 | 26 | #[derive(Debug, Serialize, Deserialize)] 27 | pub enum UiSize { 28 | Small, 29 | Big, 30 | } 31 | 32 | #[derive(Debug, Serialize, Deserialize)] 33 | pub enum UiIndex { 34 | Previous, 35 | Current, 36 | Next, 37 | } 38 | 39 | #[derive(Debug, Serialize, Deserialize)] 40 | pub enum UiDirection { 41 | Previous, 42 | Next, 43 | } 44 | 45 | #[derive(Debug, Serialize, Deserialize)] 46 | pub enum UiSprite { 47 | FullCorner(UiCorner), 48 | HalfCorner(UiCorner), 49 | CutCorner(UiCorner), 50 | ConnectCorner(UiCorner), 51 | FullSide(UiSide), 52 | HalfSide(UiSide), 53 | Center, 54 | Button(UiAction), 55 | ToggleFlavor(usize, usize, FlavorIndex), 56 | TogglePreparation(usize, usize, PreparationIndex), 57 | ToggleTopping(usize, usize, ToppingIndex), 58 | MapPreview(UiIndex), 59 | Arrow(UiDirection), 60 | } 61 | 62 | #[derive(Debug, Serialize, Deserialize)] 63 | pub struct UiElement(pub f32, pub f32, pub UiSprite); 64 | 65 | #[derive(Debug, Serialize, Deserialize)] 66 | pub struct UiDefinition { 67 | pub sprites: Vec, 68 | } 69 | -------------------------------------------------------------------------------- /src/ecs/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "nk_ecs" 3 | description = "Game made for IGMC 2018 by MGDA" 4 | version = "0.1.0" 5 | authors = ["Tiago Nascimento "] 6 | edition = "2018" 7 | 8 | homepage = "https://gamedev.maringa.br/igmc-2018" 9 | documentation = "https://gamedev.maringa.br/igmc-2018/docs/nk_ecs" 10 | repository = "https://github.com/maringa-gamedev/rust-igmc-2018" 11 | 12 | readme = "README.md" 13 | license = "AGPLv3" 14 | 15 | [features] 16 | nightly = ["amethyst/nightly"] 17 | 18 | [dependencies] 19 | nk_data = { path = "../data/", version="0.1.0" } 20 | amethyst = { git = "https://github.com/amethyst/amethyst.git" } 21 | serde = "1.0" 22 | serde_derive = "1.0" 23 | log = "0.4" 24 | either = "1.5" 25 | rand = "0.6" 26 | font-kit = "0.1" 27 | gilrs = "0.6" 28 | nalgebra = "0.16" 29 | ncollide2d = "0.17" 30 | itertools = "0.7" 31 | image = "0.20" 32 | shred= "0.7" 33 | shred-derive = "0.5" 34 | -------------------------------------------------------------------------------- /src/ecs/src/component.rs: -------------------------------------------------------------------------------- 1 | mod animation; 2 | mod background; 3 | mod direction; 4 | mod effect; 5 | mod hitbox; 6 | mod input; 7 | mod interact; 8 | mod interaction; 9 | mod inventory_item; 10 | mod layered; 11 | mod pixel_perfect; 12 | mod player; 13 | mod score; 14 | mod solid; 15 | mod table; 16 | mod ui; 17 | mod velocity; 18 | 19 | pub use self::{ 20 | animation::*, background::*, direction::*, effect::*, hitbox::*, input::*, interact::*, 21 | interaction::*, inventory_item::*, layered::*, pixel_perfect::*, player::*, score::*, solid::*, 22 | table::*, ui::*, velocity::*, 23 | }; 24 | -------------------------------------------------------------------------------- /src/ecs/src/component/animation.rs: -------------------------------------------------------------------------------- 1 | use amethyst::ecs::prelude::*; 2 | 3 | pub struct AnimatedFloor(pub String); 4 | 5 | impl Component for AnimatedFloor { 6 | type Storage = DenseVecStorage; 7 | } 8 | 9 | pub struct AnimatedTable(pub String, pub String); 10 | 11 | impl Component for AnimatedTable { 12 | type Storage = DenseVecStorage; 13 | } 14 | 15 | //pub struct AnimatedSideTable; 16 | 17 | //impl Component for AnimatedSideTable { 18 | //type Storage = DenseVecStorage; 19 | //} 20 | -------------------------------------------------------------------------------- /src/ecs/src/component/background.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{core::cgmath::*, ecs::prelude::*}; 2 | 3 | pub struct Background { 4 | pub from: Vector2, 5 | pub to: Vector2, 6 | pub timer: f32, 7 | } 8 | 9 | impl Component for Background { 10 | type Storage = DenseVecStorage; 11 | } 12 | -------------------------------------------------------------------------------- /src/ecs/src/component/direction.rs: -------------------------------------------------------------------------------- 1 | use amethyst::ecs::prelude::*; 2 | use nk_data::*; 3 | 4 | pub struct Direction { 5 | pub current: Cardinal, 6 | pub previous: Option, 7 | pub current_anim: String, 8 | } 9 | 10 | impl Component for Direction { 11 | type Storage = DenseVecStorage; 12 | } 13 | -------------------------------------------------------------------------------- /src/ecs/src/component/effect.rs: -------------------------------------------------------------------------------- 1 | use amethyst::ecs::prelude::*; 2 | use ncollide2d::shape::*; 3 | 4 | pub struct Effect { 5 | pub shape: Ball, 6 | } 7 | 8 | impl Component for Effect { 9 | type Storage = DenseVecStorage; 10 | } 11 | -------------------------------------------------------------------------------- /src/ecs/src/component/hitbox.rs: -------------------------------------------------------------------------------- 1 | use amethyst::ecs::prelude::*; 2 | use either::*; 3 | use nalgebra::*; 4 | use ncollide2d::shape::*; 5 | 6 | pub struct Hitbox { 7 | pub shape: Either, Ball>, 8 | pub offset: Vector2, 9 | } 10 | 11 | impl Component for Hitbox { 12 | type Storage = DenseVecStorage; 13 | } 14 | -------------------------------------------------------------------------------- /src/ecs/src/component/input.rs: -------------------------------------------------------------------------------- 1 | use amethyst::ecs::prelude::*; 2 | use nk_data::*; 3 | 4 | pub struct Input { 5 | pub wants_to_move: Option, 6 | pub last_moved_direction: Option, 7 | pub wants_to_interact: bool, 8 | pub wants_north: bool, 9 | pub wants_south: bool, 10 | pub wants_west: bool, 11 | pub wants_east: bool, 12 | } 13 | 14 | impl Input { 15 | pub fn new() -> Self { 16 | Input { 17 | wants_to_move: None, 18 | last_moved_direction: None, 19 | wants_to_interact: false, 20 | wants_north: false, 21 | wants_south: false, 22 | wants_west: false, 23 | wants_east: false, 24 | } 25 | } 26 | } 27 | 28 | impl Component for Input { 29 | type Storage = DenseVecStorage; 30 | } 31 | -------------------------------------------------------------------------------- /src/ecs/src/component/interact.rs: -------------------------------------------------------------------------------- 1 | use amethyst::ecs::prelude::*; 2 | 3 | pub struct Interact { 4 | pub highlighted_by: Option, 5 | pub top: Entity, 6 | } 7 | 8 | impl Component for Interact { 9 | type Storage = DenseVecStorage; 10 | } 11 | -------------------------------------------------------------------------------- /src/ecs/src/component/inventory_item.rs: -------------------------------------------------------------------------------- 1 | use amethyst::ecs::prelude::*; 2 | 3 | pub struct InventoryItem(pub usize); 4 | 5 | impl Component for InventoryItem { 6 | type Storage = DenseVecStorage; 7 | } 8 | -------------------------------------------------------------------------------- /src/ecs/src/component/layered.rs: -------------------------------------------------------------------------------- 1 | use amethyst::ecs::*; 2 | 3 | pub struct Layered; 4 | 5 | impl Component for Layered { 6 | type Storage = DenseVecStorage; 7 | } 8 | -------------------------------------------------------------------------------- /src/ecs/src/component/pixel_perfect.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{core::cgmath::*, ecs::prelude::*}; 2 | 3 | pub struct PixelPerfect { 4 | pub position: Vector2, 5 | } 6 | 7 | impl Component for PixelPerfect { 8 | type Storage = DenseVecStorage; 9 | } 10 | -------------------------------------------------------------------------------- /src/ecs/src/component/player.rs: -------------------------------------------------------------------------------- 1 | use amethyst::ecs::prelude::*; 2 | use crate::component::*; 3 | use either::*; 4 | use nk_data::*; 5 | 6 | #[derive(Debug)] 7 | pub enum Style { 8 | HalfLeft, 9 | HalfRight, 10 | Full, 11 | } 12 | 13 | pub type EitherPrepTop = Either; 14 | pub type EitherInteractions = Either; 15 | 16 | pub struct Player { 17 | pub gamepad_index: usize, 18 | pub gamepad_style: Style, 19 | pub layer: f32, 20 | pub inventory: Option>, 21 | pub invert_x_axis: bool, 22 | pub team_index: usize, 23 | pub interaction: Option, 24 | pub palette_key: String, 25 | } 26 | 27 | impl Player { 28 | pub fn new( 29 | gamepad_index: usize, 30 | team_index: usize, 31 | layer: f32, 32 | invert_x_axis: bool, 33 | palette_key: String, 34 | ) -> Self { 35 | Player { 36 | gamepad_index, 37 | gamepad_style: Style::Full, 38 | layer, 39 | inventory: None, 40 | invert_x_axis, 41 | team_index, 42 | interaction: None, 43 | palette_key, 44 | } 45 | } 46 | 47 | pub fn new_with_style( 48 | gamepad_index: usize, 49 | gamepad_style: Style, 50 | team_index: usize, 51 | layer: f32, 52 | invert_x_axis: bool, 53 | palette_key: String, 54 | ) -> Self { 55 | Player { 56 | gamepad_index, 57 | gamepad_style, 58 | layer, 59 | inventory: None, 60 | invert_x_axis, 61 | team_index, 62 | interaction: None, 63 | palette_key, 64 | } 65 | } 66 | } 67 | 68 | impl Component for Player { 69 | type Storage = DenseVecStorage; 70 | } 71 | -------------------------------------------------------------------------------- /src/ecs/src/component/score.rs: -------------------------------------------------------------------------------- 1 | use amethyst::ecs::prelude::*; 2 | 3 | pub struct ScoreDigit(pub usize, pub bool); 4 | 5 | impl Component for ScoreDigit { 6 | type Storage = DenseVecStorage; 7 | } 8 | 9 | pub struct TimerDigit(pub usize); 10 | 11 | impl Component for TimerDigit { 12 | type Storage = DenseVecStorage; 13 | } 14 | 15 | // Team index first, Order index second 16 | pub struct OrderSlot(pub usize, pub usize); 17 | 18 | impl Component for OrderSlot { 19 | type Storage = DenseVecStorage; 20 | } 21 | 22 | pub struct OrderIngredient(pub usize); 23 | 24 | impl Component for OrderIngredient { 25 | type Storage = DenseVecStorage; 26 | } 27 | -------------------------------------------------------------------------------- /src/ecs/src/component/solid.rs: -------------------------------------------------------------------------------- 1 | use amethyst::ecs::prelude::*; 2 | 3 | pub struct Solid; 4 | 5 | impl Component for Solid { 6 | type Storage = DenseVecStorage; 7 | } 8 | -------------------------------------------------------------------------------- /src/ecs/src/component/table.rs: -------------------------------------------------------------------------------- 1 | use amethyst::ecs::prelude::*; 2 | use nk_data::*; 3 | 4 | pub enum Action { 5 | Flavor(FlavorIndex), 6 | Preparation(PreparationIndex, Option), 7 | Topping(ToppingIndex), 8 | Empty(Option), 9 | Delivery, 10 | } 11 | 12 | pub struct Table { 13 | action: Action, 14 | } 15 | 16 | impl Table { 17 | pub fn new_empty_table() -> Self { 18 | Table { 19 | action: Action::Empty(None), 20 | } 21 | } 22 | pub fn new_flavor_table(f: FlavorIndex) -> Self { 23 | Table { 24 | action: Action::Flavor(f), 25 | } 26 | } 27 | pub fn new_preparation_table(p: PreparationIndex) -> Self { 28 | Table { 29 | action: Action::Preparation(p, None), 30 | } 31 | } 32 | pub fn new_topping_table(t: ToppingIndex) -> Self { 33 | Table { 34 | action: Action::Topping(t), 35 | } 36 | } 37 | pub fn new_delivery_table() -> Self { 38 | Table { 39 | action: Action::Delivery, 40 | } 41 | } 42 | 43 | pub fn flavor(&self) -> Option { 44 | if let Action::Flavor(f) = &self.action { 45 | Some(f.clone()) 46 | } else { 47 | None 48 | } 49 | } 50 | pub fn preparation(&self) -> Option { 51 | if let Action::Preparation(p, _) = &self.action { 52 | Some(p.clone()) 53 | } else { 54 | None 55 | } 56 | } 57 | pub fn topping(&self) -> Option { 58 | if let Action::Topping(t) = &self.action { 59 | Some(t.clone()) 60 | } else { 61 | None 62 | } 63 | } 64 | pub fn delivery(&self) -> bool { 65 | if let Action::Delivery = self.action { 66 | true 67 | } else { 68 | false 69 | } 70 | } 71 | pub fn empty(&self) -> bool { 72 | if let Action::Empty(_) = self.action { 73 | true 74 | } else { 75 | false 76 | } 77 | } 78 | 79 | pub fn has_order(&self) -> bool { 80 | match self.action { 81 | Action::Preparation(_, Some(_)) | Action::Empty(Some(_)) => true, 82 | _ => false, 83 | } 84 | } 85 | 86 | pub fn extract_order(&mut self) -> Order { 87 | if let Action::Empty(o) = &mut self.action { 88 | if let Some(o) = o.take() { 89 | o 90 | } else { 91 | panic!("EXTRACT FROM EMPTY TABLE IS PROHIBITED!"); 92 | } 93 | } else if let Action::Preparation(_, o) = &mut self.action { 94 | if let Some(o) = o.take() { 95 | o 96 | } else { 97 | panic!("EXTRACT FROM EMPTY TABLE IS PROHIBITED!"); 98 | } 99 | } else { 100 | panic!("CANNOT EXTRACT FROM TABLE WITHOUT ORDER SLOT!"); 101 | } 102 | } 103 | 104 | pub fn insert_order(&mut self, order: Order) { 105 | if let Action::Empty(_) = self.action { 106 | self.action = Action::Empty(Some(order)); 107 | } else if let Action::Preparation(p, _) = &self.action { 108 | self.action = Action::Preparation(p.clone(), Some(order)); 109 | } else { 110 | panic!("CANNOT INSERT ORDER WHERE THERE CANNOT BE ANY!"); 111 | } 112 | } 113 | } 114 | 115 | impl Component for Table { 116 | type Storage = DenseVecStorage; 117 | } 118 | -------------------------------------------------------------------------------- /src/ecs/src/component/ui.rs: -------------------------------------------------------------------------------- 1 | use amethyst::ecs::prelude::*; 2 | use nk_data::*; 3 | 4 | pub struct UiFlavor(pub usize, pub usize, pub FlavorIndex); 5 | pub struct UiPreparation(pub usize, pub usize, pub PreparationIndex); 6 | pub struct UiTopping(pub usize, pub usize, pub ToppingIndex); 7 | 8 | impl Component for UiFlavor { 9 | type Storage = DenseVecStorage; 10 | } 11 | 12 | impl Component for UiPreparation { 13 | type Storage = DenseVecStorage; 14 | } 15 | 16 | impl Component for UiTopping { 17 | type Storage = DenseVecStorage; 18 | } 19 | 20 | pub enum MapFunction { 21 | PreviousDisplay, 22 | CurrentDisplay, 23 | NextDisplay, 24 | ArrowPrevious, 25 | ArrowNext, 26 | } 27 | 28 | pub struct MapSelection(pub MapFunction); 29 | 30 | impl Component for MapSelection { 31 | type Storage = DenseVecStorage; 32 | } 33 | -------------------------------------------------------------------------------- /src/ecs/src/component/velocity.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{core::cgmath::Vector2, ecs::prelude::*}; 2 | 3 | pub enum Step { 4 | Absolute, 5 | Relative, 6 | } 7 | 8 | pub struct Velocity { 9 | pub velocity: Vector2, 10 | pub current: Vector2, 11 | pub step: Step, 12 | } 13 | 14 | impl Velocity { 15 | pub fn new(xy: f32) -> Self { 16 | Velocity { 17 | velocity: Vector2::new(xy, xy), 18 | current: Vector2::new(0.0, 0.0), 19 | step: Step::Absolute, 20 | } 21 | } 22 | } 23 | 24 | impl Component for Velocity { 25 | type Storage = DenseVecStorage; 26 | } 27 | -------------------------------------------------------------------------------- /src/ecs/src/frange.rs: -------------------------------------------------------------------------------- 1 | pub trait InRange { 2 | fn in_range(&self, begin: Self, end: Self) -> bool; 3 | } 4 | 5 | impl InRange for f32 { 6 | fn in_range(&self, begin: f32, end: f32) -> bool { 7 | *self >= begin && *self < end 8 | } 9 | } 10 | 11 | impl InRange for f64 { 12 | fn in_range(&self, begin: f64, end: f64) -> bool { 13 | *self >= begin && *self < end 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/ecs/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![feature(vec_remove_item)] 2 | 3 | mod component; 4 | mod controller; 5 | mod frange; 6 | mod system; 7 | 8 | pub use self::{component::*, controller::*, system::*}; 9 | -------------------------------------------------------------------------------- /src/ecs/src/system.rs: -------------------------------------------------------------------------------- 1 | mod animation; 2 | mod autotile; 3 | mod background_animation; 4 | mod collision; 5 | mod control; 6 | mod generate; 7 | mod input; 8 | mod interact; 9 | mod interaction; 10 | mod inventory_render; 11 | mod layer; 12 | mod melt; 13 | mod movement; 14 | mod orders; 15 | mod score; 16 | mod timer; 17 | //mod preparation_interaction; 18 | //mod topping_interaction; 19 | 20 | pub use self::{ 21 | animation::*, autotile::*, background_animation::*, collision::*, control::*, generate::*, 22 | input::*, interact::*, interaction::*, inventory_render::*, layer::*, melt::*, movement::*, 23 | orders::*, score::*, timer::*, 24 | }; 25 | -------------------------------------------------------------------------------- /src/ecs/src/system/animation.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{core::timing::Time, ecs::prelude::*, renderer::SpriteRender}; 2 | use crate::component::*; 3 | use nk_data::*; 4 | 5 | pub struct AnimationSystem; 6 | 7 | impl<'s> System<'s> for AnimationSystem { 8 | type SystemData = ( 9 | Entities<'s>, 10 | ReadStorage<'s, AnimatedFloor>, 11 | ReadStorage<'s, AnimatedTable>, 12 | ReadStorage<'s, Interact>, 13 | ReadStorage<'s, Table>, 14 | WriteStorage<'s, Direction>, 15 | WriteStorage<'s, SpriteRender>, 16 | Read<'s, Time>, 17 | Write<'s, Animations>, 18 | ); 19 | 20 | fn run( 21 | &mut self, 22 | ( 23 | entities, 24 | floors, 25 | a_tables, 26 | interacts, 27 | tables, 28 | mut directions, 29 | mut sprites, 30 | time, 31 | mut animations, 32 | ): Self::SystemData, 33 | ) { 34 | let ds = time.delta_seconds(); 35 | for (_, anim) in &mut animations.animations { 36 | anim.update_timer(ds); 37 | } 38 | let animations = &animations.animations; 39 | for (direction, sprite) in (&mut directions, &mut sprites).join() { 40 | sprite.sprite_number = match direction.current { 41 | Cardinal::North => { 42 | animations[&format!("char_north_{}", &direction.current_anim)].get_frame() 43 | } 44 | Cardinal::NorthWest => { 45 | animations[&format!("char_north_{}", &direction.current_anim)].get_frame() 46 | } 47 | Cardinal::NorthEast => { 48 | animations[&format!("char_north_{}", &direction.current_anim)].get_frame() 49 | } 50 | 51 | Cardinal::South => { 52 | animations[&format!("char_south_{}", &direction.current_anim)].get_frame() 53 | } 54 | Cardinal::SouthWest => { 55 | animations[&format!("char_south_{}", &direction.current_anim)].get_frame() 56 | } 57 | Cardinal::SouthEast => { 58 | animations[&format!("char_south_{}", &direction.current_anim)].get_frame() 59 | } 60 | 61 | Cardinal::West => { 62 | animations[&format!("char_west_{}", &direction.current_anim)].get_frame() 63 | } 64 | Cardinal::East => { 65 | animations[&format!("char_east_{}", &direction.current_anim)].get_frame() 66 | } 67 | }; 68 | } 69 | 70 | for (floor, sprite) in (&floors, &mut sprites).join() { 71 | let my_anim = &animations[&format!("{}_top_h", floor.0)]; 72 | sprite.sprite_sheet = my_anim.obtain_handle(); 73 | sprite.sprite_number = my_anim.get_frame(); 74 | } 75 | 76 | for (e, interact, a_table) in (&*entities, &interacts, &a_tables).join() { 77 | let sprite = sprites.get_mut(e).unwrap(); 78 | let my_anim = &animations[&format!("{}_side_{}", a_table.0, a_table.1)]; 79 | sprite.sprite_sheet = my_anim.obtain_handle(); 80 | sprite.sprite_number = my_anim.get_frame(); 81 | 82 | let sprite = sprites.get_mut(interact.top).unwrap(); 83 | let my_anim = &animations[&format!("{}_top_{}", a_table.0, a_table.1)]; 84 | sprite.sprite_sheet = my_anim.obtain_handle(); 85 | sprite.sprite_number = my_anim.get_frame(); 86 | 87 | /* 88 | * if let Some(_) = interact.highlighted_by { 89 | * let s = sprites.get_mut(e).unwrap(); 90 | * s.sprite_number = animations[&format!("{}_side_open", a_table.0)].get_frame(); 91 | * 92 | * let s = sprites.get_mut(interact.top).unwrap(); 93 | * s.sprite_number = animations[&format!("{}_top_open", a_table.0)].get_frame(); 94 | * } else { 95 | * let s = sprites.get_mut(e).unwrap(); 96 | * s.sprite_number = animations[&format!("{}_side_close", a_table.0)].get_frame(); 97 | * 98 | * let s = sprites.get_mut(interact.top).unwrap(); 99 | * s.sprite_number = animations[&format!("{}_top_close", a_table.0)].get_frame(); 100 | * } 101 | */ 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /src/ecs/src/system/autotile.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{ 2 | core::transform::{Parent, Transform}, 3 | ecs::prelude::*, 4 | renderer::SpriteRender, 5 | }; 6 | use crate::component::*; 7 | use itertools::*; 8 | 9 | const W: usize = 10; 10 | const H: usize = 11; 11 | 12 | #[derive(Default)] 13 | pub struct AutotileSystem { 14 | map: [[Option; W]; H], 15 | turn: bool, 16 | } 17 | 18 | impl<'s> System<'s> for AutotileSystem { 19 | type SystemData = ( 20 | Entities<'s>, 21 | ReadStorage<'s, Parent>, 22 | ReadStorage<'s, Transform>, 23 | ReadStorage<'s, Table>, 24 | WriteStorage<'s, SpriteRender>, 25 | ); 26 | 27 | fn run(&mut self, (entities, parents, transforms, tables, mut sprites): Self::SystemData) { 28 | for j in 0..H { 29 | for i in 0..W { 30 | self.map[j][i] = None; 31 | } 32 | } 33 | 34 | let grouped = (&*entities, &transforms, &tables, &parents) 35 | .join() 36 | .group_by(|(_, _, _, p)| p.entity.id()); 37 | 38 | for (_, g) in grouped.into_iter() { 39 | if self.turn { 40 | for (e, transform, table, _) in g { 41 | if table.empty() { 42 | let x = (transform.translation.x / 16.0) as usize; 43 | let y = (transform.translation.y / 16.0) as usize; 44 | self.map[y][x] = Some(e); 45 | } 46 | } 47 | } 48 | self.turn = !self.turn; 49 | } 50 | 51 | for j in 0..H { 52 | for i in 0..W { 53 | if let Some(e) = self.map[j][i] { 54 | let mut sum = 0; 55 | if let Some(r) = self.map.get(j + 1) { 56 | if let Some(Some(_)) = r.get(i) { 57 | sum += 1; 58 | } 59 | } 60 | if j > 0 { 61 | if let Some(r) = self.map.get(j - 1) { 62 | if let Some(Some(_)) = r.get(i) { 63 | sum += 8; 64 | } 65 | } 66 | } 67 | if let Some(r) = self.map.get(j) { 68 | if let Some(Some(_)) = r.get(i + 1) { 69 | sum += 4; 70 | } 71 | if i > 0 { 72 | if let Some(Some(_)) = r.get(i - 1) { 73 | sum += 2; 74 | } 75 | } 76 | } 77 | sprites.get_mut(e).unwrap().sprite_number = sum; 78 | } 79 | } 80 | } 81 | 82 | self.turn = !self.turn; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/ecs/src/system/background_animation.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{ 2 | core::{timing::Time, transform::Transform}, 3 | ecs::prelude::{Join, Read, System, WriteStorage}, 4 | }; 5 | use crate::component::*; 6 | 7 | pub struct BackgroundAnimationSystem; 8 | 9 | const INTERVAL: f32 = 0.015625; 10 | const STEP: f32 = 0.015625; 11 | 12 | impl<'s> System<'s> for BackgroundAnimationSystem { 13 | type SystemData = ( 14 | WriteStorage<'s, Background>, 15 | WriteStorage<'s, Transform>, 16 | Read<'s, Time>, 17 | ); 18 | 19 | fn run(&mut self, (mut backgrounds, mut transforms, time): Self::SystemData) { 20 | for (b, t) in (&mut backgrounds, &mut transforms).join() { 21 | b.timer += time.delta_seconds(); 22 | while b.timer >= INTERVAL { 23 | t.translation.x = if t.translation.x + STEP > b.to.x { 24 | b.from.x 25 | } else { 26 | t.translation.x + STEP 27 | }; 28 | t.translation.y = if t.translation.y + STEP > b.to.y { 29 | b.from.y 30 | } else { 31 | t.translation.y + STEP 32 | }; 33 | b.timer -= INTERVAL; 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/ecs/src/system/collision.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{ 2 | core::{timing::Time, transform::Transform}, 3 | ecs::prelude::{Entities, Join, Read, ReadStorage, System, WriteStorage}, 4 | }; 5 | use crate::component::*; 6 | use nk_data::*; 7 | use either::*; 8 | use nalgebra::{Isometry2, Vector2}; 9 | use ncollide2d::query::{self}; 10 | 11 | pub struct CollisionSystem; 12 | 13 | impl<'s> System<'s> for CollisionSystem { 14 | type SystemData = ( 15 | Entities<'s>, 16 | ReadStorage<'s, Hitbox>, 17 | WriteStorage<'s, Transform>, 18 | ReadStorage<'s, Velocity>, 19 | ReadStorage<'s, Solid>, 20 | ReadStorage<'s, Direction>, 21 | Read<'s, Time>, 22 | ); 23 | 24 | fn run( 25 | &mut self, 26 | (entities, hitboxes, mut transforms, velocities, solids, directions, time): Self::SystemData, 27 | ) { 28 | for (e, e_hitbox, e_velocity, _) in (&*entities, &hitboxes, &velocities, !&solids).join() { 29 | for (o, o_hitbox, _) in (&*entities, &hitboxes, &solids).join() { 30 | if e != o { 31 | let o_pos = { 32 | let o_transform = transforms.get(o).unwrap(); 33 | Isometry2::new( 34 | Vector2::new(o_transform.translation.x + o_hitbox.offset.x, 35 | o_transform.translation.y + o_hitbox.offset.y), 36 | nalgebra::zero(), 37 | ) 38 | }; 39 | let e_pos = { 40 | let e_transform = transforms.get(e).unwrap(); 41 | Isometry2::new( 42 | Vector2::new(e_transform.translation.x + e_hitbox.offset.x, 43 | e_transform.translation.y + e_hitbox.offset.y), 44 | nalgebra::zero(), 45 | ) 46 | }; 47 | if let Some(result) = match (&o_hitbox.shape, &e_hitbox.shape) { 48 | (Either::Left(o), Either::Left(e)) => query::contact(&o_pos, o, &e_pos, e, 1.0), 49 | (Either::Left(o), Either::Right(e)) => query::contact(&o_pos, o, &e_pos, e, 1.0), 50 | (Either::Right(o), Either::Left(e)) => query::contact(&o_pos, o, &e_pos, e, 1.0), 51 | (Either::Right(o), Either::Right(e)) => query::contact(&o_pos, o, &e_pos, e, 1.0), 52 | } 53 | { 54 | let depth = result.depth; 55 | if depth > 0.0 { 56 | let t = transforms.get_mut(e).unwrap(); 57 | let d = directions.get(e).unwrap(); 58 | let curr = d.current; 59 | let prev = d.previous; 60 | match (curr, prev) { 61 | (Cardinal::East, _) => t.translation[0] -= depth, 62 | (Cardinal::West, _) => t.translation[0] += depth, 63 | (Cardinal::North, _) => t.translation[1] -= depth, 64 | (Cardinal::South, _) => t.translation[1] += depth, 65 | 66 | (Cardinal::NorthWest, _) => { 67 | t.translation[0] += depth; 68 | t.translation[1] -= depth; 69 | } 70 | (Cardinal::NorthEast, _) => { 71 | t.translation[0] -= depth; 72 | t.translation[1] -= depth; 73 | } 74 | (Cardinal::SouthWest, _) => { 75 | t.translation[0] += depth; 76 | t.translation[1] += depth; 77 | } 78 | (Cardinal::SouthEast, _) => { 79 | t.translation[0] -= depth; 80 | t.translation[1] += depth; 81 | } 82 | 83 | // TODO: Better correction when going diagonally. 84 | 85 | //(Cardinal::NorthWest, Some(Cardinal::West)) => { 86 | //t.translation[0] += depth; 87 | //t.translation[1] -= depth; 88 | //} 89 | //(Cardinal::NorthWest, Some(Cardinal::North)) => { 90 | //t.translation[0] += depth 91 | //} 92 | //(Cardinal::NorthWest, _) => t.translation[0] += depth, 93 | 94 | //(Cardinal::NorthEast, Some(Cardinal::East)) => { 95 | //t.translation[0] += depth 96 | //} 97 | //(Cardinal::NorthEast, Some(Cardinal::North)) => { 98 | //t.translation[0] += depth 99 | //} 100 | //(Cardinal::NorthEast, _) => t.translation[0] += depth, 101 | 102 | //(Cardinal::SouthWest, Some(Cardinal::West)) => { 103 | //t.translation[0] += depth 104 | //} 105 | //(Cardinal::SouthWest, Some(Cardinal::South)) => { 106 | //t.translation[0] += depth 107 | //} 108 | //(Cardinal::SouthWest, _) => t.translation[0] += depth, 109 | 110 | //(Cardinal::SouthEast, Some(Cardinal::East)) => { 111 | //t.translation[0] += depth 112 | //} 113 | //(Cardinal::SouthEast, Some(Cardinal::South)) => { 114 | //t.translation[0] += depth 115 | //} 116 | //(Cardinal::SouthEast, _) => t.translation[0] += depth, 117 | } 118 | } 119 | } 120 | } 121 | } 122 | } 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /src/ecs/src/system/control.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{core::cgmath::*, ecs::prelude::*}; 2 | use crate::{component::*, controller::*, frange::*}; 3 | use log::info; 4 | use nk_data::*; 5 | use std::{collections::HashMap, sync::*}; 6 | 7 | pub struct ControlSystem; 8 | 9 | impl<'s> System<'s> for ControlSystem { 10 | type SystemData = ( 11 | Entities<'s>, 12 | Read<'s, Arc>>>, 13 | ReadStorage<'s, Player>, 14 | WriteStorage<'s, Input>, 15 | WriteStorage<'s, Direction>, 16 | Write<'s, Animations>, 17 | ); 18 | 19 | fn run( 20 | &mut self, 21 | (entities, controllers, players, mut inputs, mut directions, mut animations): Self::SystemData, 22 | ) { 23 | for (e, player, input) in (&*entities, &players, &mut inputs).join() { 24 | let mut controllers = controllers.lock().unwrap(); 25 | let entry = controllers 26 | .entry(player.gamepad_index) 27 | .or_insert(Controller::new(player.gamepad_index)); 28 | 29 | //info!( 30 | //"<{}> Movement Direction: {:?}", 31 | //player.gamepad_index, entry.left_axis 32 | //); 33 | //info!( 34 | //"<{}> Aim Direction: {:?}", 35 | //player.gamepad_index, entry.right_axis 36 | //); 37 | //info!("<{}> Actions: {:?}", player.gamepad_index, entry.actions); 38 | info!( 39 | "<{}:{:?}> Player Inventory: {:?}", 40 | player.gamepad_index, player.gamepad_style, player.inventory 41 | ); 42 | info!( 43 | "<{}:{:?}> Player Interaction: {:?}", 44 | player.gamepad_index, player.gamepad_style, player.interaction, 45 | ); 46 | info!( 47 | "<{}:{:?}> Player Actions: N'{}, S'{}, W'{}, E'{}\n", 48 | player.gamepad_index, 49 | player.gamepad_style, 50 | input.wants_north, 51 | input.wants_south, 52 | input.wants_west, 53 | input.wants_east, 54 | ); 55 | 56 | let axis = match player.gamepad_style { 57 | Style::Full | Style::HalfLeft => entry.left_axis, 58 | Style::HalfRight => entry.right_axis, 59 | }; 60 | if let None = player.interaction { 61 | if axis.relative_ne( 62 | &Vector3::new(0.0, 0.0, 0.0), 63 | Vector3::::default_epsilon(), 64 | Vector3::::default_max_relative(), 65 | ) { 66 | let vec = Vector2::new(axis.x, axis.y).normalize(); 67 | let x_val = if player.invert_x_axis { -vec.x } else { vec.x }; 68 | let angle: Deg = Angle::atan2(vec.y, x_val); 69 | 70 | info!("Angle: {}", angle.0); 71 | let new_angle = match angle.0 { 72 | x if x.in_range(157.5, 181.0) => Cardinal::West, 73 | x if x.in_range(112.5, 157.5) => Cardinal::NorthWest, 74 | x if x.in_range(67.5, 112.5) => Cardinal::North, 75 | x if x.in_range(22.5, 67.5) => Cardinal::NorthEast, 76 | x if x.in_range(-22.5, 22.5) => Cardinal::East, 77 | x if x.in_range(-67.5, -22.5) => Cardinal::SouthEast, 78 | x if x.in_range(-112.5, -67.5) => Cardinal::South, 79 | x if x.in_range(-157.5, -112.5) => Cardinal::SouthWest, 80 | x if x.in_range(-181.0, -157.5) => Cardinal::West, 81 | 82 | // Atan2 should never output anything above 180deg. 83 | x => panic!("Invalid direction, angle {}!", x), 84 | }; 85 | if Some(new_angle) != input.wants_to_move { 86 | input.last_moved_direction = input.wants_to_move; 87 | } 88 | input.wants_to_move = Some(new_angle); 89 | 90 | if let Some(dir) = directions.get_mut(e) { 91 | dir.previous = Some(dir.current); 92 | dir.current = new_angle; 93 | } 94 | } else { 95 | input.wants_to_move = None; 96 | } 97 | } else { 98 | input.wants_to_move = None; 99 | } 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /src/ecs/src/system/input.rs: -------------------------------------------------------------------------------- 1 | use amethyst::ecs::prelude::*; 2 | use crate::component::*; 3 | 4 | pub struct InputSystem; 5 | 6 | impl<'s> System<'s> for InputSystem { 7 | type SystemData = (ReadStorage<'s, Input>, WriteStorage<'s, Velocity>); 8 | 9 | fn run(&mut self, (inputs, mut velocities): Self::SystemData) { 10 | for (input, velocity) in (&inputs, &mut velocities).join() { 11 | if let Some(dir) = input.wants_to_move { 12 | velocity.current[0] = velocity.velocity[0] * dir.get_x(); 13 | velocity.current[1] = velocity.velocity[1] * dir.get_y(); 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/ecs/src/system/layer.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{ 2 | core::transform::Transform, 3 | ecs::prelude::{Join, ReadStorage, System, WriteStorage}, 4 | }; 5 | use crate::component::*; 6 | 7 | pub struct LayerSystem; 8 | 9 | impl<'s> System<'s> for LayerSystem { 10 | type SystemData = (ReadStorage<'s, Layered>, WriteStorage<'s, Transform>); 11 | 12 | fn run(&mut self, (layereds, mut transforms): Self::SystemData) { 13 | for (o, _) in (&mut transforms, &layereds).join() { 14 | o.translation.z = -(o.translation.y - 16.0); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/ecs/src/system/melt.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{ 2 | core::timing::Time, 3 | ecs::prelude::{Entities, Join, Read, System, WriteStorage}, 4 | }; 5 | use crate::component::*; 6 | use either::*; 7 | 8 | pub struct MeltSystem; 9 | 10 | impl<'s> System<'s> for MeltSystem { 11 | type SystemData = (Entities<'s>, WriteStorage<'s, Player>, Read<'s, Time>); 12 | 13 | fn run(&mut self, (entities, mut players, time): Self::SystemData) { 14 | let ds = time.delta_seconds(); 15 | for (_e, player) in (&*entities, &mut players).join() { 16 | if let Some(Either::Right(o)) = &mut player.inventory { 17 | o.update_delivery(ds); 18 | if o.has_melted() { 19 | player.inventory = None; 20 | } 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/ecs/src/system/movement.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{ 2 | core::{timing::Time, transform::Transform}, 3 | ecs::prelude::{Entities, Join, Read, ReadStorage, System, WriteStorage}, 4 | }; 5 | use crate::component::*; 6 | use log::*; 7 | use nalgebra::{Isometry2, Vector2}; 8 | use ncollide2d::query::{self, *}; 9 | 10 | pub struct MovementSystem; 11 | 12 | const EPSILON: f32 = 0.33; 13 | 14 | impl<'s> System<'s> for MovementSystem { 15 | type SystemData = ( 16 | Entities<'s>, 17 | WriteStorage<'s, Transform>, 18 | WriteStorage<'s, Velocity>, 19 | WriteStorage<'s, Direction>, 20 | Read<'s, Time>, 21 | ); 22 | 23 | fn run( 24 | &mut self, 25 | (entities, mut transforms, mut velocities, mut directions, time): Self::SystemData, 26 | ) { 27 | let ds = time.delta_seconds(); 28 | for (e, transform, velocity) in (&*entities, &mut transforms, &mut velocities).join() { 29 | transform.translation.x += velocity.current.x * ds; 30 | transform.translation.y += velocity.current.y * ds; 31 | 32 | if let Some(direction) = directions.get_mut(e) { 33 | match velocity.current.x.abs() > 0.0 || velocity.current.y.abs() > 0.0 { 34 | true => direction.current_anim = String::from("walk"), 35 | false => direction.current_anim = String::from("idle"), 36 | } 37 | } 38 | 39 | if let Step::Absolute = velocity.step { 40 | velocity.current.x = 0.0; 41 | velocity.current.y = 0.0; 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/ecs/src/system/orders.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{ 2 | core::transform::Parent, 3 | ecs::prelude::{Join, Read, ReadStorage, System, WriteStorage}, 4 | renderer::SpriteRender, 5 | }; 6 | use crate::component::*; 7 | use log::*; 8 | use nk_data::*; 9 | 10 | pub struct OrdersSystem; 11 | 12 | impl<'s> System<'s> for OrdersSystem { 13 | type SystemData = ( 14 | ReadStorage<'s, Parent>, 15 | ReadStorage<'s, OrderSlot>, 16 | WriteStorage<'s, OrderIngredient>, 17 | WriteStorage<'s, SpriteRender>, 18 | Read<'s, Match>, 19 | Read<'s, Animations>, 20 | Read<'s, Definitions>, 21 | ); 22 | 23 | fn run( 24 | &mut self, 25 | (parents, slots, mut ingredients, mut sprites, match_data, anims, defs): Self::SystemData, 26 | ) { 27 | if match_data.teams.len() > 0 { 28 | for (ingredient, sprite, parent) in (&mut ingredients, &mut sprites, &parents).join() { 29 | let my_slot = slots.get(parent.entity).unwrap(); 30 | let OrderSlot(team_index, order_index) = my_slot; 31 | let my_team = &match_data.teams[*team_index]; 32 | if let Some(my_order) = my_team.orders.get(*order_index) { 33 | let key = format!( 34 | "{}_item", 35 | match my_order.possibility { 36 | OrderPossibility::OneFlavorNoTopping(ref f1) => { 37 | if ingredient.0 == 0 { 38 | defs.flavors().find(|f| f.index == *f1).unwrap().key.clone() 39 | } else { 40 | String::from("empty") 41 | } 42 | } 43 | OrderPossibility::TwoFlavorsNoTopping(ref f1, ref f2) => { 44 | if ingredient.0 == 0 { 45 | defs.flavors().find(|f| f.index == *f1).unwrap().key.clone() 46 | } else if ingredient.0 == 1 { 47 | defs.flavors().find(|f| f.index == *f2).unwrap().key.clone() 48 | } else { 49 | String::from("empty") 50 | } 51 | } 52 | OrderPossibility::ThreeFlavorsNoTopping(ref f1, ref f2, ref f3) => { 53 | if ingredient.0 == 0 { 54 | defs.flavors().find(|f| f.index == *f1).unwrap().key.clone() 55 | } else if ingredient.0 == 1 { 56 | defs.flavors().find(|f| f.index == *f2).unwrap().key.clone() 57 | } else if ingredient.0 == 2 { 58 | defs.flavors().find(|f| f.index == *f3).unwrap().key.clone() 59 | } else { 60 | String::from("empty") 61 | } 62 | } 63 | OrderPossibility::FourFlavorsNoTopping( 64 | ref f1, 65 | ref f2, 66 | ref f3, 67 | ref f4, 68 | ) => { 69 | if ingredient.0 == 0 { 70 | defs.flavors().find(|f| f.index == *f1).unwrap().key.clone() 71 | } else if ingredient.0 == 1 { 72 | defs.flavors().find(|f| f.index == *f2).unwrap().key.clone() 73 | } else if ingredient.0 == 2 { 74 | defs.flavors().find(|f| f.index == *f3).unwrap().key.clone() 75 | } else if ingredient.0 == 3 { 76 | defs.flavors().find(|f| f.index == *f4).unwrap().key.clone() 77 | } else { 78 | String::from("empty") 79 | } 80 | } 81 | OrderPossibility::OneFlavorWithTopping(ref f1, ref t1) => { 82 | if ingredient.0 == 0 { 83 | defs.flavors().find(|f| f.index == *f1).unwrap().key.clone() 84 | } else if ingredient.0 == 1 { 85 | defs.toppings() 86 | .find(|t| t.index == *t1) 87 | .unwrap() 88 | .key 89 | .clone() 90 | } else { 91 | String::from("empty") 92 | } 93 | } 94 | OrderPossibility::TwoFlavorsWithTopping(ref f1, ref f2, ref t1) => { 95 | if ingredient.0 == 0 { 96 | defs.flavors().find(|f| f.index == *f1).unwrap().key.clone() 97 | } else if ingredient.0 == 1 { 98 | defs.flavors().find(|f| f.index == *f2).unwrap().key.clone() 99 | } else if ingredient.0 == 2 { 100 | defs.toppings() 101 | .find(|t| t.index == *t1) 102 | .unwrap() 103 | .key 104 | .clone() 105 | } else { 106 | String::from("empty") 107 | } 108 | } 109 | OrderPossibility::ThreeFlavorsWithTopping( 110 | ref f1, 111 | ref f2, 112 | ref f3, 113 | ref t1, 114 | ) => { 115 | if ingredient.0 == 0 { 116 | defs.flavors().find(|f| f.index == *f1).unwrap().key.clone() 117 | } else if ingredient.0 == 1 { 118 | defs.flavors().find(|f| f.index == *f2).unwrap().key.clone() 119 | } else if ingredient.0 == 2 { 120 | defs.flavors().find(|f| f.index == *f3).unwrap().key.clone() 121 | } else if ingredient.0 == 3 { 122 | defs.toppings() 123 | .find(|t| t.index == *t1) 124 | .unwrap() 125 | .key 126 | .clone() 127 | } else { 128 | String::from("empty") 129 | } 130 | } 131 | } 132 | ); 133 | //info!("try item key = {}", key); 134 | let anim = &anims.animations[&key]; 135 | sprite.sprite_sheet = anim.obtain_handle(); 136 | sprite.sprite_number = anim.get_frame(); 137 | } else { 138 | let anim = &anims.animations["empty_item"]; 139 | sprite.sprite_sheet = anim.obtain_handle(); 140 | sprite.sprite_number = anim.get_frame(); 141 | } 142 | } 143 | } 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /src/ecs/src/system/score.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{ 2 | core::transform::{Parent, Transform}, 3 | ecs::prelude::{Join, Read, ReadStorage, System, WriteStorage}, 4 | renderer::SpriteRender, 5 | }; 6 | use crate::component::*; 7 | use log::*; 8 | use nk_data::*; 9 | 10 | pub struct ScoreSystem; 11 | 12 | impl<'s> System<'s> for ScoreSystem { 13 | type SystemData = ( 14 | ReadStorage<'s, ScoreDigit>, 15 | ReadStorage<'s, TimerDigit>, 16 | WriteStorage<'s, SpriteRender>, 17 | Read<'s, Match>, 18 | ); 19 | 20 | fn run(&mut self, (scores, timers, mut sprites, match_data): Self::SystemData) { 21 | if match_data.teams.len() > 0 { 22 | let (minute, second, score_left, score_right) = { 23 | let minute = match_data.timer.ceil() as usize / 60; 24 | let second = match_data.timer.ceil() as usize % 60; 25 | let score_left = match_data.teams[0].score as usize; 26 | let score_right = match_data.teams[1].score as usize; 27 | (minute, second, score_left, score_right) 28 | }; 29 | 30 | for (score, sprite) in (&scores, &mut sprites).join() { 31 | let to_mod = 10usize.pow(8u32 - score.0 as u32); 32 | let to_div = 10usize.pow(7u32 - score.0 as u32); 33 | if score.1 { 34 | sprite.sprite_number = (score_right % to_mod) / to_div; 35 | } else { 36 | sprite.sprite_number = (score_left % to_mod) / to_div; 37 | } 38 | } 39 | 40 | for (timer, sprite) in (&timers, &mut sprites).join() { 41 | sprite.sprite_number = match timer.0 { 42 | 0 => minute / 10, 43 | 1 => minute % 10, 44 | 2 => second / 10, 45 | 3 => second % 10, 46 | 4 => 10, 47 | _ => panic!("IMPOSSIBURU! TIMER HAS ONLY 5 CHARS"), 48 | }; 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/ecs/src/system/timer.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{ 2 | core::timing::Time, 3 | ecs::prelude::{Read, System, Write}, 4 | }; 5 | use nk_data::*; 6 | 7 | pub struct TimerSystem; 8 | 9 | impl<'s> System<'s> for TimerSystem { 10 | type SystemData = (Write<'s, Match>, Read<'s, Time>); 11 | 12 | fn run(&mut self, (mut match_data, time): Self::SystemData) { 13 | match_data.timer -= time.delta_seconds(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/loader/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "nk_loader" 3 | description = "Game made for IGMC 2018 by MGDA" 4 | version = "0.1.0" 5 | authors = ["Tiago Nascimento "] 6 | edition = "2018" 7 | 8 | homepage = "https://gamedev.maringa.br/igmc-2018" 9 | documentation = "https://gamedev.maringa.br/igmc-2018/docs/nk_loader" 10 | repository = "https://github.com/maringa-gamedev/rust-igmc-2018" 11 | 12 | readme = "README.md" 13 | license = "AGPLv3" 14 | 15 | [features] 16 | nightly = ["amethyst/nightly"] 17 | 18 | [dependencies] 19 | nk_data = { path = "../data/", version="0.1.0" } 20 | amethyst = { git = "https://github.com/amethyst/amethyst.git" } 21 | serde = "1.0" 22 | serde_derive = "1.0" 23 | ron = "0.4" 24 | log = "0.4" 25 | rand = "0.5" 26 | font-kit = "0.1" 27 | gilrs = "0.6" 28 | nalgebra = "0.16" 29 | ncollide2d = "0.17" 30 | itertools = "0.7" 31 | either = "1.5" 32 | -------------------------------------------------------------------------------- /src/loader/src/audio.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{ 2 | assets::{AssetStorage, Loader}, 3 | audio::{output::Output, AudioSink, OggFormat, Source, SourceHandle}, 4 | ecs::prelude::World, 5 | }; 6 | use nk_data::*; 7 | use std::{iter::Cycle, vec::IntoIter}; 8 | 9 | /* 10 | *pub struct Music { 11 | * pub music: Cycle>, 12 | *} 13 | */ 14 | 15 | fn load_audio_track(loader: &Loader, world: &World, file: &str) -> SourceHandle { 16 | loader.load(file, OggFormat, (), (), &world.read_resource()) 17 | } 18 | 19 | pub fn initialise_audio(world: &mut World) { 20 | /* 21 | *use AUDIO_BOUNCE; 22 | *use AUDIO_MUSIC; 23 | *use AUDIO_SCORE; 24 | */ 25 | 26 | let sound_effects = { 27 | let loader = world.read_resource::(); 28 | 29 | let mut sink = world.write_resource::(); 30 | //sink.set_volume(0.25); // Music is a bit loud, reduce the volume. 31 | 32 | /* 33 | *let music = AUDIO_MUSIC 34 | * .iter() 35 | * .map(|file| load_audio_track(&loader, &world, file)) 36 | * .collect::>() 37 | * .into_iter() 38 | * .cycle(); 39 | *let music = Music { music }; 40 | */ 41 | 42 | let sound = Sounds { 43 | pickup_sfx: load_audio_track(&loader, &world, "sound/pickup.ogg"), 44 | }; 45 | 46 | sound 47 | }; 48 | 49 | // Add sound effects to the world. We have to do this in another scope because 50 | // // world won't let us insert new resources as long as `Loader` is borrowed. 51 | world.add_resource(sound_effects); 52 | //world.add_resource(music); 53 | } 54 | -------------------------------------------------------------------------------- /src/loader/src/data.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{ecs::prelude::*, utils::application_root_dir}; 2 | use log::*; 3 | use nk_data::*; 4 | use ron::de::from_reader; 5 | use std::fs::File; 6 | 7 | pub fn load_game_data() -> Definitions { 8 | let app_root = application_root_dir(); 9 | 10 | let flavors = { 11 | let path = format!("{}/assets/data/flavors.ron", app_root); 12 | let f = File::open(&path).expect("Failed opening 'flavors.ron' file!"); 13 | match from_reader(f) { 14 | Ok(x) => x, 15 | Err(e) => { 16 | error!("Error parsing flavors definition: {}", e); 17 | panic!("Invalid flavors definition <{}>!", path); 18 | } 19 | } 20 | }; 21 | 22 | let preparations = { 23 | let path = format!("{}/assets/data/preparations.ron", app_root); 24 | let f = File::open(&path).expect("Failed opening 'preparations.ron' file!"); 25 | match from_reader(f) { 26 | Ok(x) => x, 27 | Err(e) => { 28 | error!("Error parsing preparations definition: {}", e); 29 | panic!("Invalid preparations definition <{}>!", path); 30 | } 31 | } 32 | }; 33 | 34 | let toppings = { 35 | let path = format!("{}/assets/data/toppings.ron", app_root); 36 | let f = File::open(&path).expect("Failed opening 'toppings.ron' file!"); 37 | match from_reader(f) { 38 | Ok(x) => x, 39 | Err(e) => { 40 | error!("Error parsing toppings definition: {}", e); 41 | panic!("Invalid toppings definition <{}>!", path); 42 | } 43 | } 44 | }; 45 | 46 | Definitions::new(flavors, preparations, toppings) 47 | } 48 | -------------------------------------------------------------------------------- /src/loader/src/fonts.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{ 2 | assets::{AssetStorage, Loader}, 3 | ecs::prelude::*, 4 | renderer::{ 5 | MaterialTextureSet, PngFormat, Sprite, SpriteSheet, SpriteSheetHandle, SpriteSheetSet, 6 | Texture, TextureCoordinates, TextureMetadata, 7 | }, 8 | }; 9 | use log::*; 10 | use nk_data::*; 11 | use std::collections::HashMap; 12 | 13 | pub fn load_number_fonts(world: &mut World) -> (SpriteSheetHandle, SpriteSheetHandle) { 14 | // Buttons 15 | let index = 30; 16 | let sprites = vec![ 17 | (0.0, 0.5, 0.1, 0.5), 18 | (0.1, 0.5, 0.1, 0.5), 19 | (0.2, 0.5, 0.1, 0.5), 20 | (0.3, 0.5, 0.1, 0.5), 21 | (0.4, 0.5, 0.1, 0.5), 22 | (0.5, 0.5, 0.1, 0.5), 23 | (0.6, 0.5, 0.1, 0.5), 24 | (0.7, 0.5, 0.1, 0.5), 25 | (0.8, 0.5, 0.1, 0.5), 26 | (0.9, 0.5, 0.1, 0.5), 27 | (0.0, 0.0, 0.1, 0.5), 28 | ]; 29 | let texture = { 30 | let loader = world.read_resource::(); 31 | loader.load( 32 | "texture/block-numbers.png", 33 | PngFormat, 34 | TextureMetadata::srgb_scale(), 35 | (), 36 | &world.read_resource::>(), 37 | ) 38 | }; 39 | world 40 | .write_resource::() 41 | .insert(index, texture); 42 | 43 | let sprites = sprites 44 | .iter() 45 | .map(|(x, y, w, h)| Sprite { 46 | width: 13.0, 47 | height: 18.0, 48 | offsets: [-6.5, -9.0], 49 | tex_coords: TextureCoordinates { 50 | left: *x, 51 | right: x + w, 52 | top: y + h, 53 | bottom: *y, 54 | }, 55 | }) 56 | .collect(); 57 | let sprites = SpriteSheet { 58 | texture_id: index, 59 | sprites, 60 | }; 61 | let score_font = { 62 | let loader = world.read_resource::(); 63 | loader.load_from_data( 64 | sprites, 65 | (), 66 | &world.read_resource::>(), 67 | ) 68 | }; 69 | world 70 | .write_resource::() 71 | .insert(index, score_font.clone()); 72 | 73 | // Progress 74 | let index = 31; 75 | let sprites = vec![ 76 | (0.0, 0.5, 0.1, 0.5), 77 | (0.1, 0.5, 0.1, 0.5), 78 | (0.2, 0.5, 0.1, 0.5), 79 | (0.3, 0.5, 0.1, 0.5), 80 | (0.4, 0.5, 0.1, 0.5), 81 | (0.5, 0.5, 0.1, 0.5), 82 | (0.6, 0.5, 0.1, 0.5), 83 | (0.7, 0.5, 0.1, 0.5), 84 | (0.8, 0.5, 0.1, 0.5), 85 | (0.9, 0.5, 0.1, 0.5), 86 | (0.0, 0.0, 0.1, 0.5), 87 | ]; 88 | let texture = { 89 | let loader = world.read_resource::(); 90 | loader.load( 91 | "texture/tall-numbers.png", 92 | PngFormat, 93 | TextureMetadata::srgb_scale(), 94 | (), 95 | &world.read_resource::>(), 96 | ) 97 | }; 98 | world 99 | .write_resource::() 100 | .insert(index, texture); 101 | let sprites = sprites 102 | .iter() 103 | .map(|(x, y, w, h)| Sprite { 104 | width: 14.0, 105 | height: 26.0, 106 | offsets: [-7.0, -13.0], 107 | tex_coords: TextureCoordinates { 108 | left: *x, 109 | right: x + w, 110 | top: y + h, 111 | bottom: *y, 112 | }, 113 | }) 114 | .collect(); 115 | let sprites = SpriteSheet { 116 | texture_id: index, 117 | sprites, 118 | }; 119 | let timer_font = { 120 | let loader = world.read_resource::(); 121 | loader.load_from_data( 122 | sprites, 123 | (), 124 | &world.read_resource::>(), 125 | ) 126 | }; 127 | world 128 | .write_resource::() 129 | .insert(index, timer_font.clone()); 130 | 131 | (score_font, timer_font) 132 | } 133 | -------------------------------------------------------------------------------- /src/loader/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod audio; 2 | mod buttons; 3 | mod data; 4 | mod fonts; 5 | mod item; 6 | mod map; 7 | mod player; 8 | mod ui; 9 | 10 | pub use self::{audio::*, buttons::*, data::*, fonts::*, item::*, map::*, player::*, ui::*}; 11 | 12 | // TODO: Unify parsing of texture files. 13 | -------------------------------------------------------------------------------- /src/loader/src/player.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{ 2 | assets::{AssetStorage, Loader}, 3 | ecs::prelude::*, 4 | renderer::{ 5 | MaterialTextureSet, PngFormat, Sprite, SpriteSheet, SpriteSheetHandle, SpriteSheetSet, 6 | Texture, TextureCoordinates, TextureMetadata, 7 | }, 8 | utils::application_root_dir, 9 | }; 10 | use log::*; 11 | use nk_data::*; 12 | use ron::de::from_reader; 13 | use std::{collections::HashMap, fs::File}; 14 | 15 | pub fn load_players_texture(world: &mut World) -> (SpriteSheetHandle, HashMap) { 16 | let app_root = application_root_dir(); 17 | let path = format!("{}/assets/texture/player/index.ron", app_root); 18 | let f = File::open(&path).expect("Failed opening file"); 19 | let (tex_def, anim_def): ( 20 | TextureDefinition, 21 | HashMap, AnimationLoop)>, 22 | ) = match from_reader(f) { 23 | Ok(x) => x, 24 | Err(e) => { 25 | error!("Error parsing texture definition: {}", e); 26 | panic!("Invalid texture definition <{}>!", path); 27 | } 28 | }; 29 | 30 | info!("Loading game texture."); 31 | // Load Textures 32 | let texture = { 33 | let loader = world.read_resource::(); 34 | loader.load( 35 | tex_def.path, 36 | PngFormat, 37 | TextureMetadata::srgb_scale(), 38 | (), 39 | &world.read_resource::>(), 40 | ) 41 | }; 42 | world 43 | .write_resource::() 44 | .insert(PLAYERS_TEXTURE_INDEX, texture); 45 | 46 | let (sw, sh) = (tex_def.width, tex_def.height); 47 | let mut sprites_hash = HashMap::new(); 48 | let mut index: usize = 0; 49 | let sprites = tex_def 50 | .sprites 51 | .iter() 52 | .map(|(name, x, y, w, h)| { 53 | sprites_hash.insert(name.clone(), index); 54 | index += 1; 55 | Sprite { 56 | width: sw * w, 57 | height: sh * h, 58 | //offsets: [-SPRITE_SIZE / 2.0, -SPRITE_SIZE / 2.0], 59 | offsets: [ 60 | 0.0, 61 | -((SPRITE_HEIGHT / 2.0) - ((PLAYER_HITBOX_HEIGHT / 2.0) + 4.0)), 62 | ], 63 | tex_coords: TextureCoordinates { 64 | left: *x, 65 | right: x + w, 66 | top: y + h, 67 | bottom: *y, 68 | }, 69 | } 70 | }) 71 | .collect(); 72 | 73 | let sprites = SpriteSheet { 74 | texture_id: PLAYERS_TEXTURE_INDEX, 75 | sprites, 76 | }; 77 | 78 | let handle = { 79 | let loader = world.read_resource::(); 80 | loader.load_from_data( 81 | sprites, 82 | (), 83 | &world.read_resource::>(), 84 | ) 85 | }; 86 | 87 | world 88 | .write_resource::() 89 | .insert(PLAYERS_TEXTURE_INDEX, handle.clone()); 90 | 91 | let anim_def = anim_def 92 | .iter() 93 | .map(|(k, v)| { 94 | ( 95 | k.to_owned(), 96 | Animation::new( 97 | handle.clone(), 98 | v.0.iter() 99 | .map(|(name, duration)| (*sprites_hash.get(name).unwrap(), *duration)) 100 | .collect(), 101 | v.1.clone(), 102 | ), 103 | ) 104 | }) 105 | .into_iter() 106 | .collect(); 107 | 108 | (handle, anim_def) 109 | } 110 | -------------------------------------------------------------------------------- /src/loader/src/ui.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{ 2 | assets::{AssetStorage, Loader}, 3 | ecs::prelude::*, 4 | renderer::{ 5 | MaterialTextureSet, PngFormat, Sprite, SpriteSheet, SpriteSheetHandle, SpriteSheetSet, 6 | Texture, TextureCoordinates, TextureMetadata, 7 | }, 8 | utils::application_root_dir, 9 | }; 10 | use log::*; 11 | use nk_data::*; 12 | use ron::de::from_reader; 13 | use std::{collections::HashMap, fs::File}; 14 | 15 | pub fn load_ui_texture( 16 | world: &mut World, 17 | ) -> (SpriteSheetHandle, SpriteSheetHandle, SpriteSheetHandle) { 18 | info!("Loading ui texture!"); 19 | 20 | let data = vec![ 21 | ("texture/other/bg.png", 50, TILE_WIDTH, TILE_HEIGHT), 22 | ("texture/other/hud.png", 51, MAP_WIDTH, MAP_HEIGHT), 23 | ("texture/other/title.png", 52, MAP_WIDTH, MAP_HEIGHT), 24 | ]; 25 | 26 | let mut data: Vec = data 27 | .iter() 28 | .map(|(path, index, w, h)| { 29 | let texture = { 30 | let loader = world.read_resource::(); 31 | loader.load( 32 | *path, 33 | PngFormat, 34 | TextureMetadata::srgb_scale(), 35 | (), 36 | &world.read_resource::>(), 37 | ) 38 | }; 39 | world 40 | .write_resource::() 41 | .insert(*index, texture); 42 | 43 | info!("Creating ui sprites."); 44 | let sprites = vec![Sprite { 45 | width: *w, 46 | height: *h, 47 | offsets: [0.0, 0.0], 48 | tex_coords: TextureCoordinates { 49 | left: 0.0, 50 | right: 1.0, 51 | top: 1.0, 52 | bottom: 0.0, 53 | }, 54 | }]; 55 | 56 | let sprites = SpriteSheet { 57 | texture_id: *index, 58 | sprites, 59 | }; 60 | 61 | let handle = { 62 | let loader = world.read_resource::(); 63 | loader.load_from_data( 64 | sprites, 65 | (), 66 | &world.read_resource::>(), 67 | ) 68 | }; 69 | 70 | world 71 | .write_resource::() 72 | .insert(*index, handle.clone()); 73 | 74 | handle 75 | }) 76 | .collect(); 77 | 78 | (data.remove(0), data.remove(0), data.remove(0)) 79 | } 80 | 81 | pub fn load_ui_sprites(world: &mut World) -> HashMap { 82 | let app_root = application_root_dir(); 83 | let path = format!("{}/assets/texture/other/menu.ron", app_root); 84 | let f = File::open(&path).expect("Failed opening file"); 85 | let (tex_def, anim_def): ( 86 | TextureDefinition, 87 | HashMap, AnimationLoop)>, 88 | ) = match from_reader(f) { 89 | Ok(x) => x, 90 | Err(e) => { 91 | error!("Error parsing texture definition: {}", e); 92 | panic!("Invalid texture definition <{}>!", path); 93 | } 94 | }; 95 | 96 | info!("Loading game texture."); 97 | // Load Textures 98 | let texture = { 99 | let loader = world.read_resource::(); 100 | loader.load( 101 | tex_def.path, 102 | PngFormat, 103 | TextureMetadata::srgb_scale(), 104 | (), 105 | &world.read_resource::>(), 106 | ) 107 | }; 108 | world 109 | .write_resource::() 110 | .insert(250, texture); 111 | 112 | let (sw, sh) = (tex_def.width, tex_def.height); 113 | let mut sprites_hash = HashMap::new(); 114 | let mut index: usize = 0; 115 | let sprites = tex_def 116 | .sprites 117 | .iter() 118 | .map(|(name, x, y, w, h)| { 119 | sprites_hash.insert(name.clone(), index); 120 | index += 1; 121 | Sprite { 122 | width: sw * w, 123 | height: sh * h, 124 | offsets: [sw * w * -0.5, sh * h * -0.5], 125 | tex_coords: TextureCoordinates { 126 | left: *x, 127 | right: x + w, 128 | top: y + h, 129 | bottom: *y, 130 | }, 131 | } 132 | }) 133 | .collect(); 134 | 135 | let sprites = SpriteSheet { 136 | texture_id: 250, 137 | sprites, 138 | }; 139 | 140 | let handle = { 141 | let loader = world.read_resource::(); 142 | loader.load_from_data( 143 | sprites, 144 | (), 145 | &world.read_resource::>(), 146 | ) 147 | }; 148 | 149 | world 150 | .write_resource::() 151 | .insert(250, handle.clone()); 152 | 153 | let anim_def = anim_def 154 | .iter() 155 | .map(|(k, v)| { 156 | ( 157 | k.to_owned(), 158 | Animation::new( 159 | handle.clone(), 160 | v.0.iter() 161 | .map(|(name, duration)| (*sprites_hash.get(name).unwrap(), *duration)) 162 | .collect(), 163 | v.1.clone(), 164 | ), 165 | ) 166 | }) 167 | .into_iter() 168 | .collect(); 169 | 170 | anim_def 171 | } 172 | -------------------------------------------------------------------------------- /src/state/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "nk_state" 3 | description = "Game made for IGMC 2018 by MGDA" 4 | version = "0.1.0" 5 | authors = ["Tiago Nascimento "] 6 | edition = "2018" 7 | 8 | homepage = "https://gamedev.maringa.br/igmc-2018" 9 | documentation = "https://gamedev.maringa.br/igmc-2018/docs/nk_state" 10 | repository = "https://github.com/maringa-gamedev/rust-igmc-2018" 11 | 12 | readme = "README.md" 13 | license = "AGPLv3" 14 | 15 | [features] 16 | nightly = ["amethyst/nightly"] 17 | 18 | [dependencies] 19 | nk_data = { path = "../data/", version="0.1.0" } 20 | nk_ecs = { path = "../ecs/", version="0.1.0" } 21 | nk_loader = { path = "../loader/", version="0.1.0" } 22 | nk_util = { path = "../util/", version="0.1.0" } 23 | amethyst = { git = "https://github.com/amethyst/amethyst.git" } 24 | serde = "1.0" 25 | serde_derive = "1.0" 26 | ron = "0.4" 27 | log = "0.4" 28 | rand = "0.5" 29 | font-kit = "0.1" 30 | gilrs = "0.6" 31 | nalgebra = "0.16" 32 | ncollide2d = "0.17" 33 | itertools = "0.7" 34 | either = "1.5" 35 | image = "0.20" 36 | clap = "~2.32" 37 | -------------------------------------------------------------------------------- /src/state/src/bundle.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{ 2 | core::bundle::{Result, SystemBundle}, 3 | ecs::prelude::DispatcherBuilder, 4 | }; 5 | use nk_ecs::*; 6 | 7 | pub struct GameBundle; 8 | 9 | impl<'a, 'b> SystemBundle<'a, 'b> for GameBundle { 10 | fn build(self, builder: &mut DispatcherBuilder<'a, 'b>) -> Result<()> { 11 | builder.add(BackgroundAnimationSystem, "xto_bg_anim", &[]); 12 | builder.add(InventoryRenderSystem, "xto_inventory_render", &[]); 13 | builder.add(ControllerSystem::new(), "xto_controller", &[]); 14 | builder.add(ControlSystem, "xto_control", &["xto_controller"]); 15 | builder.add(InputSystem, "xto_input", &["xto_control"]); 16 | builder.add(AnimationSystem, "xto_animation", &["xto_control"]); 17 | builder.add(AutotileSystem::default(), "xto_autotile", &["xto_control"]); 18 | builder.add(MovementSystem, "xto_movement", &["xto_input"]); 19 | builder.add(CollisionSystem, "xto_collision", &["xto_movement"]); 20 | builder.add(LayerSystem, "xto_layer", &["xto_collision"]); 21 | builder.add(InteractSystem, "xto_interact", &["xto_collision"]); 22 | builder.add(InteractionSystem, "xto_interaction", &["xto_interact"]); 23 | builder.add(TimerSystem, "xto_timer", &[]); 24 | builder.add(ScoreSystem, "xto_score", &["xto_timer"]); 25 | builder.add(GenerateSystem, "xto_generate", &[]); 26 | builder.add(OrdersSystem, "xto_orders", &[]); 27 | builder.add(MeltSystem, "xto_melt", &[]); 28 | Ok(()) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/state/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![feature(type_ascription)] 2 | #![feature(exclusive_range_pattern)] 3 | #![feature(vec_remove_item)] 4 | 5 | use amethyst::{ 6 | core::{cgmath::*, transform::GlobalTransform}, 7 | ecs::prelude::*, 8 | renderer::{Camera, Projection, ScreenDimensions}, 9 | }; 10 | use log::*; 11 | 12 | mod bundle; 13 | mod freeplay; 14 | mod game; 15 | mod load; 16 | 17 | const V_W: f32 = 240.0; 18 | const V_H: f32 = 136.0; 19 | 20 | const TIMER_STR: &str = "timer"; 21 | 22 | const SCORE_LEFT_STR: &str = "score_left"; 23 | const SCORE_RIGHT_STR: &str = "score_right"; 24 | 25 | const SCORE_WIDTH: f32 = 118.0; 26 | const SCORE_HEIGHT: f32 = 18.0; 27 | const SCORE_SIZE: f32 = 20.0; 28 | 29 | const TIMER_WIDTH: f32 = 71.0; 30 | const TIMER_HEIGHT: f32 = 26.0; 31 | const TIMER_SIZE: f32 = 46.0; 32 | 33 | const FONT_COLOR: [f32; 4] = [0.0, 0.0, 0.0, 1.0]; 34 | 35 | pub fn update_viewport(camera: Entity, world: &mut World) -> Entity { 36 | world 37 | .delete_entity(camera) 38 | .expect("Failed to delete camera entity."); 39 | 40 | let (width, height) = { 41 | let dim = world.read_resource::(); 42 | (dim.width(), dim.height()) 43 | }; 44 | 45 | let aspect_ratio = V_W / V_H; 46 | let screen_ratio = width / height; 47 | let (cam_x, cam_y, cam_w, cam_h) = if screen_ratio < aspect_ratio { 48 | let has = width / aspect_ratio; 49 | let y = (height - has) / 2.0; 50 | (0.0, y, width, has) 51 | } else if screen_ratio > aspect_ratio { 52 | let was = height * aspect_ratio; 53 | let x = (width - was) / 2.0; 54 | (x, 0.0, was, height) 55 | } else { 56 | (0.0, 0.0, width, height) 57 | }; 58 | info!("Screen: {} x {}", width, height); 59 | info!("Aspect: {} x {}", cam_w, cam_h); 60 | info!("Position: {} x {}", cam_x, cam_y); 61 | 62 | let camera = world 63 | .create_entity() 64 | .with(Camera::from(Projection::Orthographic(Ortho { 65 | left: cam_x, 66 | right: cam_w, 67 | top: cam_h, 68 | bottom: cam_y, 69 | near: 0.0, 70 | far: 1152.0, 71 | }))) 72 | .with(GlobalTransform(Matrix4::from_translation( 73 | Vector3::new(0.0, 0.0, 128.0).into(), 74 | ))) 75 | .build(); 76 | 77 | camera 78 | } 79 | 80 | pub use self::{bundle::*, freeplay::*, game::*, load::*}; 81 | -------------------------------------------------------------------------------- /src/state/src/load.rs: -------------------------------------------------------------------------------- 1 | use super::freeplay::*; 2 | use amethyst::{ 3 | assets::Loader, 4 | core::{ 5 | cgmath::*, 6 | transform::{GlobalTransform, Transform}, 7 | }, 8 | ecs::prelude::*, 9 | input::{is_close_requested, is_key_down}, 10 | prelude::*, 11 | renderer::{Camera, Projection, SpriteRender, Transparent, VirtualKeyCode}, 12 | ui::{Anchor, FontAsset, FontHandle, TtfFormat, UiFinder, UiText, UiTransform}, 13 | utils::application_root_dir, 14 | }; 15 | use clap::ArgMatches; 16 | use log::*; 17 | use nk_data::*; 18 | use nk_ecs::*; 19 | use nk_loader::*; 20 | use nk_util::*; 21 | use ron::de::from_reader; 22 | use std::{ 23 | collections::HashMap, 24 | fs::File, 25 | sync::{Arc, Mutex}, 26 | }; 27 | 28 | #[derive(Debug, Default)] 29 | pub struct Load { 30 | camera: Option, 31 | entities: Vec, 32 | } 33 | 34 | impl<'a, 'b> SimpleState<'a, 'b> for Load { 35 | fn on_start(&mut self, data: StateData) { 36 | let StateData { mut world, .. } = data; 37 | 38 | world.register::(); 39 | world.register::(); 40 | world.register::(); 41 | world.register::(); 42 | 43 | let camera = world 44 | .create_entity() 45 | .with(Camera::from(Projection::Orthographic(Ortho { 46 | left: 0.0, 47 | right: VIEW_WIDTH, 48 | top: VIEW_HEIGHT, 49 | bottom: 0.0, 50 | near: 0.0, 51 | far: 1152.0, 52 | }))) 53 | .with(GlobalTransform(Matrix4::from_translation( 54 | Vector3::new(0.0, 0.0, 128.0).into(), 55 | ))) 56 | .build(); 57 | self.camera = Some(camera); 58 | 59 | initialise_audio(&mut world); 60 | let (player_handle, mut animations) = load_players_texture(&mut world); 61 | let (items_handle, items_anims) = load_items_texture(&mut world); 62 | let flavors_anims = load_flavors_texture(&mut world); 63 | let toppings_anims = load_toppings_texture(&mut world); 64 | let (map_handle, empty_handle, map_anims) = load_map_texture(&mut world); 65 | let (bg_handle, hud_handle, title_handle) = load_ui_texture(&mut world); 66 | let (buttons_handle, progress_handle, interaction_anims) = 67 | load_interaction_texture(&mut world); 68 | let (score_font, timer_font) = load_number_fonts(&mut world); 69 | let ui_anims = load_ui_sprites(&mut world); 70 | 71 | world.add_resource(Handles { 72 | player_handle, 73 | items_handle, 74 | map_handle, 75 | bg_handle, 76 | empty_handle, 77 | hud_handle, 78 | buttons_handle, 79 | progress_handle, 80 | score_font, 81 | timer_font, 82 | }); 83 | 84 | animations.extend(items_anims); 85 | animations.extend(flavors_anims); 86 | animations.extend(toppings_anims); 87 | animations.extend(map_anims); 88 | animations.extend(interaction_anims); 89 | animations.extend(ui_anims); 90 | info!("Loaded Animations: {:?}", animations); 91 | world.add_resource(Animations { animations }); 92 | 93 | generate_bg(&mut world); 94 | info!("Generated background!"); 95 | 96 | let palette: HashMap> = { 97 | let path = format!("{}/assets/data/palette.ron", application_root_dir()); 98 | let f = File::open(&path).expect("Failed opening 'palette.ron' file!"); 99 | match from_reader(f): Result<[(String, u8, u8, u8, u8); 8], _> { 100 | Ok(x) => x 101 | .iter() 102 | .map(|x| (x.0.clone(), image::Rgba([x.2, x.3, x.4, x.1]))) 103 | .collect(), 104 | Err(e) => { 105 | error!("Error parsing palette definition: {}", e); 106 | panic!("Invalid palette definition <{}>!", path); 107 | } 108 | } 109 | }; 110 | info!("Loaded palette: {:?}", palette); 111 | world.add_resource(Arc::new(Mutex::new(palette))); 112 | 113 | let defs = load_game_data(); 114 | info!("Loaded definitions: {:?}", defs); 115 | world.add_resource(defs); 116 | 117 | let mut title_transform = Transform::default(); 118 | title_transform.translation = Vector3::new(MAP_WIDTH / 2.0, MAP_HEIGHT / 2.0, 0.0); 119 | let title_card = world 120 | .create_entity() 121 | .with(SpriteRender { 122 | sprite_sheet: title_handle, 123 | sprite_number: 0, 124 | flip_horizontal: false, 125 | flip_vertical: false, 126 | }) 127 | .with(Transparent) 128 | .with(title_transform) 129 | .with(GlobalTransform::default()) 130 | .build(); 131 | self.entities.push(title_card); 132 | } 133 | 134 | fn handle_event( 135 | &mut self, 136 | data: StateData, 137 | event: StateEvent, 138 | ) -> SimpleTrans<'a, 'b> { 139 | let StateData { world, .. } = data; 140 | 141 | if let StateEvent::Window(event) = &event { 142 | if is_close_requested(&event) || is_key_down(&event, VirtualKeyCode::Q) { 143 | return Trans::Quit; 144 | } else if is_key_down(&event, VirtualKeyCode::Return) { 145 | return Trans::Switch(Box::new(FreePlay::default())); 146 | } 147 | } 148 | Trans::None 149 | } 150 | 151 | fn update( 152 | &mut self, 153 | StateData { 154 | ref mut world, 155 | data, 156 | }: &mut StateData, 157 | ) -> SimpleTrans<'a, 'b> { 158 | //if let Some(camera) = self.camera.take() { 159 | //super::update_viewport(camera, world); 160 | //} 161 | 162 | Trans::None 163 | } 164 | 165 | fn on_stop(&mut self, data: StateData) { 166 | let StateData { world, .. } = data; 167 | world 168 | .delete_entities(self.entities.as_slice()) 169 | .expect("Failed to clean world of Load's entities!"); 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /src/util/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "nk_util" 3 | description = "Game made for IGMC 2018 by MGDA" 4 | version = "0.1.0" 5 | authors = ["Tiago Nascimento "] 6 | edition = "2018" 7 | 8 | homepage = "https://gamedev.maringa.br/igmc-2018" 9 | documentation = "https://gamedev.maringa.br/igmc-2018/docs/nk_util" 10 | repository = "https://github.com/maringa-gamedev/rust-igmc-2018" 11 | 12 | readme = "README.md" 13 | license = "AGPLv3" 14 | 15 | [features] 16 | nightly = ["amethyst/nightly"] 17 | 18 | [dependencies] 19 | nk_data = { path = "../data/", version="0.1.0" } 20 | nk_ecs = { path = "../ecs/", version="0.1.0" } 21 | amethyst = { git = "https://github.com/amethyst/amethyst.git" } 22 | serde = "1.0" 23 | serde_derive = "1.0" 24 | ron = "0.4" 25 | log = "0.4" 26 | rand = "0.5" 27 | font-kit = "0.1" 28 | gilrs = "0.6" 29 | nalgebra = "0.16" 30 | ncollide2d = "0.17" 31 | itertools = "0.7" 32 | either = "1.5" 33 | clap = "~2.32" 34 | -------------------------------------------------------------------------------- /src/util/src/bg.rs: -------------------------------------------------------------------------------- 1 | use amethyst::{ 2 | core::{ 3 | cgmath::*, 4 | transform::{GlobalTransform, Transform}, 5 | }, 6 | ecs::prelude::*, 7 | renderer::SpriteRender, 8 | }; 9 | use nk_data::*; 10 | use nk_ecs::*; 11 | 12 | pub fn generate_bg(world: &mut World) -> Vec { 13 | let width_count = (VIEW_WIDTH / 16.0) as usize + 2; 14 | let height_count = (VIEW_HEIGHT / 16.0) as usize + 2; 15 | 16 | let bg_handle = { world.read_resource::().bg_handle.clone() }; 17 | (0..width_count) 18 | .map(|i| { 19 | (0..height_count) 20 | .map(|j| { 21 | let mut transform = Transform::default(); 22 | transform.translation = Vector3::new( 23 | 8.0 + (i as isize - 1) as f32 * 16.0, 24 | 8.0 + (j as isize - 1) as f32 * 16.0, 25 | -1020.0, 26 | ); 27 | world 28 | .create_entity() 29 | .with(SpriteRender { 30 | sprite_sheet: bg_handle.clone(), 31 | sprite_number: 0, 32 | flip_horizontal: false, 33 | flip_vertical: false, 34 | }) 35 | .with(Background { 36 | from: Vector2::new( 37 | 8.0 + (i as isize - 1) as f32 * 16.0, 38 | 8.0 + (j as isize - 1) as f32 * 16.0, 39 | ), 40 | to: Vector2::new(8.0 + i as f32 * 16.0, 8.0 + j as f32 * 16.0), 41 | timer: 0.0, 42 | }) 43 | .with(transform) 44 | .with(GlobalTransform::default()) 45 | .build() 46 | }) 47 | .collect() 48 | }) 49 | .fold( 50 | Vec::with_capacity(width_count * height_count), 51 | |mut acc, v: Vec| { 52 | acc.extend(v); 53 | acc 54 | }, 55 | ) 56 | } 57 | -------------------------------------------------------------------------------- /src/util/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod bg; 2 | mod map; 3 | mod ui; 4 | 5 | pub use self::{bg::*, map::*, ui::*}; 6 | --------------------------------------------------------------------------------