├── .gitattributes ├── .github ├── issue_template.md ├── pull_request_template.md └── workflows │ ├── lint.yml │ └── snapshot.yml ├── .gitignore ├── CONTRIBUTING.md ├── Earthfile ├── LICENSE ├── README.md ├── branding ├── suffragium_badge.svg ├── suffragium_badge_sp.png ├── suffragium_logo.svg └── suffragium_logo_sp.png ├── builds └── .gitignore ├── game ├── app │ ├── README.md │ ├── end_game_menu │ │ ├── end_game_menu.gd │ │ └── end_game_menu.tscn │ ├── images │ │ ├── alpha_pixel_1.png │ │ ├── alpha_pixel_1.png.import │ │ ├── cogwheel_16.png │ │ ├── cogwheel_16.png.import │ │ ├── cross_40.png │ │ ├── cross_40.png.import │ │ ├── plus_40.png │ │ ├── plus_40.png.import │ │ ├── suffragium_badge_36.png │ │ └── suffragium_badge_36.png.import │ ├── pause_menu │ │ ├── pause_menu.gd │ │ └── pause_menu.tscn │ ├── scenes │ │ ├── about.gd │ │ ├── data_manager.gd │ │ ├── game_card.gd │ │ ├── game_card.tscn │ │ ├── game_card_add_yours.gd │ │ ├── game_card_add_yours.tscn │ │ ├── menu.gd │ │ ├── menu.tscn │ │ ├── settings.gd │ │ └── splash_screen │ │ │ ├── logo_splash.gd │ │ │ ├── logo_splash.tscn │ │ │ ├── splash_logo_part_1.png │ │ │ ├── splash_logo_part_1.png.import │ │ │ ├── splash_logo_part_2.png │ │ │ ├── splash_logo_part_2.png.import │ │ │ ├── splashed_menu.tscn │ │ │ ├── suffragium_logo.wav │ │ │ └── suffragium_logo.wav.import │ ├── shader │ │ └── blur.shader │ ├── singleton │ │ ├── game_manager.gd │ │ ├── player_manager.gd │ │ ├── user_settings.gd │ │ └── utils.gd │ ├── style │ │ ├── main_theme.tres │ │ ├── round_icon_button_theme.tres │ │ ├── theme_game_card.tres │ │ └── title_font.tres │ └── suffragium_logo_ani_160.webm ├── default_env.tres ├── export_presets.snapshot.cfg ├── games │ ├── asecondguy_connect │ │ ├── ai.gd │ │ ├── ai.tscn │ │ ├── chip.gd │ │ ├── chip.tscn │ │ ├── connect.gd │ │ ├── connect.png │ │ ├── connect.png.import │ │ ├── connect.tscn │ │ ├── game.cfg │ │ ├── grid.gd │ │ ├── grid.gdshader │ │ ├── player_select_theme.tres │ │ ├── slow_label.gd │ │ ├── ui │ │ │ ├── player_configurator.gd │ │ │ ├── player_configurator.tscn │ │ │ └── player_select.gd │ │ ├── win_line.gd │ │ └── win_line.tscn │ ├── flappybird │ │ ├── background.png.import │ │ ├── camera.gd │ │ ├── game.cfg │ │ ├── images │ │ │ ├── background.png │ │ │ ├── background.png.import │ │ │ ├── bird.png │ │ │ ├── bird.png.import │ │ │ ├── clouds.png │ │ │ ├── clouds.png.import │ │ │ ├── ground.png │ │ │ ├── ground.png.import │ │ │ ├── lower_wall.png │ │ │ ├── lower_wall.png.import │ │ │ ├── upper_wall.png │ │ │ └── upper_wall.png.import │ │ ├── player.gd │ │ ├── player.tscn │ │ ├── sounds │ │ │ └── sfx │ │ │ │ ├── game_end.wav │ │ │ │ ├── game_end.wav.import │ │ │ │ ├── jump.wav │ │ │ │ ├── jump.wav.import │ │ │ │ ├── pass_wall.wav │ │ │ │ └── pass_wall.wav.import │ │ ├── wall.gd │ │ ├── wall_node.tscn │ │ └── world.tscn │ ├── pixel_side_scroller │ │ ├── camera │ │ │ ├── camera.gd │ │ │ └── camera.tscn │ │ ├── entitys │ │ │ ├── damage_trigger.gd │ │ │ ├── damage_trigger.tscn │ │ │ ├── goal.gd │ │ │ ├── goal.tscn │ │ │ ├── help_trigger.gd │ │ │ ├── help_trigger.tscn │ │ │ ├── spawn.tscn │ │ │ ├── star.gd │ │ │ └── star.tscn │ │ ├── game.cfg │ │ ├── icon.png │ │ ├── icon.png.import │ │ ├── main.gd │ │ ├── main.tscn │ │ ├── maps │ │ │ ├── 000_walking_tutorial.tscn │ │ │ ├── 001_jumping_tutorial.tscn │ │ │ ├── 002_first_real_level.tscn │ │ │ ├── 003_climbing_up.tscn │ │ │ ├── 004_its_a_trap.tscn │ │ │ └── map_manager.gd │ │ ├── objects │ │ │ ├── box.tscn │ │ │ ├── ground.tscn │ │ │ ├── spikes.tscn │ │ │ └── tower.tscn │ │ ├── pawns │ │ │ ├── character │ │ │ │ ├── character.gd │ │ │ │ ├── character.png │ │ │ │ ├── character.png.import │ │ │ │ └── character.tscn │ │ │ ├── input.gd │ │ │ ├── jump_curve.tres │ │ │ ├── movement.gd │ │ │ ├── pawn.gd │ │ │ └── pawn.tscn │ │ ├── sounds │ │ │ └── sfx │ │ │ │ ├── collect_star.wav │ │ │ │ ├── collect_star.wav.import │ │ │ │ ├── hit.wav │ │ │ │ ├── hit.wav.import │ │ │ │ ├── jump.wav │ │ │ │ ├── jump.wav.import │ │ │ │ ├── jump_land.wav │ │ │ │ ├── jump_land.wav.import │ │ │ │ ├── level_up.wav │ │ │ │ ├── level_up.wav.import │ │ │ │ ├── step.wav │ │ │ │ ├── step.wav.import │ │ │ │ ├── trap_activate.wav │ │ │ │ └── trap_activate.wav.import │ │ ├── tilesets │ │ │ ├── rock.png │ │ │ ├── rock.png.import │ │ │ └── rock.tres │ │ ├── ui │ │ │ ├── help_box.gd │ │ │ ├── help_box.tscn │ │ │ ├── ui.gd │ │ │ └── ui.tscn │ │ └── utils.gd │ ├── snake │ │ ├── canvas.gd │ │ ├── canvas.tscn │ │ ├── color_schemes │ │ │ ├── classic.png │ │ │ ├── classic.png.import │ │ │ ├── firefly.png │ │ │ ├── firefly.png.import │ │ │ ├── matchstick.png │ │ │ ├── matchstick.png.import │ │ │ ├── rainbow.png │ │ │ └── rainbow.png.import │ │ ├── game.cfg │ │ ├── snake.gd │ │ ├── snake.png │ │ ├── snake.png.import │ │ ├── snake.tscn │ │ ├── snake_color_selection.gd │ │ └── snake_color_selection.tscn │ ├── sortit │ │ ├── assets │ │ │ ├── blender │ │ │ │ ├── block.blend │ │ │ │ ├── magnet_box.blend │ │ │ │ ├── numbers.blend │ │ │ │ ├── pedestal.blend │ │ │ │ └── play_area.blend │ │ │ ├── images │ │ │ │ ├── activate_magnets.png │ │ │ │ ├── activate_magnets.png.import │ │ │ │ ├── arrow.png │ │ │ │ ├── arrow.png.import │ │ │ │ ├── attract_boxes.png │ │ │ │ ├── attract_boxes.png.import │ │ │ │ ├── attracted_box.png │ │ │ │ ├── attracted_box.png.import │ │ │ │ ├── black_boxes.png │ │ │ │ ├── black_boxes.png.import │ │ │ │ ├── compare_boxes.png │ │ │ │ ├── compare_boxes.png.import │ │ │ │ ├── correct_order.png │ │ │ │ ├── correct_order.png.import │ │ │ │ ├── place_boxes.png │ │ │ │ ├── place_boxes.png.import │ │ │ │ ├── start.png │ │ │ │ ├── start.png.import │ │ │ │ ├── wrong_order.png │ │ │ │ └── wrong_order.png.import │ │ │ ├── materials │ │ │ │ ├── body.material │ │ │ │ ├── box_body.material │ │ │ │ ├── box_color.material │ │ │ │ ├── building_sides.material │ │ │ │ ├── building_top.material │ │ │ │ ├── cabel.material │ │ │ │ ├── floor.material │ │ │ │ ├── magnet_left.material │ │ │ │ ├── magnet_right.material │ │ │ │ ├── pedestal.material │ │ │ │ ├── pedestal_accent.material │ │ │ │ ├── pedestal_screen.material │ │ │ │ ├── ring.material │ │ │ │ └── selector.material │ │ │ ├── numbers.tres │ │ │ └── style │ │ │ │ └── theme.tres │ │ ├── box.gd │ │ ├── box.tscn │ │ ├── game.cfg │ │ ├── game.gd │ │ ├── game.tscn │ │ ├── icon.png │ │ ├── icon.png.import │ │ ├── pedestal.gd │ │ ├── pedestal.tscn │ │ ├── pedestal_group.gd │ │ ├── pedestal_group.tscn │ │ ├── player.gd │ │ ├── player.tscn │ │ ├── players.gd │ │ ├── sort_it.gd │ │ ├── sort_it.tscn │ │ ├── ui │ │ │ ├── help.gd │ │ │ ├── help.tscn │ │ │ ├── mini_map.gd │ │ │ ├── mini_map.tscn │ │ │ ├── player_select.gd │ │ │ ├── player_select.tscn │ │ │ ├── player_selector.gd │ │ │ ├── player_selector.tscn │ │ │ ├── remaining_time.gd │ │ │ ├── status_display.gd │ │ │ └── status_display.tscn │ │ └── viewports.gd │ └── testgame │ │ ├── README.md │ │ ├── balloon.png │ │ ├── balloon.png.import │ │ ├── balloon.tscn │ │ ├── balloon_pop.gd │ │ ├── balloon_pop.tscn │ │ ├── game.cfg │ │ ├── help │ │ ├── help.gd │ │ ├── help.png │ │ ├── help.png.import │ │ └── help.tscn │ │ ├── string.png │ │ └── string.png.import ├── icon.png ├── icon.png.import ├── project.godot ├── shared │ └── fonts │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── caveat.tres │ │ ├── caveat │ │ ├── OFL.txt │ │ ├── README.txt │ │ ├── caveat_variable_font_wght.ttf │ │ └── static │ │ │ ├── caveat_bold.ttf │ │ │ ├── caveat_medium.ttf │ │ │ ├── caveat_regular.ttf │ │ │ └── caveat_semi_bold.ttf │ │ ├── press_start2p.tres │ │ ├── press_start2p │ │ ├── OFL.txt │ │ └── press_start2p_regular.ttf │ │ ├── press_start_2p_18px.tres │ │ ├── roboto.tres │ │ ├── roboto │ │ ├── LICENSE.txt │ │ ├── roboto_black.ttf │ │ ├── roboto_black_italic.ttf │ │ ├── roboto_bold.ttf │ │ ├── roboto_bold_italic.ttf │ │ ├── roboto_italic.ttf │ │ ├── roboto_light.ttf │ │ ├── roboto_light_italic.ttf │ │ ├── roboto_medium.ttf │ │ ├── roboto_medium_italic.ttf │ │ ├── roboto_regular.ttf │ │ ├── roboto_thin.ttf │ │ └── roboto_thin_italic.ttf │ │ ├── roboto_mono.tres │ │ └── roboto_mono │ │ ├── LICENSE.txt │ │ ├── README.txt │ │ ├── roboto_mono_italic_variable_font_wght.ttf │ │ ├── roboto_mono_variable_font_wght.ttf │ │ └── static │ │ ├── roboto_mono_bold.ttf │ │ ├── roboto_mono_bold_italic.ttf │ │ ├── roboto_mono_extra_light.ttf │ │ ├── roboto_mono_extra_light_italic.ttf │ │ ├── roboto_mono_italic.ttf │ │ ├── roboto_mono_light.ttf │ │ ├── roboto_mono_light_italic.ttf │ │ ├── roboto_mono_medium.ttf │ │ ├── roboto_mono_medium_italic.ttf │ │ ├── roboto_mono_regular.ttf │ │ ├── roboto_mono_semi_bold.ttf │ │ ├── roboto_mono_semi_bold_italic.ttf │ │ ├── roboto_mono_thin.ttf │ │ └── roboto_mono_thin_italic.ttf └── translations │ ├── tr.csv │ └── tr.csv.import └── tools ├── pull_requests_overview ├── pull_requests_overview.html ├── script.js └── styles.css └── run_gdtoolkit.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto eol=lf 3 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | # Description 2 | Please select the type of issue you are reporting: 3 | - [ ] Feature Request 4 | - [ ] Bug Report 5 | 6 | Please describe your issue or feature request: 7 | 8 | # Failure Information (for Bugs only) 9 | ## Steps to reproduce the issue 10 | Please provide detailed steps to reproduce the issue. 11 | 12 | 1. step 1 13 | 2. step 2 14 | 3. step 3 15 | ... 16 | 17 | ## Context 18 | Please provide the relevant context about your setup: 19 | - OS: 20 | - Hardware: 21 | - Software versions: 22 | - Additional information: 23 | 24 | ## Logs 25 | Please provide any relevant logs that may have been generated during your encounter with the issue here. 26 | 27 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Description 2 | Please describe the changes you made to the codebase/project files here. 3 | Include all relevant context for the changes and list all new dependencies. 4 | If your change has visual implications on the project, please provide screenshots or animated GIFs of the changes. 5 | 6 | Related to # (issue) 7 | 8 | ## Type of change 9 | - [ ] Bug fix (non breaking change that fixes an issue) 10 | - [ ] New feature (non breaking change that adds functionality) 11 | - [ ] Tooling (non breaking change that adds functionality to the workflow) 12 | - [ ] Breaking change (fix or feature that causes existing functionality to not work as expected) 13 | 14 | ## Environment 15 | Please describe your environment and remove nonapplicable environment information from this section. 16 | - OS: 17 | - Hardware: 18 | - Software versions: 19 | - IDE: 20 | 21 | ## Testing 22 | Please describe the testing you performed on the codebase/project files here and how other users can reproduce your results. 23 | 24 | # Checklist 25 | - [ ] My code follows the general style guidelines of the project 26 | - [ ] I have perfomed a self-review of my code 27 | - [ ] I have commented my code, particulary where it is unclear 28 | - [ ] My changes generate no new warnings or errors 29 | - [ ] The project compiles and runs correctly 30 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint 2 | 3 | # Controls when the workflow will run 4 | on: 5 | # Triggers the workflow on push or pull request events but only for the main branch 6 | push: 7 | branches: [ main ] 8 | pull_request: 9 | branches: [ main ] 10 | 11 | # Allows you to run this workflow manually from the Actions tab 12 | workflow_dispatch: 13 | 14 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 15 | jobs: 16 | # This workflow contains a single job called "build" 17 | lint: 18 | # The type of runner that the job will run on 19 | runs-on: ubuntu-latest 20 | 21 | steps: 22 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 23 | - uses: actions/checkout@v3 24 | # set-up python (required for godot-gdscript-toolkit) 25 | - name: Setup Python 26 | uses: actions/setup-python@v3.1.2 27 | 28 | # Install godot-gdscript-toolkit 29 | - name: Install godot-gdscript-toolkit 30 | run: pip3 install 'gdtoolkit==3.*' 31 | 32 | # lint all gd files 33 | - name: Lint all the gd files with gdtoolkit 34 | run: gdlint game/ 35 | 36 | - name: Suggest changes with gdformat 37 | run: gdformat -d game/ 38 | -------------------------------------------------------------------------------- /.github/workflows/snapshot.yml: -------------------------------------------------------------------------------- 1 | name: Builds a Snapshot 2 | 3 | on: 4 | # Triggers the workflow on push or pull request 5 | push: 6 | pull_request: 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v2 14 | 15 | - name: Download latest earthly 16 | run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'" 17 | 18 | - name: Earthly version 19 | run: earthly --version 20 | 21 | - name: Run build 22 | run: | 23 | cd game 24 | mv export_presets.snapshot.cfg export_presets.cfg 25 | cd .. 26 | earthly +build 27 | 28 | # Publish Artifacts for download 29 | - name: Publish Windows 30 | uses: actions/upload-artifact@v3 31 | with: 32 | name: windows 33 | path: builds/windows 34 | 35 | - name: Publish Linux 36 | uses: actions/upload-artifact@v3 37 | with: 38 | name: linux 39 | path: builds/linux 40 | 41 | - name: Publish HTMl5 42 | uses: actions/upload-artifact@v3 43 | with: 44 | name: html5 45 | path: builds/html5 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Godot-specific ignores 2 | .import/ 3 | export.cfg 4 | export_presets.cfg 5 | *.translation 6 | 7 | # Mono-specific ignores 8 | .mono/ 9 | data_*/ 10 | 11 | # OS-specific ignores 12 | .DS_Store 13 | Thumbs.db 14 | 15 | # Blender 16 | *.blend1 -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Suffragium 2 | 3 | There are many ways, how you can contribute and be part of this project. 4 | 5 | The most meaningful are: 6 | 7 | - Open a pull request 8 | - Vote 9 | - Give feedback 10 | 11 | --- 12 | 13 | ## Open a Pull Request 14 | 15 | If you want to add a feature or fix a bug. Pull Requests are the way to go. Try to keep them short and simple and follow the developer guide. 16 | 17 | ### Developer guide 18 | 19 | #### REQUIRED 20 | 21 | - Follow the [GDScript style guide](https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_styleguide.html#gdscript-style-guide) 22 | - Use [Scony's godot gdscript tollkit](https://github.com/Scony/godot-gdscript-toolkit/) to validate the Pull Request 23 | 24 | #### RECOMMENDED 25 | 26 | - Folder names are in snake_case 27 | - File names are in snake_case 28 | - Node names are in PascalCase 29 | 30 | --- 31 | 32 | ## How to Vote 33 | 34 | Place a :+1: or :-1: emoji on the initial post of a pull request. 35 | If you're creating a PR to fix a blocking issue that currently breaks the project, i.e. a critical fix that shouldn't be delayed, use the :rocket: emoji. 36 | Once the merge conditions are met, the pull request can be merged. 37 | 38 | ## Merge pull request conditions 39 | 40 | If one of them is true, the PR will me merged. 41 | 42 | - **Last commit is 24h or older** and **has more than 10 votes** and **75% positive votes** 43 | - **Last commit is 72h or older** and **75% positive votes** 44 | - **PR fixes a blocking issue** that prevents the main branch from editing/building/running (e.g. due to engine changes) and has at least **2 :rocket: votes**, excluding the author 45 | 46 | ## Close pull request without merging conditions 47 | 48 | If its true, the pull request / draft is considered as blocked and will be closed 49 | 50 | - **Last commit is 20 days or older** 51 | -------------------------------------------------------------------------------- /Earthfile: -------------------------------------------------------------------------------- 1 | build-base: 2 | FROM barichello/godot-ci:3.4.4 3 | 4 | WORKDIR game 5 | COPY ./game . 6 | RUN mkdir -p /builds 7 | 8 | build-linux: 9 | FROM +build-base 10 | RUN godot -v --export "Linux" /builds/suffragium 11 | 12 | SAVE ARTIFACT /builds/* 13 | 14 | build-html5: 15 | FROM +build-base 16 | RUN godot -v --export "HTML5" /builds/suffragium.html 17 | 18 | SAVE ARTIFACT /builds/* 19 | 20 | build-windows: 21 | FROM +build-base 22 | RUN godot -v --export "Windows" /builds/suffragium.exe 23 | 24 | SAVE ARTIFACT /builds/* 25 | 26 | build: 27 | FROM busybox 28 | 29 | WORKDIR builds 30 | COPY builds/.gitignore . 31 | COPY +build-windows/ windows 32 | COPY +build-linux/ linux 33 | COPY +build-html5/ html5 34 | 35 | SAVE ARTIFACT . AS LOCAL ./builds -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |  2 | # Suffragium 3 | A game developed in a democratic cycle. 4 | 5 | Everyone can participate in this project. Just open a pull request 6 | with a feature you'd like to be added. 7 | Maybe your PR gets merged, or maybe not. The community decides. 8 | Look into [CONTRIBUTING](https://github.com/letsgamedev/Suffragium/blob/main/CONTRIBUTING.md#contributing-to-suffragium) 9 | for more informations. 10 | 11 | Learn how to add a minigame [here](game/games/testgame/README.md). 12 | Learn more about the minigame framework [here](game/app/README.md). 13 | 14 | For more information please watch this *german* video on youtube. 15 | Trust me, it's not a rick roll. Or is it? 16 | https://www.youtube.com/watch?v=IyOwaiQkkic 17 | -------------------------------------------------------------------------------- /branding/suffragium_badge.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 14 | 20 | 26 | 32 | 33 | 36 | 40 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /branding/suffragium_badge_sp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/branding/suffragium_badge_sp.png -------------------------------------------------------------------------------- /branding/suffragium_logo_sp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/branding/suffragium_logo_sp.png -------------------------------------------------------------------------------- /builds/.gitignore: -------------------------------------------------------------------------------- 1 | # This directory contains build artifacts, that are not version controlled. 2 | # For documentation purposes this directory is empty 3 | * 4 | !.gitignore -------------------------------------------------------------------------------- /game/app/end_game_menu/end_game_menu.gd: -------------------------------------------------------------------------------- 1 | extends CanvasLayer 2 | 3 | var _game_config = null 4 | 5 | onready var _main := $Control 6 | onready var _label := $Control/CC/VC/Label 7 | 8 | 9 | func _ready(): 10 | pass 11 | 12 | 13 | func _input(event: InputEvent): 14 | if !event is InputEventKey: 15 | return 16 | 17 | if event.is_echo(): 18 | return 19 | 20 | if event.is_action_pressed("ui_cancel"): 21 | get_tree().set_input_as_handled() 22 | _on_ButtonMenu_pressed() 23 | elif event.is_action_pressed("ui_accept"): 24 | _on_ButtonRestart_pressed() 25 | get_tree().set_input_as_handled() 26 | 27 | 28 | func open(text, game_config): 29 | _game_config = game_config 30 | 31 | if text == null: 32 | text = "T_GAME_ENDED" 33 | 34 | _label.text = text 35 | 36 | get_tree().paused = true 37 | 38 | 39 | func close(): 40 | get_tree().paused = false 41 | queue_free() 42 | 43 | 44 | func _on_ButtonRestart_pressed(): 45 | close() 46 | GameManager.load_game(_game_config) 47 | 48 | 49 | func _on_ButtonMenu_pressed(): 50 | close() 51 | Utils.change_scene(GameManager.MENU_PATH) 52 | -------------------------------------------------------------------------------- /game/app/end_game_menu/end_game_menu.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=2] 2 | 3 | [ext_resource path="res://app/style/theme_game_card.tres" type="Theme" id=1] 4 | [ext_resource path="res://app/shader/blur.shader" type="Shader" id=2] 5 | [ext_resource path="res://app/end_game_menu/end_game_menu.gd" type="Script" id=3] 6 | 7 | [sub_resource type="ShaderMaterial" id=3] 8 | shader = ExtResource( 2 ) 9 | shader_param/amount = 2.0 10 | 11 | [node name="EndGameMenu" type="CanvasLayer"] 12 | pause_mode = 2 13 | layer = 128 14 | script = ExtResource( 3 ) 15 | 16 | [node name="Control" type="Control" parent="."] 17 | anchor_right = 1.0 18 | anchor_bottom = 1.0 19 | theme = ExtResource( 1 ) 20 | 21 | [node name="BlurShader" type="ColorRect" parent="Control"] 22 | material = SubResource( 3 ) 23 | anchor_right = 1.0 24 | anchor_bottom = 1.0 25 | 26 | [node name="ColorRect" type="ColorRect" parent="Control"] 27 | anchor_right = 1.0 28 | anchor_bottom = 1.0 29 | color = Color( 0, 0, 0, 0.501961 ) 30 | __meta__ = { 31 | "_edit_use_anchors_": false 32 | } 33 | 34 | [node name="CC" type="CenterContainer" parent="Control"] 35 | anchor_right = 1.0 36 | anchor_bottom = 1.0 37 | 38 | [node name="VC" type="VBoxContainer" parent="Control/CC"] 39 | margin_left = 432.0 40 | margin_top = 247.0 41 | margin_right = 592.0 42 | margin_bottom = 352.0 43 | custom_constants/separation = 8 44 | 45 | [node name="Label" type="Label" parent="Control/CC/VC"] 46 | margin_right = 160.0 47 | margin_bottom = 19.0 48 | text = "T_PAUSED" 49 | align = 1 50 | 51 | [node name="ButtonRestart" type="Button" parent="Control/CC/VC"] 52 | margin_top = 27.0 53 | margin_right = 160.0 54 | margin_bottom = 62.0 55 | text = "T_RESTART" 56 | 57 | [node name="ButtonMenu" type="Button" parent="Control/CC/VC"] 58 | margin_top = 70.0 59 | margin_right = 160.0 60 | margin_bottom = 105.0 61 | text = "T_BACK_TO_MENU" 62 | 63 | [connection signal="pressed" from="Control/CC/VC/ButtonRestart" to="." method="_on_ButtonRestart_pressed"] 64 | [connection signal="pressed" from="Control/CC/VC/ButtonMenu" to="." method="_on_ButtonMenu_pressed"] 65 | -------------------------------------------------------------------------------- /game/app/images/alpha_pixel_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/app/images/alpha_pixel_1.png -------------------------------------------------------------------------------- /game/app/images/alpha_pixel_1.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/alpha_pixel_1.png-22cac7682bfdb021c302c5a6fb592fe1.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://app/images/alpha_pixel_1.png" 13 | dest_files=[ "res://.import/alpha_pixel_1.png-22cac7682bfdb021c302c5a6fb592fe1.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/app/images/cogwheel_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/app/images/cogwheel_16.png -------------------------------------------------------------------------------- /game/app/images/cogwheel_16.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/cogwheel_16.png-1a53f86a71bc0c4d5cc0e0fac3594f02.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://app/images/cogwheel_16.png" 13 | dest_files=[ "res://.import/cogwheel_16.png-1a53f86a71bc0c4d5cc0e0fac3594f02.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/app/images/cross_40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/app/images/cross_40.png -------------------------------------------------------------------------------- /game/app/images/cross_40.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/cross_40.png-5d266cee772eaa15ad3622643b58093f.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://app/images/cross_40.png" 13 | dest_files=[ "res://.import/cross_40.png-5d266cee772eaa15ad3622643b58093f.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/app/images/plus_40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/app/images/plus_40.png -------------------------------------------------------------------------------- /game/app/images/plus_40.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/plus_40.png-063b268a2450fac1945025127ed10902.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://app/images/plus_40.png" 13 | dest_files=[ "res://.import/plus_40.png-063b268a2450fac1945025127ed10902.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/app/images/suffragium_badge_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/app/images/suffragium_badge_36.png -------------------------------------------------------------------------------- /game/app/images/suffragium_badge_36.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/suffragium_badge_36.png-08c5e1b714d735780b3fec7c879efe03.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://app/images/suffragium_badge_36.png" 13 | dest_files=[ "res://.import/suffragium_badge_36.png-08c5e1b714d735780b3fec7c879efe03.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/app/pause_menu/pause_menu.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=2] 2 | 3 | [ext_resource path="res://app/style/theme_game_card.tres" type="Theme" id=1] 4 | [ext_resource path="res://app/shader/blur.shader" type="Shader" id=2] 5 | [ext_resource path="res://app/pause_menu/pause_menu.gd" type="Script" id=4] 6 | 7 | [sub_resource type="ShaderMaterial" id=3] 8 | shader = ExtResource( 2 ) 9 | shader_param/amount = 2.0 10 | 11 | [node name="PauseMenu" type="CanvasLayer"] 12 | pause_mode = 2 13 | layer = 128 14 | script = ExtResource( 4 ) 15 | 16 | [node name="Control" type="Control" parent="."] 17 | anchor_right = 1.0 18 | anchor_bottom = 1.0 19 | theme = ExtResource( 1 ) 20 | 21 | [node name="BlurShader" type="ColorRect" parent="Control"] 22 | material = SubResource( 3 ) 23 | anchor_right = 1.0 24 | anchor_bottom = 1.0 25 | 26 | [node name="ColorRect" type="ColorRect" parent="Control"] 27 | anchor_right = 1.0 28 | anchor_bottom = 1.0 29 | color = Color( 0, 0, 0, 0.501961 ) 30 | __meta__ = { 31 | "_edit_use_anchors_": false 32 | } 33 | 34 | [node name="CC" type="CenterContainer" parent="Control"] 35 | anchor_right = 1.0 36 | anchor_bottom = 1.0 37 | 38 | [node name="VC" type="VBoxContainer" parent="Control/CC"] 39 | margin_left = 432.0 40 | margin_top = 226.0 41 | margin_right = 592.0 42 | margin_bottom = 374.0 43 | custom_constants/separation = 8 44 | 45 | [node name="Label" type="Label" parent="Control/CC/VC"] 46 | margin_right = 160.0 47 | margin_bottom = 19.0 48 | text = "T_PAUSED" 49 | align = 1 50 | 51 | [node name="ButtonResume" type="Button" parent="Control/CC/VC"] 52 | margin_top = 27.0 53 | margin_right = 160.0 54 | margin_bottom = 62.0 55 | text = "T_RESUME" 56 | 57 | [node name="ButtonRestart" type="Button" parent="Control/CC/VC"] 58 | margin_top = 70.0 59 | margin_right = 160.0 60 | margin_bottom = 105.0 61 | text = "T_RESTART" 62 | 63 | [node name="CustomBtns" type="VBoxContainer" parent="Control/CC/VC"] 64 | visible = false 65 | margin_top = 113.0 66 | margin_right = 160.0 67 | margin_bottom = 277.0 68 | custom_constants/separation = 8 69 | 70 | [node name="ButtonMenu" type="Button" parent="Control/CC/VC"] 71 | margin_top = 113.0 72 | margin_right = 160.0 73 | margin_bottom = 148.0 74 | text = "T_BACK_TO_MENU" 75 | 76 | [connection signal="pressed" from="Control/CC/VC/ButtonResume" to="." method="_on_ButtonResume_pressed"] 77 | [connection signal="pressed" from="Control/CC/VC/ButtonRestart" to="." method="_on_ButtonRestart_pressed"] 78 | [connection signal="pressed" from="Control/CC/VC/ButtonMenu" to="." method="_on_ButtonMenu_pressed"] 79 | -------------------------------------------------------------------------------- /game/app/scenes/game_card_add_yours.gd: -------------------------------------------------------------------------------- 1 | extends PanelContainer 2 | 3 | var _menu 4 | 5 | 6 | func set_menu_node(menu): 7 | _menu = menu 8 | 9 | 10 | func _on_Button_pressed(): 11 | _menu.open_participation_tab() 12 | -------------------------------------------------------------------------------- /game/app/scenes/game_card_add_yours.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://app/images/plus_40.png" type="Texture" id=1] 4 | [ext_resource path="res://app/style/theme_game_card.tres" type="Theme" id=2] 5 | [ext_resource path="res://app/scenes/game_card_add_yours.gd" type="Script" id=3] 6 | 7 | [node name="GameCardAddYours" type="PanelContainer"] 8 | margin_right = 320.0 9 | margin_bottom = 180.0 10 | rect_min_size = Vector2( 320, 180 ) 11 | theme = ExtResource( 2 ) 12 | script = ExtResource( 3 ) 13 | 14 | [node name="VBoxContainer" type="VBoxContainer" parent="."] 15 | margin_left = 86.0 16 | margin_top = 52.0 17 | margin_right = 234.0 18 | margin_bottom = 127.0 19 | size_flags_horizontal = 4 20 | size_flags_vertical = 4 21 | custom_constants/separation = 16 22 | 23 | [node name="TextureRect" type="TextureRect" parent="VBoxContainer"] 24 | margin_right = 148.0 25 | margin_bottom = 40.0 26 | texture = ExtResource( 1 ) 27 | stretch_mode = 4 28 | 29 | [node name="Label" type="Label" parent="VBoxContainer"] 30 | margin_top = 56.0 31 | margin_right = 148.0 32 | margin_bottom = 75.0 33 | text = "T_ADD_YOUR_GAME" 34 | 35 | [node name="Button" type="TextureButton" parent="."] 36 | margin_left = 12.0 37 | margin_top = 5.0 38 | margin_right = 308.0 39 | margin_bottom = 175.0 40 | 41 | [connection signal="pressed" from="Button" to="." method="_on_Button_pressed"] 42 | -------------------------------------------------------------------------------- /game/app/scenes/settings.gd: -------------------------------------------------------------------------------- 1 | extends ScrollContainer 2 | 3 | const LOCALE_NAMES = { 4 | "en": "English", 5 | "de": "Deutsch", 6 | } 7 | 8 | var languages = [] 9 | 10 | onready var language_selection: OptionButton = $MC/VC/VC/Language/OptionButton 11 | 12 | 13 | func _ready(): 14 | _setup() 15 | 16 | 17 | func _setup(): 18 | _setup_language_selection() 19 | _setup_smooth_scroll_setting() 20 | 21 | 22 | func _setup_language_selection(): 23 | language_selection.clear() 24 | languages.clear() 25 | var active_language_code = TranslationServer.get_locale() 26 | for language_code in TranslationServer.get_loaded_locales(): 27 | if LOCALE_NAMES.has(language_code): 28 | language_selection.add_item(LOCALE_NAMES[language_code]) 29 | else: 30 | language_selection.add_item(TranslationServer.get_locale_name(language_code)) 31 | languages.push_back(language_code) 32 | if language_code == active_language_code: 33 | language_selection.select(language_selection.get_item_count() - 1) 34 | 35 | 36 | func _setup_smooth_scroll_setting(): 37 | var smooth_scroll = UserSettings.get_setting("smooth_scroll") 38 | $MC/VC/VC/SmoothScroll/CheckBox.pressed = smooth_scroll 39 | 40 | 41 | func _on_ButtonResetDefaults_pressed(): 42 | UserSettings.reset_to_default() 43 | _setup() 44 | 45 | 46 | func _on_LanguageSelection_item_selected(index: int): 47 | var language_code = languages[index] 48 | UserSettings.set_setting("language_code", language_code) 49 | 50 | 51 | func _on_CheckBoxSmoothScroll_toggled(button_pressed: bool): 52 | UserSettings.set_setting("smooth_scroll", button_pressed) 53 | -------------------------------------------------------------------------------- /game/app/scenes/splash_screen/logo_splash.gd: -------------------------------------------------------------------------------- 1 | extends Control 2 | # warning-ignore-all:return_value_discarded 3 | 4 | onready var _splash_logo: Control = $SplashLogo 5 | 6 | onready var _background: ColorRect = $Background 7 | onready var _overlay: ColorRect = $Overlay 8 | 9 | onready var _tween: Tween = _splash_logo.get_node("Tween") 10 | 11 | onready var _audio_player: AudioStreamPlayer = _splash_logo.get_node("AudioStreamPlayer") 12 | 13 | onready var _part_1: TextureRect = _splash_logo.get_node("Part1") 14 | onready var _part_2: TextureRect = _splash_logo.get_node("Part2") 15 | 16 | 17 | func _ready(): 18 | var logo_scale = OS.get_window_size().x / 1228.0 * 0.64 19 | _splash_logo.rect_scale = Vector2(logo_scale, logo_scale) 20 | 21 | yield(get_tree().create_timer(0.25), "timeout") 22 | # Step 1 - Show "S" logo 23 | _tween.interpolate_property( 24 | _overlay, 25 | "color", 26 | Color(0, 0, 0, 1), 27 | Color(0, 0, 0, 0), 28 | 0.25, 29 | Tween.TRANS_QUAD, 30 | Tween.EASE_IN 31 | ) 32 | _tween.start() 33 | yield(_tween, "tween_completed") 34 | # Step 2 - Move "S" logo to the left, show "Suffragium" test and play sound 35 | _tween.interpolate_property( 36 | _part_1, "rect_position:x", -347, -849, 0.5, Tween.TRANS_QUAD, Tween.EASE_IN_OUT 37 | ) 38 | _tween.interpolate_property( 39 | _part_2, "rect_position:x", -347, 238, 0.5, Tween.TRANS_QUAD, Tween.EASE_IN_OUT 40 | ) 41 | _audio_player.play() 42 | _tween.start() 43 | yield(_tween, "tween_completed") 44 | # Step 3 - Wait 1 sec 45 | yield(get_tree().create_timer(1.0), "timeout") 46 | # Step 4 - Fadeout logo and text 47 | _tween.interpolate_property( 48 | _overlay, 49 | "color", 50 | Color(0, 0, 0, 0), 51 | Color(0, 0, 0, 1), 52 | 0.16, 53 | Tween.TRANS_QUAD, 54 | Tween.EASE_OUT 55 | ) 56 | _tween.start() 57 | yield(_tween, "tween_completed") 58 | # Step 4 - Fadeout Scene 59 | _background.visible = false 60 | _splash_logo.visible = false 61 | _tween.interpolate_property( 62 | _overlay, 63 | "color", 64 | Color(0, 0, 0, 1), 65 | Color(0, 0, 0, 0), 66 | 0.5, 67 | Tween.TRANS_QUAD, 68 | Tween.EASE_OUT 69 | ) 70 | _tween.start() 71 | yield(_tween, "tween_completed") 72 | # Step 5 - Remove Scene 73 | queue_free() 74 | -------------------------------------------------------------------------------- /game/app/scenes/splash_screen/logo_splash.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=2] 2 | 3 | [ext_resource path="res://app/scenes/splash_screen/splash_logo_part_1.png" type="Texture" id=1] 4 | [ext_resource path="res://app/scenes/splash_screen/splash_logo_part_2.png" type="Texture" id=2] 5 | [ext_resource path="res://app/scenes/splash_screen/logo_splash.gd" type="Script" id=3] 6 | [ext_resource path="res://app/scenes/splash_screen/suffragium_logo.wav" type="AudioStream" id=4] 7 | 8 | [node name="LogoSplash" type="Control"] 9 | anchor_right = 1.0 10 | anchor_bottom = 1.0 11 | script = ExtResource( 3 ) 12 | 13 | [node name="Background" type="ColorRect" parent="."] 14 | anchor_right = 1.0 15 | anchor_bottom = 1.0 16 | color = Color( 0, 0, 0, 1 ) 17 | __meta__ = { 18 | "_edit_use_anchors_": false 19 | } 20 | 21 | [node name="SplashLogo" type="Control" parent="."] 22 | anchor_left = 0.5 23 | anchor_top = 0.5 24 | anchor_right = 0.5 25 | anchor_bottom = 0.5 26 | margin_left = -614.0 27 | margin_top = -113.0 28 | margin_right = 614.0 29 | margin_bottom = 113.0 30 | rect_min_size = Vector2( 1228, 226 ) 31 | rect_pivot_offset = Vector2( 614, 113 ) 32 | __meta__ = { 33 | "_edit_use_anchors_": false 34 | } 35 | 36 | [node name="Part2" type="TextureRect" parent="SplashLogo"] 37 | margin_left = -347.0 38 | margin_right = 727.0 39 | margin_bottom = 226.0 40 | texture = ExtResource( 2 ) 41 | __meta__ = { 42 | "_edit_use_anchors_": false 43 | } 44 | 45 | [node name="Part1" type="TextureRect" parent="SplashLogo"] 46 | margin_left = -347.0 47 | margin_right = 727.0 48 | margin_bottom = 226.0 49 | texture = ExtResource( 1 ) 50 | 51 | [node name="Tween" type="Tween" parent="SplashLogo"] 52 | 53 | [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="SplashLogo"] 54 | stream = ExtResource( 4 ) 55 | volume_db = -10.0 56 | 57 | [node name="Overlay" type="ColorRect" parent="."] 58 | anchor_right = 1.0 59 | anchor_bottom = 1.0 60 | color = Color( 0, 0, 0, 1 ) 61 | __meta__ = { 62 | "_edit_use_anchors_": false 63 | } 64 | -------------------------------------------------------------------------------- /game/app/scenes/splash_screen/splash_logo_part_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/app/scenes/splash_screen/splash_logo_part_1.png -------------------------------------------------------------------------------- /game/app/scenes/splash_screen/splash_logo_part_1.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/splash_logo_part_1.png-acc8e1d1e00ebfb0a60f544fc20fb682.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://app/scenes/splash_screen/splash_logo_part_1.png" 13 | dest_files=[ "res://.import/splash_logo_part_1.png-acc8e1d1e00ebfb0a60f544fc20fb682.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/app/scenes/splash_screen/splash_logo_part_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/app/scenes/splash_screen/splash_logo_part_2.png -------------------------------------------------------------------------------- /game/app/scenes/splash_screen/splash_logo_part_2.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/splash_logo_part_2.png-4502ac2b0817eb221e5b748f4de11331.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://app/scenes/splash_screen/splash_logo_part_2.png" 13 | dest_files=[ "res://.import/splash_logo_part_2.png-4502ac2b0817eb221e5b748f4de11331.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/app/scenes/splash_screen/splashed_menu.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://app/scenes/splash_screen/logo_splash.tscn" type="PackedScene" id=2] 4 | [ext_resource path="res://app/scenes/menu.tscn" type="PackedScene" id=3] 5 | 6 | [node name="SplashedMenu" type="Node"] 7 | 8 | [node name="Menu" parent="." instance=ExtResource( 3 )] 9 | 10 | [node name="LogoSplash" parent="." instance=ExtResource( 2 )] 11 | -------------------------------------------------------------------------------- /game/app/scenes/splash_screen/suffragium_logo.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/app/scenes/splash_screen/suffragium_logo.wav -------------------------------------------------------------------------------- /game/app/scenes/splash_screen/suffragium_logo.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/suffragium_logo.wav-f7ca717f2ac54e847726927f4a5c2711.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://app/scenes/splash_screen/suffragium_logo.wav" 10 | dest_files=[ "res://.import/suffragium_logo.wav-f7ca717f2ac54e847726927f4a5c2711.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop=false 21 | compress/mode=0 22 | -------------------------------------------------------------------------------- /game/app/shader/blur.shader: -------------------------------------------------------------------------------- 1 | shader_type canvas_item; 2 | 3 | uniform float amount: hint_range(0.0, 5.0); 4 | 5 | void fragment() { 6 | COLOR.rgb = textureLod(SCREEN_TEXTURE, SCREEN_UV, amount).rgb; 7 | } 8 | -------------------------------------------------------------------------------- /game/app/singleton/player_manager.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | 4 | func get_current_player() -> String: 5 | return "p" 6 | -------------------------------------------------------------------------------- /game/app/singleton/user_settings.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | const SETTINGS_FILENAME = "user://user_settings.suffragiumsave" 4 | 5 | var settings = { 6 | "language_code": null, 7 | "smooth_scroll": null, 8 | } 9 | 10 | 11 | func _ready(): 12 | _set_defaults() 13 | _load_settings_from_file() 14 | _apply_loaded_settings() 15 | 16 | 17 | func reset_to_default(): 18 | _set_defaults() 19 | _save_settings_to_file() 20 | _apply_loaded_settings() 21 | 22 | 23 | func set_setting(setting_key: String, value): 24 | if settings.has(setting_key): 25 | settings[setting_key] = value 26 | _save_settings_to_file() 27 | _apply_setting(setting_key) 28 | else: 29 | push_error("can't set setting_key '%s' (no match)" % setting_key) 30 | 31 | 32 | func get_setting(setting_key: String): 33 | if settings.has(setting_key): 34 | return settings[setting_key] 35 | push_error("can't get setting_key '%s' (no match)" % setting_key) 36 | 37 | 38 | func _set_defaults(): 39 | settings["language_code"] = OS.get_locale_language() 40 | settings["smooth_scroll"] = true 41 | 42 | 43 | func _load_settings_from_file(): 44 | var save_file = File.new() 45 | if not save_file.file_exists(SETTINGS_FILENAME): 46 | _save_settings_to_file() 47 | return 48 | save_file.open(SETTINGS_FILENAME, File.READ) 49 | var save_dict = parse_json(save_file.get_line()) 50 | for setting_key in save_dict: 51 | if settings.has(setting_key): 52 | settings[setting_key] = save_dict[setting_key] 53 | else: 54 | push_error("setting_key '%s' present in save_file has no match" % setting_key) 55 | save_file.close() 56 | 57 | 58 | func _apply_loaded_settings(): 59 | TranslationServer.set_locale(settings["language_code"]) 60 | 61 | 62 | func _save_settings_to_file(): 63 | var save_dict = settings.duplicate() 64 | var save_file = File.new() 65 | save_file.open(SETTINGS_FILENAME, File.WRITE) 66 | save_file.store_line(to_json(save_dict)) 67 | save_file.close() 68 | 69 | 70 | func _apply_setting(setting_key): 71 | if setting_key == "language_code": 72 | TranslationServer.set_locale(settings["language_code"]) 73 | elif setting_key == "smooth_scroll": 74 | return 75 | -------------------------------------------------------------------------------- /game/app/singleton/utils.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | 4 | func open_url(url: String): 5 | Utils.handle_error(OS.shell_open(url)) 6 | 7 | 8 | func change_scene(scene_path: String): 9 | return print_error( 10 | get_tree().change_scene(scene_path), "Could not change scene to '%s'", [scene_path] 11 | ) 12 | 13 | 14 | func handle_error(err: int, err_msg: String = "", formats: Array = []) -> void: 15 | assert(err == print_error(err, err_msg, formats)) 16 | 17 | 18 | func print_error(err: int, err_msg: String = "", formats: Array = []) -> int: 19 | if err == OK: 20 | return OK 21 | if err_msg == "": 22 | push_error("Error %s" % err) 23 | return err 24 | if formats: 25 | err_msg = err_msg % formats 26 | push_error("Error %s - %s" % [err, err_msg]) 27 | return err 28 | 29 | 30 | func handle_tween_fail(success: bool): 31 | if not success: 32 | push_error("Tween returned false") 33 | -------------------------------------------------------------------------------- /game/app/style/round_icon_button_theme.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Theme" load_steps=8 format=2] 2 | 3 | [ext_resource path="res://shared/fonts/roboto/roboto_regular.ttf" type="DynamicFontData" id=1] 4 | 5 | [sub_resource type="StyleBoxFlat" id=24] 6 | bg_color = Color( 0.501961, 0.501961, 0.501961, 0.501961 ) 7 | border_width_left = 1 8 | border_width_top = 1 9 | border_width_right = 1 10 | border_width_bottom = 1 11 | border_color = Color( 0, 0, 0, 0 ) 12 | corner_radius_top_left = 21 13 | corner_radius_top_right = 21 14 | corner_radius_bottom_right = 21 15 | corner_radius_bottom_left = 21 16 | 17 | [sub_resource type="StyleBoxFlat" id=25] 18 | bg_color = Color( 0, 0, 0, 0 ) 19 | border_width_left = 2 20 | border_width_top = 3 21 | border_width_right = 2 22 | border_width_bottom = 3 23 | border_color = Color( 0.25098, 0.627451, 1, 1 ) 24 | border_blend = true 25 | corner_radius_top_left = 21 26 | corner_radius_top_right = 21 27 | corner_radius_bottom_right = 21 28 | corner_radius_bottom_left = 21 29 | 30 | [sub_resource type="StyleBoxFlat" id=26] 31 | bg_color = Color( 0.333333, 0.333333, 0.333333, 1 ) 32 | border_width_left = 1 33 | border_width_top = 1 34 | border_width_right = 1 35 | border_width_bottom = 1 36 | border_color = Color( 1, 1, 1, 0.501961 ) 37 | corner_radius_top_left = 21 38 | corner_radius_top_right = 21 39 | corner_radius_bottom_right = 21 40 | corner_radius_bottom_left = 21 41 | 42 | [sub_resource type="StyleBoxFlat" id=23] 43 | bg_color = Color( 0.266667, 0.266667, 0.266667, 1 ) 44 | border_width_left = 1 45 | border_width_top = 1 46 | border_width_right = 1 47 | border_width_bottom = 1 48 | border_color = Color( 0, 0, 0, 0 ) 49 | corner_radius_top_left = 21 50 | corner_radius_top_right = 21 51 | corner_radius_bottom_right = 21 52 | corner_radius_bottom_left = 21 53 | 54 | [sub_resource type="StyleBoxFlat" id=27] 55 | bg_color = Color( 0, 0, 0, 0.12549 ) 56 | border_width_left = 1 57 | border_width_top = 1 58 | border_width_right = 1 59 | border_width_bottom = 1 60 | border_color = Color( 0, 0, 0, 0 ) 61 | corner_radius_top_left = 21 62 | corner_radius_top_right = 21 63 | corner_radius_bottom_right = 21 64 | corner_radius_bottom_left = 21 65 | 66 | [sub_resource type="DynamicFont" id=21] 67 | font_data = ExtResource( 1 ) 68 | 69 | [resource] 70 | default_font = SubResource( 21 ) 71 | Button/colors/font_color = Color( 1, 1, 1, 1 ) 72 | Button/colors/font_color_focus = Color( 1, 1, 1, 1 ) 73 | Button/colors/font_color_hover = Color( 1, 1, 1, 1 ) 74 | Button/colors/font_color_pressed = Color( 1, 1, 1, 1 ) 75 | Button/constants/hseparation = 6 76 | Button/styles/disabled = SubResource( 24 ) 77 | Button/styles/focus = SubResource( 25 ) 78 | Button/styles/hover = SubResource( 26 ) 79 | Button/styles/normal = SubResource( 23 ) 80 | Button/styles/pressed = SubResource( 27 ) 81 | -------------------------------------------------------------------------------- /game/app/style/title_font.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="DynamicFont" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://shared/fonts/roboto/roboto_black.ttf" type="DynamicFontData" id=1] 4 | 5 | [resource] 6 | size = 26 7 | font_data = ExtResource( 1 ) 8 | -------------------------------------------------------------------------------- /game/app/suffragium_logo_ani_160.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/app/suffragium_logo_ani_160.webm -------------------------------------------------------------------------------- /game/default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | 5 | [resource] 6 | background_mode = 2 7 | background_sky = SubResource( 1 ) 8 | -------------------------------------------------------------------------------- /game/export_presets.snapshot.cfg: -------------------------------------------------------------------------------- 1 | [preset.0] 2 | 3 | name="Windows" 4 | platform="Windows Desktop" 5 | runnable=false 6 | custom_features="" 7 | export_filter="all_resources" 8 | include_filter="*.cfg" 9 | exclude_filter="" 10 | script_export_mode=1 11 | script_encryption_key="" 12 | 13 | [preset.0.options] 14 | 15 | custom_template/debug="" 16 | custom_template/release="" 17 | binary_format/64_bits=true 18 | binary_format/embed_pck=false 19 | texture_format/bptc=false 20 | texture_format/s3tc=true 21 | texture_format/etc=false 22 | texture_format/etc2=false 23 | texture_format/no_bptc_fallbacks=true 24 | codesign/enable=false 25 | codesign/identity_type=0 26 | codesign/identity="" 27 | codesign/password="" 28 | codesign/timestamp=true 29 | codesign/timestamp_server_url="" 30 | codesign/digest_algorithm=1 31 | codesign/description="" 32 | codesign/custom_options=PoolStringArray( ) 33 | application/icon="" 34 | application/file_version="0.0.1" 35 | application/product_version="0.0.1" 36 | application/company_name="Suffragium Community" 37 | application/product_name="Suffragium" 38 | application/file_description="" 39 | application/copyright="Suffragium Contributors" 40 | application/trademarks="" 41 | 42 | [preset.1] 43 | 44 | name="Linux" 45 | platform="Linux/X11" 46 | runnable=false 47 | custom_features="" 48 | export_filter="all_resources" 49 | include_filter="*.cfg" 50 | exclude_filter="" 51 | export_path="" 52 | script_export_mode=1 53 | script_encryption_key="" 54 | 55 | [preset.1.options] 56 | 57 | custom_template/debug="" 58 | custom_template/release="" 59 | binary_format/64_bits=true 60 | binary_format/embed_pck=false 61 | texture_format/bptc=false 62 | texture_format/s3tc=true 63 | texture_format/etc=false 64 | texture_format/etc2=false 65 | texture_format/no_bptc_fallbacks=true 66 | 67 | [preset.2] 68 | 69 | name="HTML5" 70 | platform="HTML5" 71 | runnable=false 72 | custom_features="" 73 | export_filter="all_resources" 74 | include_filter="*.cfg" 75 | exclude_filter="" 76 | export_path="" 77 | script_export_mode=1 78 | script_encryption_key="" 79 | 80 | [preset.2.options] 81 | 82 | custom_template/debug="" 83 | custom_template/release="" 84 | variant/export_type=0 85 | vram_texture_compression/for_desktop=true 86 | vram_texture_compression/for_mobile=false 87 | html/export_icon=true 88 | html/custom_html_shell="" 89 | html/head_include="" 90 | html/canvas_resize_policy=2 91 | html/focus_canvas_on_start=true 92 | html/experimental_virtual_keyboard=false 93 | progressive_web_app/enabled=false 94 | progressive_web_app/offline_page="" 95 | progressive_web_app/display=1 96 | progressive_web_app/orientation=0 97 | progressive_web_app/icon_144x144="" 98 | progressive_web_app/icon_180x180="" 99 | progressive_web_app/icon_512x512="" 100 | progressive_web_app/background_color=Color( 0, 0, 0, 1 ) 101 | -------------------------------------------------------------------------------- /game/games/asecondguy_connect/ai.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://games/asecondguy_connect/ai.gd" type="Script" id=1] 4 | 5 | [node name="AI" type="Node2D"] 6 | script = ExtResource( 1 ) 7 | 8 | [node name="Timer" type="Timer" parent="."] 9 | one_shot = true 10 | 11 | [node name="PickupTimer" type="Timer" parent="."] 12 | one_shot = true 13 | -------------------------------------------------------------------------------- /game/games/asecondguy_connect/chip.gd: -------------------------------------------------------------------------------- 1 | extends RigidBody2D 2 | 3 | var color := Color.green 4 | var player_id := -1 5 | 6 | var target_position: Vector2 7 | var _picked := false 8 | 9 | 10 | func _ready(): 11 | apply_central_impulse(Vector2.DOWN * 500) 12 | 13 | 14 | func _integrate_forces(state): 15 | if _picked: 16 | var move: Vector2 = target_position - global_position 17 | 18 | var result := Physics2DTestMotionResult.new() 19 | if !test_motion(move, true, 0.08, result): 20 | state.linear_velocity = move / state.step 21 | else: 22 | state.linear_velocity = move / state.step * result.collision_safe_fraction 23 | state.linear_velocity += result.collision_normal * result.collision_unsafe_fraction 24 | state.angular_velocity = 0 25 | 26 | 27 | func _on_chip_input_event(_viewport, event, _shape_idx): 28 | if !event is InputEventMouseButton: 29 | return 30 | if event.pressed: 31 | pick() 32 | else: 33 | unpick() 34 | 35 | 36 | func _input(event): 37 | if mode == MODE_STATIC: 38 | return 39 | if event is InputEventMouseButton: 40 | if !event.pressed: 41 | unpick() 42 | if event is InputEventMouseMotion: 43 | target_position = event.global_position 44 | 45 | 46 | func _draw(): 47 | var radius: float = $CollisionShape2D.shape.radius 48 | draw_circle(Vector2(), radius, color) 49 | draw_circle(Vector2(), radius - 2, color.darkened(0.5)) 50 | draw_arc(Vector2(), radius - 3, 0.1, 2, 10, color.lightened(0.5)) 51 | 52 | 53 | func pick(): 54 | _picked = true 55 | inertia = 1 56 | sleeping = false 57 | 58 | 59 | func unpick(): 60 | _picked = false 61 | sleeping = false 62 | 63 | 64 | func set_mouse_control(val: bool): 65 | set_process_input(val) 66 | input_pickable = val 67 | -------------------------------------------------------------------------------- /game/games/asecondguy_connect/chip.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://games/asecondguy_connect/chip.gd" type="Script" id=1] 4 | 5 | [sub_resource type="PhysicsMaterial" id=3] 6 | bounce = 0.1 7 | 8 | [sub_resource type="CircleShape2D" id=2] 9 | radius = 39.0 10 | 11 | [node name="chip" type="RigidBody2D"] 12 | collision_layer = 3 13 | input_pickable = true 14 | physics_material_override = SubResource( 3 ) 15 | gravity_scale = 10.0 16 | continuous_cd = 2 17 | angular_damp = 2.0 18 | script = ExtResource( 1 ) 19 | 20 | [node name="CollisionShape2D" type="CollisionShape2D" parent="."] 21 | shape = SubResource( 2 ) 22 | 23 | [connection signal="input_event" from="." to="." method="_on_chip_input_event"] 24 | -------------------------------------------------------------------------------- /game/games/asecondguy_connect/connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/asecondguy_connect/connect.png -------------------------------------------------------------------------------- /game/games/asecondguy_connect/connect.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/connect.png-1e1b3e1432e1c7036c8850d4920dd90b.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/asecondguy_connect/connect.png" 13 | dest_files=[ "res://.import/connect.png-1e1b3e1432e1c7036c8850d4920dd90b.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/asecondguy_connect/game.cfg: -------------------------------------------------------------------------------- 1 | ; This example file lists all required and optional Values 2 | ; It is meant for easy identification of games. 3 | 4 | [game] 5 | ; Choose a memorable name. 6 | name="Connect 4 Physics" 7 | ; Description supports bbcode. Say what your game is about. 8 | desc="Standard connect 4 but with physics" 9 | ; These paths are relative to the game folder. 10 | main_scene="connect.tscn" 11 | icon="connect.png" 12 | ; Version has no effect. But it might be shown in debug menus. 13 | version="1.0" 14 | ; Put your name here. 15 | creator="ASecondGuy" 16 | -------------------------------------------------------------------------------- /game/games/asecondguy_connect/grid.gd: -------------------------------------------------------------------------------- 1 | tool 2 | extends StaticBody2D 3 | 4 | export var tile_size := Vector2(25, 25) setget set_tile_size 5 | export var grid_size := Vector2(7, 6) setget set_grid_size 6 | export var grid_color := Color.black setget set_grid_color 7 | export var circle_size := .4 setget set_circle_size 8 | 9 | # helper for global_to_grid_pos() 10 | var _bounds := Rect2(Vector2(), grid_size) 11 | 12 | onready var _mouse_blocker := $MouseBlocker 13 | 14 | 15 | func _ready(): 16 | var shape := RectangleShape2D.new() 17 | shape.extents.x = 1 18 | shape.extents.y = grid_size.y * tile_size.y / 2 19 | for x in range(grid_size.x + 1): 20 | var node := CollisionShape2D.new() 21 | node.shape = shape 22 | node.position.x = x * tile_size.x 23 | node.position.y = shape.extents.y 24 | add_child(node) 25 | _mouse_blocker.rect_size = grid_size * tile_size 26 | 27 | 28 | func set_tile_size(val: Vector2): 29 | tile_size = val 30 | update() 31 | 32 | 33 | func set_circle_size(val: float): 34 | circle_size = val 35 | update() 36 | 37 | 38 | func set_grid_size(val: Vector2): 39 | grid_size = val 40 | _bounds = Rect2(Vector2(), grid_size) 41 | update() 42 | 43 | 44 | func set_grid_color(val: Color): 45 | grid_color = val 46 | update() 47 | 48 | 49 | func _draw(): 50 | _mouse_blocker.material.set_shader_param("grid_size", grid_size) 51 | _mouse_blocker.material.set_shader_param( 52 | "grid_color", Vector3(grid_color.r, grid_color.g, grid_color.b) 53 | ) 54 | _mouse_blocker.material.set_shader_param("circle_size", circle_size) 55 | 56 | 57 | func global_to_grid_pos(pos: Vector2): 58 | var floored := ((pos - global_position) / tile_size).floor() 59 | return floored 60 | 61 | 62 | func is_in_grid(pos: Vector2) -> bool: 63 | return _bounds.has_point(pos) 64 | 65 | 66 | func is_global_pos_in_grid(pos: Vector2): 67 | return _bounds.has_point(global_to_grid_pos(pos)) 68 | -------------------------------------------------------------------------------- /game/games/asecondguy_connect/grid.gdshader: -------------------------------------------------------------------------------- 1 | shader_type canvas_item; 2 | 3 | uniform vec2 grid_size; 4 | uniform vec3 grid_color = vec3(0.0, 0.0, 0.0); 5 | uniform float circle_size = .4; 6 | 7 | vec2 grid(vec2 uv, float columns, float rows){ 8 | return fract(vec2(uv.x * columns, uv.y * rows)); 9 | } 10 | 11 | float circle(vec2 position, float radius, float feather) 12 | { 13 | return smoothstep(radius, radius + feather, length(position - vec2(0.5))); 14 | } 15 | 16 | void fragment() { 17 | vec2 grid = grid(UV, grid_size.x, grid_size.y); 18 | if (circle(grid, circle_size, 0.005) < .5) { 19 | discard; 20 | } 21 | // COLOR = vec4(grid.r, gr.id.g, 0.0, 1.0); 22 | COLOR.rgb = grid_color; 23 | } 24 | -------------------------------------------------------------------------------- /game/games/asecondguy_connect/slow_label.gd: -------------------------------------------------------------------------------- 1 | extends Label 2 | 3 | var _time_left := 1.0 4 | var _time := 1.0 5 | var _full_text: String 6 | 7 | 8 | func start(new_text: String, time := 1.0): 9 | _time_left = time 10 | _time = time 11 | _full_text = tr(new_text) 12 | set_process(true) 13 | 14 | 15 | func _process(delta): 16 | _time_left -= delta 17 | # this is wanted 18 | # warning-ignore:narrowing_conversion 19 | text = _full_text.substr(0, round((_time - _time_left) * _full_text.length())) 20 | if _time_left <= 0: 21 | set_process(false) 22 | -------------------------------------------------------------------------------- /game/games/asecondguy_connect/ui/player_configurator.gd: -------------------------------------------------------------------------------- 1 | extends VBoxContainer 2 | 3 | var custom_name := false 4 | 5 | onready var _button_group: ButtonGroup = $CheckBox.group 6 | onready var _line_edit := $LineEdit 7 | onready var _color_picker := $ColorPickerButton 8 | onready var _first_button := $CheckBox 9 | 10 | 11 | func _ready(): 12 | # warning-ignore:return_value_discarded 13 | _button_group.connect("pressed", self, "_on_selection_change") 14 | _on_selection_change(_button_group.get_pressed_button()) 15 | #setup color picker 16 | var pick: ColorPicker = _color_picker.get_picker() 17 | pick.presets_visible = false 18 | 19 | 20 | func get_option(): 21 | return _button_group.get_pressed_button().get_index() - _first_button.get_index() 22 | 23 | 24 | func get_name(): 25 | return _line_edit.text 26 | 27 | 28 | func _get_auto_name() -> String: 29 | return tr(_button_group.get_pressed_button().text) 30 | 31 | 32 | func get_player_color(): 33 | return _color_picker.color 34 | 35 | 36 | func _on_LineEdit_text_changed(_new_text): 37 | custom_name = true 38 | 39 | 40 | func _on_selection_change(button: CheckBox): 41 | if !custom_name: 42 | _line_edit.text = tr(button.text) 43 | call_deferred("check_name") 44 | 45 | 46 | # this is futureproofed for many more than 2 players 47 | func check_name(): 48 | # don't check if the name is custom 49 | if !custom_name: 50 | var prev_names := [] 51 | # get all names of the previus player configurators 52 | for i in range(get_index()): 53 | prev_names.push_back(get_parent().get_child(i).get_name()) 54 | 55 | # find a possible name 56 | var pos_name: String = _get_auto_name() 57 | var j = 1 58 | while prev_names.has(pos_name): 59 | j += 1 60 | pos_name = str(get_name(), j) 61 | 62 | # save the new name 63 | _line_edit.text = pos_name 64 | 65 | # tell the next player configurator to check the name 66 | if get_parent().get_child_count() > get_index() + 1: 67 | get_parent().get_child(get_index() + 1).check_name() 68 | -------------------------------------------------------------------------------- /game/games/asecondguy_connect/ui/player_configurator.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://games/asecondguy_connect/ui/player_configurator.gd" type="Script" id=1] 4 | 5 | [sub_resource type="ButtonGroup" id=6] 6 | 7 | [node name="P1" type="VBoxContainer"] 8 | margin_right = 74.0 9 | margin_bottom = 80.0 10 | script = ExtResource( 1 ) 11 | 12 | [node name="LineEdit" type="LineEdit" parent="."] 13 | margin_right = 100.0 14 | margin_bottom = 24.0 15 | rect_min_size = Vector2( 100, 0 ) 16 | context_menu_enabled = false 17 | shortcut_keys_enabled = false 18 | selecting_enabled = false 19 | caret_blink = true 20 | 21 | [node name="ColorPickerButton" type="ColorPickerButton" parent="."] 22 | margin_top = 28.0 23 | margin_right = 100.0 24 | margin_bottom = 48.0 25 | color = Color( 1, 1, 0, 1 ) 26 | edit_alpha = false 27 | 28 | [node name="CheckBox" type="CheckBox" parent="."] 29 | margin_top = 52.0 30 | margin_right = 100.0 31 | margin_bottom = 76.0 32 | pressed = true 33 | group = SubResource( 6 ) 34 | text = "T_PLAYER" 35 | flat = true 36 | 37 | [node name="CheckBox2" type="CheckBox" parent="."] 38 | margin_top = 80.0 39 | margin_right = 100.0 40 | margin_bottom = 104.0 41 | group = SubResource( 6 ) 42 | text = "T_AI" 43 | flat = true 44 | 45 | [connection signal="text_changed" from="LineEdit" to="." method="_on_LineEdit_text_changed"] 46 | -------------------------------------------------------------------------------- /game/games/asecondguy_connect/ui/player_select.gd: -------------------------------------------------------------------------------- 1 | extends VBoxContainer 2 | 3 | const AI_PACKED_SCENE := preload("res://games/asecondguy_connect/ai.tscn") 4 | 5 | onready var _player_conf := $PC/HBox.get_children() 6 | onready var _game := $"../.." 7 | 8 | 9 | func _on_Button_pressed(): 10 | for conf in _player_conf: 11 | var player_id: int = _game.player_names.size() 12 | # setup anything type specific 13 | match conf.get_option(): 14 | 0: 15 | pass #Manual Player. No setup required 16 | 1: 17 | var ai = AI_PACKED_SCENE.instance() 18 | ai.player_id = player_id 19 | _game.add_child(ai) 20 | # warning-ignore:return_value_discarded 21 | _game.connect("chip_spawned", ai, "_on_chip_spawn", [], CONNECT_DEFERRED) 22 | #setup name 23 | _game.player_names.push_back(conf.get_name()) 24 | _game.player_colors.push_back(conf.get_player_color()) 25 | _game.start() 26 | hide() 27 | -------------------------------------------------------------------------------- /game/games/asecondguy_connect/win_line.gd: -------------------------------------------------------------------------------- 1 | tool 2 | extends Line2D 3 | 4 | const GRID_SIZE := Vector2(80, 78) 5 | 6 | var grid_points := [] 7 | var _rng := RandomNumberGenerator.new() 8 | 9 | 10 | func _ready(): 11 | _rng.randomize() 12 | $Timer.start() 13 | clear_points() 14 | add_point(grid_points[0] * GRID_SIZE + GRID_SIZE / 2) 15 | for _i in range(grid_points.size() - 2): 16 | add_point(Vector2()) 17 | _update_points() 18 | add_point(grid_points[-1] * GRID_SIZE + GRID_SIZE / 2) 19 | 20 | 21 | func _update_points(): 22 | for i in range(1, grid_points.size() - 1): 23 | var pos: Vector2 = ( 24 | grid_points[i] * GRID_SIZE 25 | + Vector2.ONE.rotated(deg2rad(_rng.randf_range(0, 360))) * 5 26 | ) 27 | pos += GRID_SIZE / 2 28 | set_point_position(i, pos) 29 | -------------------------------------------------------------------------------- /game/games/asecondguy_connect/win_line.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://games/asecondguy_connect/win_line.gd" type="Script" id=1] 4 | 5 | [node name="Line2D" type="Line2D"] 6 | width = 30.0 7 | default_color = Color( 0.501961, 1, 0.4, 1 ) 8 | joint_mode = 2 9 | begin_cap_mode = 2 10 | end_cap_mode = 2 11 | script = ExtResource( 1 ) 12 | 13 | [node name="Timer" type="Timer" parent="."] 14 | wait_time = 0.1 15 | 16 | [connection signal="timeout" from="Timer" to="." method="_update_points"] 17 | -------------------------------------------------------------------------------- /game/games/flappybird/background.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/background.png-d10d70b6a4e26f9fc0f62cebd2ceb622.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/flappybird/background.png" 13 | dest_files=[ "res://.import/background.png-d10d70b6a4e26f9fc0f62cebd2ceb622.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=1 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/flappybird/camera.gd: -------------------------------------------------------------------------------- 1 | extends Camera2D 2 | 3 | var default_zoom: float = 0.4 4 | var default_size: Vector2 = Vector2(1024, 600) 5 | 6 | 7 | func _ready(): 8 | # warning-ignore:return_value_discarded 9 | get_tree().get_root().connect("size_changed", self, "_on_resize") 10 | _on_resize() 11 | 12 | 13 | func _on_resize(): 14 | var new_size: Vector2 = get_viewport_rect().size 15 | var factor: Vector2 = Vector2.ZERO 16 | factor.x = default_size.x / new_size.x 17 | factor.y = default_size.y / new_size.y 18 | if factor.x > factor.y: 19 | zoom = Vector2(default_zoom * factor.x, default_zoom * factor.x) 20 | else: 21 | zoom = Vector2(default_zoom * factor.y, default_zoom * factor.y) 22 | -------------------------------------------------------------------------------- /game/games/flappybird/game.cfg: -------------------------------------------------------------------------------- 1 | ; This example file lists all required and optional Values 2 | ; It is meant for easy identification of games. 3 | 4 | [game] 5 | ; Choose a memorable name 6 | name="Flappy Bird" 7 | ; Say what your game is about 8 | desc="Press Space to Jump over the Walls" 9 | ; These paths are relative to the game folder 10 | main_scene="world.tscn" 11 | icon="./images/bird.png" 12 | ; Version has no effect. But it might be shown in debug menus. 13 | version="1.0" 14 | ; Put your name here 15 | creator="heriom" 16 | -------------------------------------------------------------------------------- /game/games/flappybird/images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/flappybird/images/background.png -------------------------------------------------------------------------------- /game/games/flappybird/images/background.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/background.png-e4c756ceca0c88f2bf286be5f2aa5849.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/flappybird/images/background.png" 13 | dest_files=[ "res://.import/background.png-e4c756ceca0c88f2bf286be5f2aa5849.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=1 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /game/games/flappybird/images/bird.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/flappybird/images/bird.png -------------------------------------------------------------------------------- /game/games/flappybird/images/bird.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/bird.png-d411a0fdac37bd6d0b532cd40a967bb5.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/flappybird/images/bird.png" 13 | dest_files=[ "res://.import/bird.png-d411a0fdac37bd6d0b532cd40a967bb5.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /game/games/flappybird/images/clouds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/flappybird/images/clouds.png -------------------------------------------------------------------------------- /game/games/flappybird/images/clouds.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/clouds.png-a865763136498b61c16b67fdc52857b6.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/flappybird/images/clouds.png" 13 | dest_files=[ "res://.import/clouds.png-a865763136498b61c16b67fdc52857b6.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=1 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /game/games/flappybird/images/ground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/flappybird/images/ground.png -------------------------------------------------------------------------------- /game/games/flappybird/images/ground.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/ground.png-aaaf35a0968f14af5df92be834885c9e.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/flappybird/images/ground.png" 13 | dest_files=[ "res://.import/ground.png-aaaf35a0968f14af5df92be834885c9e.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=1 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /game/games/flappybird/images/lower_wall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/flappybird/images/lower_wall.png -------------------------------------------------------------------------------- /game/games/flappybird/images/lower_wall.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/lower_wall.png-2eed081d30b4b367212961d8830e4c9a.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/flappybird/images/lower_wall.png" 13 | dest_files=[ "res://.import/lower_wall.png-2eed081d30b4b367212961d8830e4c9a.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /game/games/flappybird/images/upper_wall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/flappybird/images/upper_wall.png -------------------------------------------------------------------------------- /game/games/flappybird/images/upper_wall.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/upper_wall.png-b477fcd2ceb7e07013a8f0965fb2b8ad.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/flappybird/images/upper_wall.png" 13 | dest_files=[ "res://.import/upper_wall.png-b477fcd2ceb7e07013a8f0965fb2b8ad.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /game/games/flappybird/player.gd: -------------------------------------------------------------------------------- 1 | extends KinematicBody2D 2 | 3 | const UP: Vector2 = Vector2(0, -1) 4 | const FLAP_HEIGHT: float = 200.0 # flap time 5 | const WALL_DISTANCE: float = 1.2 # time between wall spawns 6 | const MAXFALLSPEED: float = 200.0 7 | const GRAVITY: float = 10.0 8 | const END_MESSAGE: String = "You got %s point(s)!" 9 | 10 | var timer: float = 0.0 # timer; spawning walls 11 | 12 | var motion: Vector2 = Vector2() 13 | var wall: PackedScene = preload("res://games/flappybird/wall_node.tscn") 14 | var score: int = 0 15 | var started: bool = false 16 | 17 | onready var _score_label: Label = $"../../CanvasLayer/ScoreLabel" 18 | onready var _start_label: Label = $"../../CanvasLayer/StartLabel" 19 | onready var _rng: RandomNumberGenerator = RandomNumberGenerator.new() 20 | 21 | 22 | func _physics_process(delta): 23 | # handle game start 24 | if not started: 25 | if Input.is_action_just_pressed("flap"): 26 | start_game() 27 | return 28 | 29 | if position.y > 130: 30 | end_game() 31 | return 32 | 33 | if Input.is_action_just_pressed("flap"): 34 | flap() 35 | 36 | add_to_timer(delta) 37 | motion.y += GRAVITY 38 | if motion.y > MAXFALLSPEED: 39 | motion.y = MAXFALLSPEED 40 | motion = move_and_slide(delta * 60 * motion, UP) 41 | 42 | 43 | # start the game 44 | func start_game(): 45 | _start_label.visible = false 46 | _rng.randomize() 47 | started = true 48 | 49 | 50 | func end_game(): 51 | set_physics_process(false) 52 | GameManager.end_game(END_MESSAGE % score, score) 53 | 54 | 55 | # flap when player presses ,,space" 56 | func flap(): 57 | if position.y > -80: 58 | motion.y = -FLAP_HEIGHT 59 | $Sound_Jump.play() 60 | 61 | 62 | # add delta to the timer 63 | func add_to_timer(delta): 64 | timer += delta 65 | 66 | if timer >= WALL_DISTANCE: 67 | timer = 0 68 | spawn_wall() 69 | 70 | 71 | # spawn a new wall when timer hits 1.2 72 | func spawn_wall(): 73 | var instance = wall.instance() 74 | 75 | instance.position = Vector2(300, _rng.randi_range(-60, 60)) 76 | get_parent().call_deferred("add_child", instance) 77 | 78 | 79 | # remove wall from node if colliding with reset area2d 80 | func _on_Reset_body_entered(body): 81 | if body.name == "Wall": 82 | body.queue_free() 83 | 84 | 85 | # add to score if player passes between 2 walls 86 | func _on_Hitbox_area_entered(area): 87 | if area.name == "PointHitbox": 88 | score += 1 89 | _score_label.text = str(score) 90 | $Sound_Wall.play() 91 | 92 | 93 | # reload scene if player hits wall body 94 | func _on_Hitbox_body_entered(body): 95 | if body.name == "Wall": 96 | # here would come a death sound when player dies ($Sound_GameEnd) 97 | # when the gamemanager is evolved enough to handle that, ill add it 98 | end_game() 99 | -------------------------------------------------------------------------------- /game/games/flappybird/player.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=2] 2 | 3 | [ext_resource path="res://games/flappybird/images/bird.png" type="Texture" id=1] 4 | [ext_resource path="res://games/flappybird/player.gd" type="Script" id=2] 5 | 6 | [sub_resource type="RectangleShape2D" id=1] 7 | extents = Vector2( 9, 9 ) 8 | 9 | [sub_resource type="RectangleShape2D" id=2] 10 | extents = Vector2( 9.5, 9.5 ) 11 | 12 | [node name="PlayerNode" type="Node2D"] 13 | 14 | [node name="Player" type="KinematicBody2D" parent="."] 15 | script = ExtResource( 2 ) 16 | 17 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Player"] 18 | shape = SubResource( 1 ) 19 | 20 | [node name="Sprite" type="Sprite" parent="Player"] 21 | scale = Vector2( 0.05, 0.05 ) 22 | texture = ExtResource( 1 ) 23 | 24 | [node name="Hitbox" type="Area2D" parent="Player"] 25 | 26 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Player/Hitbox"] 27 | shape = SubResource( 2 ) 28 | -------------------------------------------------------------------------------- /game/games/flappybird/sounds/sfx/game_end.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/flappybird/sounds/sfx/game_end.wav -------------------------------------------------------------------------------- /game/games/flappybird/sounds/sfx/game_end.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/game_end.wav-cd3623a9689433d32303d6dc9a5d8201.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://games/flappybird/sounds/sfx/game_end.wav" 10 | dest_files=[ "res://.import/game_end.wav-cd3623a9689433d32303d6dc9a5d8201.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop=false 21 | compress/mode=0 22 | -------------------------------------------------------------------------------- /game/games/flappybird/sounds/sfx/jump.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/flappybird/sounds/sfx/jump.wav -------------------------------------------------------------------------------- /game/games/flappybird/sounds/sfx/jump.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/jump.wav-2ee27a721f22ba0cc2bf9e4b496d601c.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://games/flappybird/sounds/sfx/jump.wav" 10 | dest_files=[ "res://.import/jump.wav-2ee27a721f22ba0cc2bf9e4b496d601c.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop=false 21 | compress/mode=0 22 | -------------------------------------------------------------------------------- /game/games/flappybird/sounds/sfx/pass_wall.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/flappybird/sounds/sfx/pass_wall.wav -------------------------------------------------------------------------------- /game/games/flappybird/sounds/sfx/pass_wall.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/pass_wall.wav-cf60de8eb78b2a340418387f640d0c72.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://games/flappybird/sounds/sfx/pass_wall.wav" 10 | dest_files=[ "res://.import/pass_wall.wav-cf60de8eb78b2a340418387f640d0c72.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop=false 21 | compress/mode=0 22 | -------------------------------------------------------------------------------- /game/games/flappybird/wall.gd: -------------------------------------------------------------------------------- 1 | extends StaticBody2D 2 | 3 | const MOVEMENT_VECTOR = Vector2(-120, 0) 4 | 5 | 6 | func _ready(): 7 | pass 8 | 9 | 10 | func _physics_process(delta): 11 | position += delta * MOVEMENT_VECTOR 12 | -------------------------------------------------------------------------------- /game/games/flappybird/wall_node.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=2] 2 | 3 | [ext_resource path="res://games/flappybird/images/lower_wall.png" type="Texture" id=1] 4 | [ext_resource path="res://games/flappybird/wall.gd" type="Script" id=2] 5 | [ext_resource path="res://games/flappybird/images/upper_wall.png" type="Texture" id=3] 6 | 7 | [sub_resource type="RectangleShape2D" id=1] 8 | extents = Vector2( 16, 160 ) 9 | 10 | [sub_resource type="RectangleShape2D" id=2] 11 | extents = Vector2( 10, 40 ) 12 | 13 | [node name="WallNode" type="Node2D"] 14 | 15 | [node name="Wall" type="StaticBody2D" parent="."] 16 | script = ExtResource( 2 ) 17 | 18 | [node name="UW_Sprite" type="Sprite" parent="Wall"] 19 | position = Vector2( 0, -200 ) 20 | scale = Vector2( -3.40362, 3.19952 ) 21 | texture = ExtResource( 3 ) 22 | 23 | [node name="UW_Collision" type="CollisionShape2D" parent="Wall"] 24 | position = Vector2( 0, -200 ) 25 | shape = SubResource( 1 ) 26 | 27 | [node name="LW_Sprite" type="Sprite" parent="Wall"] 28 | position = Vector2( 0.115783, 199.1 ) 29 | scale = Vector2( 3.50095, 3.17702 ) 30 | texture = ExtResource( 1 ) 31 | 32 | [node name="LW_Collision" type="CollisionShape2D" parent="Wall"] 33 | position = Vector2( 1.52588e-05, 199.777 ) 34 | shape = SubResource( 1 ) 35 | 36 | [node name="PointHitbox" type="Area2D" parent="Wall"] 37 | 38 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Wall/PointHitbox"] 39 | shape = SubResource( 2 ) 40 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/camera/camera.gd: -------------------------------------------------------------------------------- 1 | extends Camera2D 2 | 3 | var default_zoom: float = 0.4 4 | var default_size: Vector2 = Vector2(1024, 600) 5 | var target 6 | 7 | 8 | func _ready(): 9 | # warning-ignore:return_value_discarded 10 | get_tree().get_root().connect("size_changed", self, "_on_resize") 11 | _on_resize() 12 | 13 | 14 | func _process(_delta): 15 | if is_instance_valid(target): 16 | position = target.position 17 | 18 | 19 | func _on_resize(): 20 | var new_size: Vector2 = get_viewport_rect().size 21 | var factor: Vector2 = Vector2.ZERO 22 | factor.x = default_size.x / new_size.x 23 | factor.y = default_size.y / new_size.y 24 | if factor.x > factor.y: 25 | zoom = Vector2(default_zoom * factor.x, default_zoom * factor.x) 26 | else: 27 | zoom = Vector2(default_zoom * factor.y, default_zoom * factor.y) 28 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/camera/camera.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://games/pixel_side_scroller/camera/camera.gd" type="Script" id=1] 4 | 5 | [node name="Camera" type="Camera2D"] 6 | current = true 7 | zoom = Vector2( 0.4, 0.4 ) 8 | smoothing_enabled = true 9 | script = ExtResource( 1 ) 10 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/entitys/damage_trigger.gd: -------------------------------------------------------------------------------- 1 | tool 2 | extends Area2D 3 | 4 | export(Vector2) var trigger_size = Vector2(20, 20) setget _set_trigger_size 5 | onready var _main = get_tree().current_scene 6 | 7 | 8 | func _set_trigger_size(new_size: Vector2): 9 | trigger_size = new_size 10 | $CollisionShape2D.shape.extents = new_size 11 | 12 | 13 | func _on_HelpTrigger_body_entered(body): 14 | if body is KinematicBody2D and body.is_in_group("Player"): 15 | _main.kill_player() 16 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/entitys/damage_trigger.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://games/pixel_side_scroller/entitys/damage_trigger.gd" type="Script" id=1] 4 | 5 | [sub_resource type="RectangleShape2D" id=1] 6 | resource_local_to_scene = true 7 | extents = Vector2( 1, 1 ) 8 | 9 | [node name="DamageTrigger" type="Area2D"] 10 | script = ExtResource( 1 ) 11 | 12 | [node name="CollisionShape2D" type="CollisionShape2D" parent="."] 13 | shape = SubResource( 1 ) 14 | 15 | [connection signal="body_entered" from="." to="." method="_on_HelpTrigger_body_entered"] 16 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/entitys/goal.gd: -------------------------------------------------------------------------------- 1 | tool 2 | extends Area2D 3 | 4 | export(Vector2) var trigger_size = Vector2(10, 10) setget _set_trigger_size 5 | var _triggered: bool = false 6 | onready var _main = get_tree().current_scene 7 | 8 | 9 | func _set_trigger_size(new_size: Vector2): 10 | trigger_size = new_size 11 | $CollisionShape2D.shape.extents = new_size 12 | 13 | 14 | func _on_Goal_body_entered(body): 15 | if _triggered: 16 | return 17 | if body is KinematicBody2D and body.is_in_group("Player"): 18 | body.disable() 19 | _triggered = true 20 | _main.goal_reached() 21 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/entitys/goal.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=2] 2 | 3 | [ext_resource path="res://games/pixel_side_scroller/entitys/goal.gd" type="Script" id=1] 4 | [ext_resource path="res://shared/fonts/press_start2p/press_start2p_regular.ttf" type="DynamicFontData" id=2] 5 | 6 | [sub_resource type="RectangleShape2D" id=2] 7 | resource_local_to_scene = true 8 | extents = Vector2( 1, 14.5 ) 9 | 10 | [sub_resource type="DynamicFont" id=3] 11 | size = 8 12 | font_data = ExtResource( 2 ) 13 | 14 | [node name="Goal" type="Area2D"] 15 | script = ExtResource( 1 ) 16 | 17 | [node name="CollisionShape2D" type="CollisionShape2D" parent="."] 18 | position = Vector2( 1, -15 ) 19 | shape = SubResource( 2 ) 20 | 21 | [node name="Label2" type="Label" parent="."] 22 | margin_left = -3.0 23 | margin_top = -51.0 24 | margin_right = 181.0 25 | margin_bottom = 1.0 26 | custom_fonts/font = SubResource( 3 ) 27 | text = "Goal 28 | ^ 29 | | 30 | | 31 | |" 32 | 33 | [connection signal="body_entered" from="." to="." method="_on_Goal_body_entered"] 34 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/entitys/help_trigger.gd: -------------------------------------------------------------------------------- 1 | tool 2 | extends Area2D 3 | 4 | export(int) var feature = PixelSideScrollerUtils.Features.MOVE 5 | export(Vector2) var trigger_size = Vector2(20, 20) setget _set_trigger_size 6 | var _triggered: bool = false 7 | onready var _main = get_tree().current_scene 8 | 9 | 10 | func _set_trigger_size(new_size: Vector2): 11 | trigger_size = new_size 12 | $CollisionShape2D.shape.extents = new_size 13 | 14 | 15 | func _on_HelpTrigger_body_entered(body): 16 | if _triggered: 17 | return 18 | if body is KinematicBody2D and body.is_in_group("Player"): 19 | _triggered = true 20 | _main.ui.help_box.display(feature) 21 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/entitys/help_trigger.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://games/pixel_side_scroller/entitys/help_trigger.gd" type="Script" id=1] 4 | 5 | [sub_resource type="RectangleShape2D" id=1] 6 | resource_local_to_scene = true 7 | extents = Vector2( 20, 20 ) 8 | 9 | [node name="HelpTrigger" type="Area2D"] 10 | script = ExtResource( 1 ) 11 | 12 | [node name="CollisionShape2D" type="CollisionShape2D" parent="."] 13 | shape = SubResource( 1 ) 14 | 15 | [connection signal="body_entered" from="." to="." method="_on_HelpTrigger_body_entered"] 16 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/entitys/spawn.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene format=2] 2 | 3 | [node name="Spawn" type="Node2D"] 4 | position = Vector2( -95, 0 ) 5 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/entitys/star.gd: -------------------------------------------------------------------------------- 1 | extends Area2D 2 | 3 | var time := 0.0 4 | 5 | onready var _main = get_tree().current_scene 6 | onready var _polygon = $StarPolygon 7 | 8 | 9 | # Called when the node enters the scene tree for the first time. 10 | func _ready() -> void: 11 | _main.count_star() 12 | 13 | 14 | func _process(delta) -> void: 15 | self.rotate(delta * 1.5) 16 | 17 | var scale_factor := 0.75 + 0.2 * sin(time * 2.0) 18 | _polygon.position.x = -scale_factor 19 | _polygon.position.y = -scale_factor 20 | _polygon.scale.x = scale_factor 21 | _polygon.scale.y = scale_factor 22 | 23 | time += delta 24 | 25 | 26 | func _on_Star_body_entered(body: Node) -> void: 27 | if not self.visible: 28 | return 29 | if body is KinematicBody2D and body.is_in_group("Player"): 30 | self.visible = false 31 | _main.collected_star() 32 | $CollectStar.play() 33 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/entitys/star.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://games/pixel_side_scroller/entitys/star.gd" type="Script" id=1] 4 | [ext_resource path="res://games/pixel_side_scroller/sounds/sfx/collect_star.wav" type="AudioStream" id=2] 5 | 6 | [sub_resource type="CircleShape2D" id=1] 7 | radius = 3.0 8 | 9 | [node name="Star" type="Area2D"] 10 | scale = Vector2( 3, 3 ) 11 | script = ExtResource( 1 ) 12 | 13 | [node name="Collision" type="CollisionShape2D" parent="."] 14 | shape = SubResource( 1 ) 15 | 16 | [node name="StarPolygon" type="Polygon2D" parent="."] 17 | position = Vector2( -1, -1 ) 18 | color = Color( 1, 1, 0, 0.63 ) 19 | texture_scale = Vector2( 2, 2 ) 20 | polygon = PoolVector2Array( 0, 0, 0.476818, -1.43046, 1, -3, 2, 0, 5, 1, 2, 2, 1, 5, 0, 2, -3, 1 ) 21 | 22 | [node name="CollectStar" type="AudioStreamPlayer2D" parent="."] 23 | stream = ExtResource( 2 ) 24 | 25 | [connection signal="body_entered" from="." to="." method="_on_Star_body_entered"] 26 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/game.cfg: -------------------------------------------------------------------------------- 1 | [game] 2 | name="pixel side scroller" 3 | desc="2d pixel side scroller" 4 | main_scene="main.tscn" 5 | icon="icon.png" 6 | version="0.1" 7 | creator="nobody in particular" 8 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/pixel_side_scroller/icon.png -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-168274f0448645e7d98a98b08970f17a.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/pixel_side_scroller/icon.png" 13 | dest_files=[ "res://.import/icon.png-168274f0448645e7d98a98b08970f17a.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/main.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | var player = null 4 | var levels_finished := 0 5 | var deaths := 0 6 | var stars_collected := 0 7 | var star_count := 0 8 | 9 | onready var camera = $Camera 10 | onready var ui = $UI 11 | onready var map_manager = $MapManager 12 | # onready var score_label = $score_label 13 | 14 | 15 | func _ready(): 16 | map_manager.find_maps() 17 | display_stats() 18 | # warning-ignore:return_value_discarded 19 | map_manager.load_next_map() 20 | 21 | 22 | func kill_player() -> void: 23 | deaths += 1 24 | if player: 25 | player.on_kill() 26 | display_stats() 27 | spawn_player() 28 | 29 | 30 | func spawn_player() -> void: 31 | var spawn = map_manager.current_map.get_node("Spawn") 32 | if not is_instance_valid(spawn): 33 | return 34 | if not player: 35 | var new_player = load("res://games/pixel_side_scroller/pawns/character/character.tscn").instance() 36 | player = new_player 37 | player.position = spawn.position 38 | camera.target = player 39 | add_child(new_player) 40 | else: 41 | player.position = spawn.position 42 | yield(get_tree(), "idle_frame") 43 | player.enable() 44 | 45 | 46 | func count_star() -> void: 47 | star_count += 1 48 | display_stats() 49 | 50 | 51 | func collected_star() -> void: 52 | stars_collected += 1 53 | display_stats() 54 | 55 | 56 | func display_stats() -> void: 57 | ui.stats_label.text = str( 58 | ( 59 | TranslationServer.translate("T_LEVEL_COMPLETED_COUNT") 60 | % [levels_finished, map_manager.map_count] 61 | ), 62 | "\n", 63 | TranslationServer.translate("T_STARS_COLLECTED") % [stars_collected], 64 | "\n", 65 | TranslationServer.translate("T_DEATHS") % [deaths] 66 | ) 67 | 68 | 69 | func goal_reached() -> void: 70 | levels_finished += 1 71 | display_stats() 72 | $LevelUp.play() 73 | if not map_manager.load_next_map(): 74 | GameManager.end_game( 75 | ( 76 | TranslationServer.translate("T_PIXEL_SIDE_SCROLLER_END_MESSAGE") 77 | % [levels_finished, deaths, stars_collected, star_count] 78 | ), 79 | stars_collected + levels_finished * 2 - deaths 80 | ) 81 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/main.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=2] 2 | 3 | [ext_resource path="res://games/pixel_side_scroller/ui/ui.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://games/pixel_side_scroller/main.gd" type="Script" id=2] 5 | [ext_resource path="res://games/pixel_side_scroller/maps/map_manager.gd" type="Script" id=3] 6 | [ext_resource path="res://games/pixel_side_scroller/camera/camera.tscn" type="PackedScene" id=4] 7 | [ext_resource path="res://games/pixel_side_scroller/sounds/sfx/level_up.wav" type="AudioStream" id=5] 8 | 9 | [node name="Main" type="Node2D"] 10 | script = ExtResource( 2 ) 11 | 12 | [node name="UI" parent="." instance=ExtResource( 1 )] 13 | 14 | [node name="MapManager" type="Node" parent="."] 15 | script = ExtResource( 3 ) 16 | 17 | [node name="Camera" parent="." instance=ExtResource( 4 )] 18 | 19 | [node name="LevelUp" type="AudioStreamPlayer2D" parent="."] 20 | stream = ExtResource( 5 ) 21 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/maps/001_jumping_tutorial.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=2] 2 | 3 | [ext_resource path="res://games/pixel_side_scroller/entitys/star.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://games/pixel_side_scroller/entitys/goal.tscn" type="PackedScene" id=2] 5 | [ext_resource path="res://games/pixel_side_scroller/entitys/spawn.tscn" type="PackedScene" id=3] 6 | [ext_resource path="res://games/pixel_side_scroller/entitys/help_trigger.tscn" type="PackedScene" id=4] 7 | [ext_resource path="res://games/pixel_side_scroller/objects/ground.tscn" type="PackedScene" id=5] 8 | 9 | [node name="Map" type="Node2D"] 10 | 11 | [node name="Spawn" parent="." instance=ExtResource( 3 )] 12 | 13 | [node name="Goal" parent="." instance=ExtResource( 2 )] 14 | position = Vector2( 125, 0 ) 15 | 16 | [node name="HelpTriggerJump" parent="." instance=ExtResource( 4 )] 17 | position = Vector2( 11, -2 ) 18 | feature = 1 19 | trigger_size = Vector2( 40, 30 ) 20 | 21 | [node name="Ground0" parent="." instance=ExtResource( 5 )] 22 | margin_left = -156.0 23 | margin_right = -20.0 24 | text = "-----------------" 25 | 26 | [node name="Ground1" parent="." instance=ExtResource( 5 )] 27 | margin_left = -20.86 28 | margin_top = -3.16 29 | margin_right = 59.14 30 | margin_bottom = 4.84 31 | rect_rotation = 21.0 32 | text = "----------" 33 | 34 | [node name="Ground2" parent="." instance=ExtResource( 5 )] 35 | margin_left = 48.0 36 | margin_top = 31.0 37 | margin_right = 129.0 38 | margin_bottom = 39.0 39 | rect_rotation = -90.0 40 | text = "----" 41 | 42 | [node name="Ground3" parent="." instance=ExtResource( 5 )] 43 | margin_left = 50.0 44 | margin_right = 154.0 45 | text = "--------------" 46 | 47 | [node name="Star" parent="." instance=ExtResource( 1 )] 48 | position = Vector2( -145, -40 ) 49 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/maps/002_first_real_level.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=7 format=2] 2 | 3 | [ext_resource path="res://games/pixel_side_scroller/entitys/star.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://games/pixel_side_scroller/entitys/goal.tscn" type="PackedScene" id=2] 5 | [ext_resource path="res://games/pixel_side_scroller/entitys/spawn.tscn" type="PackedScene" id=3] 6 | [ext_resource path="res://games/pixel_side_scroller/objects/box.tscn" type="PackedScene" id=4] 7 | [ext_resource path="res://games/pixel_side_scroller/objects/tower.tscn" type="PackedScene" id=5] 8 | [ext_resource path="res://games/pixel_side_scroller/objects/ground.tscn" type="PackedScene" id=6] 9 | 10 | [node name="Map" type="Node2D"] 11 | 12 | [node name="Spawn" parent="." instance=ExtResource( 3 )] 13 | position = Vector2( -149, 0 ) 14 | 15 | [node name="Goal" parent="." instance=ExtResource( 2 )] 16 | position = Vector2( 276, 0 ) 17 | 18 | [node name="Box" parent="." instance=ExtResource( 4 )] 19 | position = Vector2( 46, 0 ) 20 | 21 | [node name="Tower0" parent="." instance=ExtResource( 5 )] 22 | position = Vector2( 109, -8 ) 23 | 24 | [node name="Tower1" parent="." instance=ExtResource( 5 )] 25 | position = Vector2( 163, -8 ) 26 | 27 | [node name="Ground0" parent="." instance=ExtResource( 6 )] 28 | margin_left = -214.0 29 | margin_right = -46.0 30 | text = "---------------------" 31 | 32 | [node name="Ground1" parent="." instance=ExtResource( 6 )] 33 | margin_left = -17.0 34 | margin_right = 271.0 35 | text = "-----------------" 36 | 37 | [node name="Ground2" parent="." instance=ExtResource( 6 )] 38 | margin_left = 153.0 39 | margin_right = 234.0 40 | text = "----------------------" 41 | 42 | [node name="Star" parent="." instance=ExtResource( 1 )] 43 | position = Vector2( 319, -14 ) 44 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/objects/box.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://shared/fonts/press_start2p/press_start2p_regular.ttf" type="DynamicFontData" id=1] 4 | 5 | [sub_resource type="RectangleShape2D" id=1] 6 | extents = Vector2( 8.875, 8.9375 ) 7 | 8 | [sub_resource type="DynamicFont" id=2] 9 | size = 8 10 | font_data = ExtResource( 1 ) 11 | 12 | [node name="Box" type="StaticBody2D"] 13 | 14 | [node name="BoxCollision" type="CollisionShape2D" parent="."] 15 | position = Vector2( 9, -9 ) 16 | shape = SubResource( 1 ) 17 | 18 | [node name="BoxTexture" type="Label" parent="BoxCollision"] 19 | anchor_right = 1.0 20 | anchor_bottom = 1.0 21 | margin_left = -12.0 22 | margin_top = -9.0 23 | margin_right = 12.0 24 | margin_bottom = 11.0 25 | custom_fonts/font = SubResource( 2 ) 26 | text = "|-| 27 | | |" 28 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/objects/ground.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=2] 2 | 3 | [ext_resource path="res://shared/fonts/press_start2p/press_start2p_regular.ttf" type="DynamicFontData" id=1] 4 | 5 | [sub_resource type="DynamicFont" id=4] 6 | size = 8 7 | font_data = ExtResource( 1 ) 8 | 9 | [sub_resource type="GDScript" id=5] 10 | script/source = "extends Label 11 | 12 | 13 | # Called when the node enters the scene tree for the first time. 14 | func _ready() -> void: 15 | var ground_width = text.length() 16 | var collision = get_child(0).get_child(0) 17 | collision.position.x = 4 * ground_width 18 | collision.shape = RectangleShape2D.new() 19 | collision.shape.extents = Vector2(4 * ground_width - 1, 0.5) 20 | " 21 | 22 | [sub_resource type="RectangleShape2D" id=6] 23 | extents = Vector2( 11, 0.5 ) 24 | 25 | [node name="Ground" type="Label"] 26 | margin_left = -1.0 27 | margin_top = -3.0 28 | margin_right = 80.0 29 | margin_bottom = 5.0 30 | custom_fonts/font = SubResource( 4 ) 31 | text = "---" 32 | script = SubResource( 5 ) 33 | 34 | [node name="Body" type="StaticBody2D" parent="."] 35 | 36 | [node name="GroundCollision" type="CollisionShape2D" parent="Body"] 37 | position = Vector2( 12, 3.5 ) 38 | shape = SubResource( 6 ) 39 | one_way_collision = true 40 | one_way_collision_margin = 50.0 41 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/objects/tower.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://shared/fonts/press_start2p/press_start2p_regular.ttf" type="DynamicFontData" id=1] 4 | 5 | [sub_resource type="RectangleShape2D" id=1] 6 | extents = Vector2( 9, 20 ) 7 | 8 | [sub_resource type="DynamicFont" id=2] 9 | size = 8 10 | font_data = ExtResource( 1 ) 11 | 12 | [node name="Tower" type="StaticBody2D"] 13 | position = Vector2( 9, -8 ) 14 | 15 | [node name="TowerCollision" type="CollisionShape2D" parent="."] 16 | position = Vector2( 0, -12 ) 17 | shape = SubResource( 1 ) 18 | 19 | [node name="TowerTexture" type="Label" parent="."] 20 | anchor_right = 1.0 21 | anchor_bottom = 1.0 22 | margin_left = -12.0 23 | margin_top = -32.0 24 | margin_right = 12.0 25 | margin_bottom = 9.0 26 | custom_fonts/font = SubResource( 2 ) 27 | text = "|-| 28 | | | 29 | | | 30 | | |" 31 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/pawns/character/character.gd: -------------------------------------------------------------------------------- 1 | extends "res://games/pixel_side_scroller/pawns/pawn.gd" 2 | 3 | onready var animation_player: AnimationPlayer = $AnimationPlayer 4 | 5 | 6 | func _process(_delta): 7 | _animation() 8 | _flip() 9 | 10 | 11 | func _animation() -> void: 12 | if movement.direction.x == 0 or not is_on_floor(): 13 | animation_player.play("stand") 14 | else: 15 | animation_player.play("run") 16 | 17 | 18 | func _flip() -> void: 19 | if movement.direction.x > 0: 20 | $Sprite.flip_h = false 21 | elif movement.direction.x < 0: 22 | $Sprite.flip_h = true 23 | 24 | 25 | func on_ground_hit() -> void: 26 | $Sounds/LandSound.play() 27 | 28 | 29 | func on_jump() -> void: 30 | $Sounds/JumpSound.play() 31 | 32 | 33 | func on_kill() -> void: 34 | $Sounds/HitSound.play() 35 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/pawns/character/character.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/pixel_side_scroller/pawns/character/character.png -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/pawns/character/character.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/character.png-f2e995fc276b32c2ef79dbbd3a11ab27.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/pixel_side_scroller/pawns/character/character.png" 13 | dest_files=[ "res://.import/character.png-f2e995fc276b32c2ef79dbbd3a11ab27.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/pawns/input.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | var left: float = 0.0 4 | var right: float = 0.0 5 | var jump: bool = false 6 | 7 | onready var pawn = get_parent() 8 | 9 | 10 | func _input(event: InputEvent): 11 | if event is InputEventKey and not event.echo: 12 | if event.scancode == KEY_D or event.scancode == KEY_RIGHT: 13 | right = 1.0 if event.pressed else 0.0 14 | if event.scancode == KEY_A or event.scancode == KEY_LEFT: 15 | left = 1.0 if event.pressed else 0.0 16 | if event.scancode == KEY_SPACE or event.scancode == KEY_W or event.scancode == KEY_UP: 17 | jump = event.pressed 18 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/pawns/jump_curve.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Curve" format=2] 2 | 3 | [resource] 4 | _data = [ Vector2( 0, 0.990909 ), 0.0, 0.0424242, 0, 0, Vector2( 1, 0 ), -3.01382, 2.96699e-07, 0, 0 ] 5 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/pawns/movement.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | const FALL_TIME_THRESHOLD: float = 0.2 4 | var coyote_time: float = 0.15 5 | var air_time: float = 0.0 6 | 7 | var speed: float = 80 8 | var gravity: float = 9.8 9 | var jump_force: float = 100.0 10 | var jump_time: float = 0.2 11 | var max_fall_speed: float = 2000 12 | 13 | var jumping: bool = false 14 | var direction: Vector2 = Vector2.ZERO setget , _get_direction 15 | var velocity: Vector2 = Vector2.ZERO 16 | 17 | var _jumped: bool = false 18 | var _jump_curve: Curve = load("res://games/pixel_side_scroller/pawns/jump_curve.tres") 19 | var _jump_timer: Timer = Timer.new() 20 | 21 | var _is_falling = false 22 | var _fall_timer = 0 23 | 24 | onready var _main = get_tree().current_scene 25 | onready var _pawn = get_parent() 26 | 27 | 28 | func _get_direction(): 29 | return Vector2(_pawn.input.right - _pawn.input.left, 0) 30 | 31 | 32 | func _ready(): 33 | _init_jump_timer() 34 | 35 | 36 | # Do movement logic 37 | func do(delta): 38 | _jump(delta) 39 | # Gravity 40 | if _pawn.is_on_floor() and not jumping: 41 | velocity.y = 1 42 | elif not _pawn.is_on_floor() and not jumping: 43 | velocity.y = min(max_fall_speed, velocity.y + (gravity + delta)) 44 | 45 | var input_direction: float = _get_direction().x 46 | if input_direction != 0.0: 47 | _main.ui.help_box.used_feature(PixelSideScrollerUtils.Features.MOVE) 48 | velocity.x = input_direction * speed 49 | if _is_falling and _pawn.is_on_floor(): 50 | _pawn.on_ground_hit() 51 | _update_falling_state(delta) 52 | 53 | # warning-ignore:return_value_discarded 54 | _pawn.move_and_slide(velocity, Vector2.UP) 55 | 56 | 57 | # Handle jumps 58 | func _jump(delta): 59 | # Reset state variables on "jump release" 60 | if not _pawn.input.jump and _jumped: 61 | _jumped = false 62 | jumping = false 63 | 64 | if _pawn.is_on_floor(): 65 | # Reset time falling 66 | air_time = 0.0 67 | else: 68 | # Add time falling 69 | air_time += delta 70 | # Handle "hold jump" in air 71 | if _pawn.input.jump and _jumped: 72 | var curve_point: float = ( 73 | (_jump_timer.wait_time - _jump_timer.time_left) 74 | / _jump_timer.wait_time 75 | ) 76 | if curve_point < 1.0: 77 | var curve_interpolate_value: float = _jump_curve.interpolate(curve_point) 78 | velocity.y += (-jump_force * delta) * curve_interpolate_value 79 | else: 80 | jumping = false 81 | 82 | # Do "jump" if on the floor (or still in coyote time) 83 | if _pawn.input.jump and not _jumped and air_time <= coyote_time: 84 | jumping = true 85 | _jumped = true 86 | velocity.y = -jump_force 87 | _jump_timer.start() 88 | _main.ui.help_box.used_feature(PixelSideScrollerUtils.Features.JUMP) 89 | _pawn.on_jump() 90 | 91 | 92 | func _update_falling_state(delta): 93 | if velocity.y <= 0 or _pawn.is_on_floor(): 94 | _fall_timer = 0 95 | else: 96 | _fall_timer += delta 97 | _is_falling = _fall_timer > FALL_TIME_THRESHOLD 98 | 99 | 100 | func _init_jump_timer(): 101 | _jump_timer.one_shot = true 102 | _jump_timer.wait_time = jump_time 103 | _jump_timer.name = "JumpTimer" 104 | add_child(_jump_timer) 105 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/pawns/pawn.gd: -------------------------------------------------------------------------------- 1 | extends KinematicBody2D 2 | 3 | onready var input = $Input 4 | onready var movement = $Movement 5 | onready var _main = get_tree().current_scene 6 | 7 | 8 | func _physics_process(delta): 9 | if _main.map_manager.out_of_bound(self): 10 | _main.kill_player() 11 | return 12 | movement.do(delta) 13 | 14 | 15 | func disable(): 16 | $CollisionShape2D.set_deferred("disabled", true) 17 | 18 | 19 | func enable(): 20 | $CollisionShape2D.disabled = false 21 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/pawns/pawn.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=2] 2 | 3 | [ext_resource path="res://games/pixel_side_scroller/pawns/pawn.gd" type="Script" id=1] 4 | [ext_resource path="res://games/pixel_side_scroller/pawns/input.gd" type="Script" id=2] 5 | [ext_resource path="res://games/pixel_side_scroller/pawns/movement.gd" type="Script" id=3] 6 | 7 | [sub_resource type="RectangleShape2D" id=1] 8 | 9 | [node name="Pawn" type="KinematicBody2D" groups=["Player"]] 10 | script = ExtResource( 1 ) 11 | 12 | [node name="Input" type="Node" parent="."] 13 | script = ExtResource( 2 ) 14 | 15 | [node name="Movement" type="Node" parent="."] 16 | script = ExtResource( 3 ) 17 | 18 | [node name="CollisionShape2D" type="CollisionShape2D" parent="."] 19 | shape = SubResource( 1 ) 20 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/sounds/sfx/collect_star.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/pixel_side_scroller/sounds/sfx/collect_star.wav -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/sounds/sfx/collect_star.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/collect_star.wav-a1e68242a214b902e6066bca9d64670e.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://games/pixel_side_scroller/sounds/sfx/collect_star.wav" 10 | dest_files=[ "res://.import/collect_star.wav-a1e68242a214b902e6066bca9d64670e.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop_mode=0 21 | edit/loop_begin=0 22 | edit/loop_end=-1 23 | compress/mode=0 24 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/sounds/sfx/hit.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/pixel_side_scroller/sounds/sfx/hit.wav -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/sounds/sfx/hit.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/hit.wav-663018b0f6540dca29f1b018435439af.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://games/pixel_side_scroller/sounds/sfx/hit.wav" 10 | dest_files=[ "res://.import/hit.wav-663018b0f6540dca29f1b018435439af.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop_mode=0 21 | edit/loop_begin=0 22 | edit/loop_end=-1 23 | compress/mode=0 24 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/sounds/sfx/jump.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/pixel_side_scroller/sounds/sfx/jump.wav -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/sounds/sfx/jump.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/jump.wav-3d9701898b3111b7d0156f6149d0c931.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://games/pixel_side_scroller/sounds/sfx/jump.wav" 10 | dest_files=[ "res://.import/jump.wav-3d9701898b3111b7d0156f6149d0c931.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop_mode=0 21 | edit/loop_begin=0 22 | edit/loop_end=-1 23 | compress/mode=0 24 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/sounds/sfx/jump_land.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/pixel_side_scroller/sounds/sfx/jump_land.wav -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/sounds/sfx/jump_land.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/jump_land.wav-36a29bf97af9514bc80f55d85dccc140.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://games/pixel_side_scroller/sounds/sfx/jump_land.wav" 10 | dest_files=[ "res://.import/jump_land.wav-36a29bf97af9514bc80f55d85dccc140.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop_mode=0 21 | edit/loop_begin=0 22 | edit/loop_end=-1 23 | compress/mode=0 24 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/sounds/sfx/level_up.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/pixel_side_scroller/sounds/sfx/level_up.wav -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/sounds/sfx/level_up.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/level_up.wav-32031db045238f9a8a20085414257281.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://games/pixel_side_scroller/sounds/sfx/level_up.wav" 10 | dest_files=[ "res://.import/level_up.wav-32031db045238f9a8a20085414257281.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop_mode=0 21 | edit/loop_begin=0 22 | edit/loop_end=-1 23 | compress/mode=0 24 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/sounds/sfx/step.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/pixel_side_scroller/sounds/sfx/step.wav -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/sounds/sfx/step.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/step.wav-ce4850f2719b823acafc7375a5bd6cef.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://games/pixel_side_scroller/sounds/sfx/step.wav" 10 | dest_files=[ "res://.import/step.wav-ce4850f2719b823acafc7375a5bd6cef.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop_mode=0 21 | edit/loop_begin=0 22 | edit/loop_end=-1 23 | compress/mode=0 24 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/sounds/sfx/trap_activate.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/pixel_side_scroller/sounds/sfx/trap_activate.wav -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/sounds/sfx/trap_activate.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/trap_activate.wav-e3244032b0567464e6add6281d80b4b9.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://games/pixel_side_scroller/sounds/sfx/trap_activate.wav" 10 | dest_files=[ "res://.import/trap_activate.wav-e3244032b0567464e6add6281d80b4b9.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop_mode=0 21 | edit/loop_begin=0 22 | edit/loop_end=-1 23 | compress/mode=0 24 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/tilesets/rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/pixel_side_scroller/tilesets/rock.png -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/tilesets/rock.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/rock.png-3622ae2dc95f532ad3f7ace7a4f2b0f1.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/pixel_side_scroller/tilesets/rock.png" 13 | dest_files=[ "res://.import/rock.png-3622ae2dc95f532ad3f7ace7a4f2b0f1.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/ui/help_box.gd: -------------------------------------------------------------------------------- 1 | extends Control 2 | 3 | var _feature: int = PixelSideScrollerUtils.Features.MOVE 4 | var _feature_triggered: Array = [] 5 | 6 | 7 | func _init() -> void: 8 | hide() 9 | # Init _feature_triggered 10 | for _i in range(PixelSideScrollerUtils.Features.size()): 11 | _feature_triggered.append(false) 12 | 13 | 14 | func display(feature: int) -> void: 15 | _feature = feature 16 | # Dont show help box if feature was already shown this run 17 | if _feature_triggered[_feature]: 18 | return 19 | # Show help box 20 | _feature = feature 21 | $TabContainer.current_tab = _feature 22 | _feature_triggered[_feature] = true 23 | show() 24 | 25 | 26 | func used_feature(used_feature: int) -> void: 27 | if visible and _feature == used_feature: 28 | hide() 29 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/ui/help_box.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=2] 2 | 3 | [ext_resource path="res://games/pixel_side_scroller/ui/help_box.gd" type="Script" id=1] 4 | [ext_resource path="res://shared/fonts/press_start2p/press_start2p_regular.ttf" type="DynamicFontData" id=2] 5 | 6 | [sub_resource type="StyleBoxEmpty" id=1] 7 | 8 | [sub_resource type="DynamicFont" id=2] 9 | size = 8 10 | font_data = ExtResource( 2 ) 11 | 12 | [sub_resource type="DynamicFont" id=3] 13 | size = 8 14 | font_data = ExtResource( 2 ) 15 | 16 | [node name="HelpBox" type="Control"] 17 | margin_right = 200.0 18 | margin_bottom = 200.0 19 | grow_horizontal = 0 20 | script = ExtResource( 1 ) 21 | 22 | [node name="TabContainer" type="TabContainer" parent="."] 23 | anchor_right = 1.0 24 | anchor_bottom = 1.0 25 | size_flags_vertical = 3 26 | custom_styles/panel = SubResource( 1 ) 27 | tabs_visible = false 28 | 29 | [node name="MOVE" type="Control" parent="TabContainer"] 30 | anchor_right = 1.0 31 | anchor_bottom = 1.0 32 | 33 | [node name="Label" type="Label" parent="TabContainer/MOVE"] 34 | anchor_right = 1.0 35 | anchor_bottom = 1.0 36 | custom_fonts/font = SubResource( 2 ) 37 | text = "press or to move" 38 | align = 1 39 | valign = 1 40 | 41 | [node name="JUMP" type="Control" parent="TabContainer"] 42 | visible = false 43 | anchor_right = 1.0 44 | anchor_bottom = 1.0 45 | 46 | [node name="Label" type="Label" parent="TabContainer/JUMP"] 47 | anchor_right = 1.0 48 | anchor_bottom = 1.0 49 | custom_fonts/font = SubResource( 3 ) 50 | text = "press to jump" 51 | align = 1 52 | valign = 1 53 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/ui/ui.gd: -------------------------------------------------------------------------------- 1 | extends CanvasLayer 2 | 3 | onready var help_box = $Control/HelpBox 4 | onready var stats_label = $Control/Label 5 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/ui/ui.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://games/pixel_side_scroller/ui/ui.gd" type="Script" id=1] 4 | [ext_resource path="res://games/pixel_side_scroller/ui/help_box.tscn" type="PackedScene" id=2] 5 | 6 | [node name="UI" type="CanvasLayer"] 7 | script = ExtResource( 1 ) 8 | 9 | [node name="Control" type="Control" parent="."] 10 | anchor_right = 1.0 11 | anchor_bottom = 1.0 12 | 13 | [node name="HelpBox" parent="Control" instance=ExtResource( 2 )] 14 | anchor_left = 1.0 15 | anchor_right = 1.0 16 | margin_left = -216.0 17 | margin_top = 16.0 18 | margin_right = -16.0 19 | margin_bottom = 216.0 20 | 21 | [node name="Label" type="Label" parent="Control"] 22 | margin_left = 10.0 23 | margin_top = 10.0 24 | margin_right = 210.0 25 | margin_bottom = 90.0 26 | text = "Levels completed: 0/4 27 | Stars collected: 0 28 | Deaths: 0" 29 | -------------------------------------------------------------------------------- /game/games/pixel_side_scroller/utils.gd: -------------------------------------------------------------------------------- 1 | class_name PixelSideScrollerUtils 2 | 3 | enum Features { MOVE, JUMP } 4 | 5 | const GROUND_CHARACTER = "-" 6 | const SPIKE_CHARACTER = "^" 7 | 8 | const CHAR_WIDTH = 4 9 | 10 | 11 | static func initialize_ground_collider_size(collision, text) -> void: 12 | var ground_width = text.length() * CHAR_WIDTH 13 | collision.position.x = ground_width 14 | collision.shape = RectangleShape2D.new() 15 | collision.shape.extents = Vector2(ground_width - 1, 0.5) 16 | -------------------------------------------------------------------------------- /game/games/snake/canvas.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://games/snake/canvas.gd" type="Script" id=1] 4 | 5 | [node name="Canvas" type="Node2D"] 6 | script = ExtResource( 1 ) 7 | -------------------------------------------------------------------------------- /game/games/snake/color_schemes/classic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/snake/color_schemes/classic.png -------------------------------------------------------------------------------- /game/games/snake/color_schemes/classic.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/classic.png-8f47765ced9f586562438ae4d479080f.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/snake/color_schemes/classic.png" 13 | dest_files=[ "res://.import/classic.png-8f47765ced9f586562438ae4d479080f.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/snake/color_schemes/firefly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/snake/color_schemes/firefly.png -------------------------------------------------------------------------------- /game/games/snake/color_schemes/firefly.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/firefly.png-3240b0fc080654af386edbed7a01d7b7.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/snake/color_schemes/firefly.png" 13 | dest_files=[ "res://.import/firefly.png-3240b0fc080654af386edbed7a01d7b7.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/snake/color_schemes/matchstick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/snake/color_schemes/matchstick.png -------------------------------------------------------------------------------- /game/games/snake/color_schemes/matchstick.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/matchstick.png-71b0d3e1dfbb3b9eff49004aac5c94ac.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/snake/color_schemes/matchstick.png" 13 | dest_files=[ "res://.import/matchstick.png-71b0d3e1dfbb3b9eff49004aac5c94ac.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/snake/color_schemes/rainbow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/snake/color_schemes/rainbow.png -------------------------------------------------------------------------------- /game/games/snake/color_schemes/rainbow.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/rainbow.png-6f447c3c5aac731740e476fc4a8fea13.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/snake/color_schemes/rainbow.png" 13 | dest_files=[ "res://.import/rainbow.png-6f447c3c5aac731740e476fc4a8fea13.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/snake/game.cfg: -------------------------------------------------------------------------------- 1 | [game] 2 | name="Snake" 3 | desc="T_SNAKE_DESCRIPTION" 4 | main_scene="snake.tscn" 5 | icon="snake.png" 6 | version="1.0" 7 | creator="b7g" 8 | -------------------------------------------------------------------------------- /game/games/snake/snake.gd: -------------------------------------------------------------------------------- 1 | extends ColorRect 2 | 3 | var _res_color_selection = preload("res://games/snake/snake_color_selection.tscn") 4 | var _res_canvas = preload("res://games/snake/canvas.tscn") 5 | 6 | var _selected_color_scheme: int = 0 7 | 8 | onready var _label_score = $CC/VC/MC/VC/LabelScore 9 | onready var _label_highscore = $CC/VC/MC/VC/LabelHighScore 10 | 11 | 12 | func _ready(): 13 | _show_color_selection_dialog() 14 | display_score(0) 15 | _load_and_show_highscore() 16 | 17 | 18 | func display_score(score: int): 19 | _label_score.text = "%s: %s" % [TranslationServer.translate("T_SCORE"), score] 20 | 21 | 22 | func display_highscore(highscore: int): 23 | _label_highscore.text = "%s: %s" % [TranslationServer.translate("T_HIGHSCORE"), highscore] 24 | 25 | 26 | func set_color_scheme(color_scheme: int): 27 | _selected_color_scheme = color_scheme 28 | _start_game() 29 | 30 | 31 | func _start_game(): 32 | var canvas_bg = $CC/VC/CanvasBackground 33 | var canvas = _res_canvas.instance() 34 | canvas_bg.add_child(canvas) 35 | canvas.color_scheme = _selected_color_scheme 36 | canvas.redraw() 37 | 38 | 39 | func _show_color_selection_dialog(): 40 | var dialog = _res_color_selection.instance() 41 | add_child(dialog) 42 | dialog.set_main(self) 43 | 44 | 45 | func _load_and_show_highscore(): 46 | var highscore_dict = GameManager.get_highscore() 47 | if highscore_dict.has("score"): 48 | var highscore = highscore_dict["score"] 49 | if highscore != null: 50 | display_highscore(highscore) 51 | -------------------------------------------------------------------------------- /game/games/snake/snake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/snake/snake.png -------------------------------------------------------------------------------- /game/games/snake/snake.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/snake.png-c0e54e6f3d8d42089971b8316a939977.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/snake/snake.png" 13 | dest_files=[ "res://.import/snake.png-c0e54e6f3d8d42089971b8316a939977.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/snake/snake.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://shared/fonts/press_start_2p_18px.tres" type="DynamicFont" id=2] 4 | [ext_resource path="res://games/snake/snake.gd" type="Script" id=3] 5 | 6 | [sub_resource type="Theme" id=1] 7 | default_font = ExtResource( 2 ) 8 | 9 | [node name="Snake" type="ColorRect"] 10 | anchor_right = 1.0 11 | anchor_bottom = 1.0 12 | theme = SubResource( 1 ) 13 | color = Color( 0.2, 0.2, 0.2, 1 ) 14 | script = ExtResource( 3 ) 15 | __meta__ = { 16 | "_edit_use_anchors_": false 17 | } 18 | 19 | [node name="CC" type="HBoxContainer" parent="."] 20 | anchor_right = 1.0 21 | anchor_bottom = 1.0 22 | alignment = 1 23 | __meta__ = { 24 | "_edit_use_anchors_": false 25 | } 26 | 27 | [node name="VC" type="VBoxContainer" parent="CC"] 28 | margin_left = 388.0 29 | margin_right = 636.0 30 | margin_bottom = 600.0 31 | custom_constants/separation = 0 32 | 33 | [node name="MC" type="MarginContainer" parent="CC/VC"] 34 | margin_right = 248.0 35 | margin_bottom = 80.0 36 | custom_constants/margin_right = 16 37 | custom_constants/margin_top = 16 38 | custom_constants/margin_left = 16 39 | custom_constants/margin_bottom = 16 40 | __meta__ = { 41 | "_edit_use_anchors_": false 42 | } 43 | 44 | [node name="VC" type="VBoxContainer" parent="CC/VC/MC"] 45 | margin_left = 16.0 46 | margin_top = 16.0 47 | margin_right = 232.0 48 | margin_bottom = 64.0 49 | custom_constants/separation = 12 50 | __meta__ = { 51 | "_edit_use_anchors_": false 52 | } 53 | 54 | [node name="LabelHighScore" type="Label" parent="CC/VC/MC/VC"] 55 | margin_right = 216.0 56 | margin_bottom = 18.0 57 | text = "Highscore: 0" 58 | __meta__ = { 59 | "_edit_use_anchors_": false 60 | } 61 | 62 | [node name="LabelScore" type="Label" parent="CC/VC/MC/VC"] 63 | margin_top = 30.0 64 | margin_right = 216.0 65 | margin_bottom = 48.0 66 | text = "Score: 0" 67 | __meta__ = { 68 | "_edit_use_anchors_": false 69 | } 70 | 71 | [node name="CanvasBackground" type="ColorRect" parent="CC/VC"] 72 | margin_top = 80.0 73 | margin_right = 248.0 74 | margin_bottom = 80.0 75 | color = Color( 0, 0, 0, 1 ) 76 | -------------------------------------------------------------------------------- /game/games/snake/snake_color_selection.gd: -------------------------------------------------------------------------------- 1 | extends Control 2 | 3 | var _main 4 | 5 | 6 | func _ready(): 7 | $CenterContainer/VBoxContainer/PanelContainer/ButtonClassic.grab_focus() 8 | 9 | 10 | func set_main(main): 11 | _main = main 12 | 13 | 14 | func _select_color_scheme(color_scheme: int): 15 | _main.set_color_scheme(color_scheme) 16 | queue_free() 17 | 18 | 19 | func _on_ButtonClassic_pressed(): 20 | _select_color_scheme(0) 21 | 22 | 23 | func _on_ButtonFirefly_pressed(): 24 | _select_color_scheme(1) 25 | 26 | 27 | func _on_ButtonMatchstick_pressed(): 28 | _select_color_scheme(2) 29 | 30 | 31 | func _on_ButtonRainbow_pressed(): 32 | _select_color_scheme(3) 33 | -------------------------------------------------------------------------------- /game/games/sortit/assets/blender/block.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/blender/block.blend -------------------------------------------------------------------------------- /game/games/sortit/assets/blender/magnet_box.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/blender/magnet_box.blend -------------------------------------------------------------------------------- /game/games/sortit/assets/blender/numbers.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/blender/numbers.blend -------------------------------------------------------------------------------- /game/games/sortit/assets/blender/pedestal.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/blender/pedestal.blend -------------------------------------------------------------------------------- /game/games/sortit/assets/blender/play_area.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/blender/play_area.blend -------------------------------------------------------------------------------- /game/games/sortit/assets/images/activate_magnets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/images/activate_magnets.png -------------------------------------------------------------------------------- /game/games/sortit/assets/images/activate_magnets.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/activate_magnets.png-baa1917377c59c8246f5a94807da1969.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/sortit/assets/images/activate_magnets.png" 13 | dest_files=[ "res://.import/activate_magnets.png-baa1917377c59c8246f5a94807da1969.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/sortit/assets/images/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/images/arrow.png -------------------------------------------------------------------------------- /game/games/sortit/assets/images/arrow.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/arrow.png-3affca4c3dbba139da18551cd0c13bcb.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/sortit/assets/images/arrow.png" 13 | dest_files=[ "res://.import/arrow.png-3affca4c3dbba139da18551cd0c13bcb.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=true 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/sortit/assets/images/attract_boxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/images/attract_boxes.png -------------------------------------------------------------------------------- /game/games/sortit/assets/images/attract_boxes.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/attract_boxes.png-d69d005521c8894a229ef797e3364f0c.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/sortit/assets/images/attract_boxes.png" 13 | dest_files=[ "res://.import/attract_boxes.png-d69d005521c8894a229ef797e3364f0c.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/sortit/assets/images/attracted_box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/images/attracted_box.png -------------------------------------------------------------------------------- /game/games/sortit/assets/images/attracted_box.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/attracted_box.png-b35b22a295a95077db783fb2c4df1366.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/sortit/assets/images/attracted_box.png" 13 | dest_files=[ "res://.import/attracted_box.png-b35b22a295a95077db783fb2c4df1366.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/sortit/assets/images/black_boxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/images/black_boxes.png -------------------------------------------------------------------------------- /game/games/sortit/assets/images/black_boxes.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/black_boxes.png-c6f6862b0cfc22bf9d7db64969e65610.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/sortit/assets/images/black_boxes.png" 13 | dest_files=[ "res://.import/black_boxes.png-c6f6862b0cfc22bf9d7db64969e65610.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/sortit/assets/images/compare_boxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/images/compare_boxes.png -------------------------------------------------------------------------------- /game/games/sortit/assets/images/compare_boxes.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/compare_boxes.png-942751bbcd9523c76bb65b9b0e030e94.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/sortit/assets/images/compare_boxes.png" 13 | dest_files=[ "res://.import/compare_boxes.png-942751bbcd9523c76bb65b9b0e030e94.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/sortit/assets/images/correct_order.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/images/correct_order.png -------------------------------------------------------------------------------- /game/games/sortit/assets/images/correct_order.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/correct_order.png-d31cb2c5960e4dc3fb79e2929d637ce8.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/sortit/assets/images/correct_order.png" 13 | dest_files=[ "res://.import/correct_order.png-d31cb2c5960e4dc3fb79e2929d637ce8.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/sortit/assets/images/place_boxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/images/place_boxes.png -------------------------------------------------------------------------------- /game/games/sortit/assets/images/place_boxes.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/place_boxes.png-6e3e732608ad4fa195307409f680a3c0.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/sortit/assets/images/place_boxes.png" 13 | dest_files=[ "res://.import/place_boxes.png-6e3e732608ad4fa195307409f680a3c0.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/sortit/assets/images/start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/images/start.png -------------------------------------------------------------------------------- /game/games/sortit/assets/images/start.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/start.png-8c8779a27ed9d4aea9440b261b9197e1.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/sortit/assets/images/start.png" 13 | dest_files=[ "res://.import/start.png-8c8779a27ed9d4aea9440b261b9197e1.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/sortit/assets/images/wrong_order.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/images/wrong_order.png -------------------------------------------------------------------------------- /game/games/sortit/assets/images/wrong_order.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/wrong_order.png-4d233ed356e77e56358df549fa577347.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/sortit/assets/images/wrong_order.png" 13 | dest_files=[ "res://.import/wrong_order.png-4d233ed356e77e56358df549fa577347.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/sortit/assets/materials/body.material: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/materials/body.material -------------------------------------------------------------------------------- /game/games/sortit/assets/materials/box_body.material: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/materials/box_body.material -------------------------------------------------------------------------------- /game/games/sortit/assets/materials/box_color.material: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/materials/box_color.material -------------------------------------------------------------------------------- /game/games/sortit/assets/materials/building_sides.material: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/materials/building_sides.material -------------------------------------------------------------------------------- /game/games/sortit/assets/materials/building_top.material: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/materials/building_top.material -------------------------------------------------------------------------------- /game/games/sortit/assets/materials/cabel.material: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/materials/cabel.material -------------------------------------------------------------------------------- /game/games/sortit/assets/materials/floor.material: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/materials/floor.material -------------------------------------------------------------------------------- /game/games/sortit/assets/materials/magnet_left.material: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/materials/magnet_left.material -------------------------------------------------------------------------------- /game/games/sortit/assets/materials/magnet_right.material: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/materials/magnet_right.material -------------------------------------------------------------------------------- /game/games/sortit/assets/materials/pedestal.material: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/materials/pedestal.material -------------------------------------------------------------------------------- /game/games/sortit/assets/materials/pedestal_accent.material: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/materials/pedestal_accent.material -------------------------------------------------------------------------------- /game/games/sortit/assets/materials/pedestal_screen.material: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/materials/pedestal_screen.material -------------------------------------------------------------------------------- /game/games/sortit/assets/materials/ring.material: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/materials/ring.material -------------------------------------------------------------------------------- /game/games/sortit/assets/materials/selector.material: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/assets/materials/selector.material -------------------------------------------------------------------------------- /game/games/sortit/game.cfg: -------------------------------------------------------------------------------- 1 | ; This example file lists all required and optional Values 2 | ; It is meant for easy identification of games. 3 | 4 | [game] 5 | ; Choose a memorable name 6 | name ="Sort It" 7 | ; Say what your game is about 8 | desc="Pick up the boxes with your magnets and sort them faster than your opponents. Do this by laying the numbered boxes on the pedestals of your color." 9 | ; These paths are relative to the game folder 10 | main_scene="sort_it.tscn" 11 | icon="icon.png" 12 | ; Version has no effect. But it might be shown in debug menus. 13 | version="1.0" 14 | ; Put your name here 15 | creator="RedstoneMedia" 16 | 17 | [page modules] 18 | T_HELP="ui/help.tscn" 19 | -------------------------------------------------------------------------------- /game/games/sortit/game.gd: -------------------------------------------------------------------------------- 1 | extends MarginContainer 2 | 3 | const BLOCK_SCENE: PackedScene = preload("res://games/sortit/box.tscn") 4 | const MAX_SCORE = 10 5 | 6 | export(Vector2) var spawn_height = Vector2(40, 100) 7 | export(int) var max_box_count = 50 8 | 9 | var _box_count = 0 10 | 11 | onready var _rng := RandomNumberGenerator.new() 12 | onready var _spaw_areas = $BoxSpawnAreas.get_children() 13 | onready var _players = $Players 14 | 15 | 16 | func _ready(): 17 | _rng.randomize() 18 | _players.spawn_players() 19 | $Viewports.create_viewports() 20 | # Start with 6 boxes 21 | for _i in range(0, 6): 22 | _spawn_box() 23 | 24 | 25 | func _spawn_box(): 26 | # Don't spawn more boxes if maxiumim count is reached 27 | if _box_count > max_box_count: 28 | return 29 | # Get random spawn area 30 | var spawn_area_index = _rng.randi_range(0, len(_spaw_areas) - 1) 31 | var spawn_area = _spaw_areas[spawn_area_index] as Spatial 32 | var spawn_origin = spawn_area.global_transform.origin 33 | var spawn_scale = spawn_area.scale 34 | # Spawn block inside picked spawn area 35 | var block: RigidBody = BLOCK_SCENE.instance() 36 | $Boxes.add_child(block) 37 | block.connect("despawn", self, "_on_box_despawn") 38 | var block_position = Vector3.ZERO 39 | block_position.x = _rng.randf_range( 40 | spawn_origin.x - spawn_scale.x, spawn_origin.x + spawn_scale.x 41 | ) 42 | block_position.y = _rng.randf_range(spawn_height.x, spawn_height.y) 43 | block_position.z = _rng.randf_range( 44 | spawn_origin.z - spawn_scale.z, spawn_origin.z + spawn_scale.z 45 | ) 46 | block.global_transform.origin = block_position 47 | _box_count += 1 48 | 49 | 50 | func _end_game(): 51 | var best_player_index = _players.get_best_player()[0] 52 | GameManager.end_game("Player %d won" % (best_player_index + 1)) 53 | 54 | 55 | func _on_box_despawn(_number: int): 56 | _box_count -= 1 57 | 58 | 59 | func _on_spawn_timer_timeout(): 60 | _spawn_box() 61 | # Check the highest score every couple of seconds and end the game, if the maximum score is reached 62 | var highest_score = _players.get_best_player()[1] 63 | if highest_score == MAX_SCORE: 64 | _end_game() 65 | 66 | 67 | func _on_end_timer_timeout(): 68 | _end_game() 69 | -------------------------------------------------------------------------------- /game/games/sortit/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/sortit/icon.png -------------------------------------------------------------------------------- /game/games/sortit/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-1289c9fc97cef0676613e511265901fd.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/sortit/icon.png" 13 | dest_files=[ "res://.import/icon.png-1289c9fc97cef0676613e511265901fd.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/sortit/pedestal_group.gd: -------------------------------------------------------------------------------- 1 | tool 2 | extends Spatial 3 | 4 | export(float) var spacing setget set_spacing, get_spacing 5 | 6 | var pedestal_numbers = [] 7 | var correct_count = 0 8 | 9 | var _spacing = 3.0 10 | var _assigned_player: SortItPlayer 11 | 12 | 13 | func set_spacing(new_spacing: float): 14 | var last_pos = Vector3(0, -1.054, 0) 15 | for pedestal in get_children(): 16 | pedestal.transform.origin = last_pos 17 | last_pos += Vector3(new_spacing, 0, 0) 18 | _spacing = new_spacing 19 | 20 | 21 | func get_spacing() -> float: 22 | return _spacing 23 | 24 | 25 | func dissable(): 26 | hide() 27 | for pedestal in get_children(): 28 | propagate_call("set_process", [false]) 29 | propagate_call("set_physics_process", [false]) 30 | propagate_call("set_process_internal", [false]) 31 | pedestal.set_collision_layer_bit(0, false) 32 | pedestal.set_collision_mask_bit(0, false) 33 | pedestal.set_collision_mask_bit(1, false) 34 | pedestal.set_collision_mask_bit(2, false) 35 | 36 | 37 | func enable(): 38 | show() 39 | for pedestal in get_children(): 40 | propagate_call("set_process", [true]) 41 | propagate_call("set_physics_process", [true]) 42 | propagate_call("set_process_internal", [true]) 43 | pedestal.set_collision_layer_bit(0, true) 44 | pedestal.set_collision_mask_bit(0, true) 45 | pedestal.set_collision_mask_bit(1, true) 46 | pedestal.set_collision_mask_bit(2, true) 47 | 48 | 49 | func set_color(color: Color): 50 | for pedestal in get_children(): 51 | pedestal.set_color(color) 52 | 53 | 54 | func set_assigned_player(assigned_player: SortItPlayer): 55 | _assigned_player = assigned_player 56 | # Give each pedestal a reference to all players 57 | var players = get_node("../../Players").get_children() 58 | for pedestal in get_children(): 59 | pedestal.set_players(players) 60 | 61 | 62 | func _ready(): 63 | if Engine.is_editor_hint(): 64 | return 65 | for pedestal in get_children(): 66 | (pedestal as SortItPedestal).connect("box_held", self, "_on_box_held") 67 | (pedestal as SortItPedestal).connect("box_dropped", self, "_on_box_dropped") 68 | pedestal_numbers.push_back(-1) 69 | 70 | 71 | func _update_correctness(): 72 | var pedestals = get_children() 73 | correct_count = 0 74 | for i in len(pedestal_numbers): 75 | # Check if last number is smaller then the current pedestal number 76 | var last_number = pedestal_numbers[max(i - 1, 0)] 77 | var number = pedestal_numbers[i] 78 | var is_correct = number >= last_number and last_number != -1 79 | if is_correct: 80 | correct_count += 1 81 | (pedestals[i] as SortItPedestal).set_correct(is_correct) 82 | _assigned_player.status_display.display_score(correct_count) 83 | 84 | 85 | func _on_box_held(index: int, box_number: int): 86 | pedestal_numbers[index] = box_number 87 | _update_correctness() 88 | 89 | 90 | func _on_box_dropped(index: int, _box_number: int): 91 | pedestal_numbers[index] = -1 92 | _update_correctness() 93 | -------------------------------------------------------------------------------- /game/games/sortit/pedestal_group.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://games/sortit/pedestal_group.gd" type="Script" id=1] 4 | [ext_resource path="res://games/sortit/pedestal.tscn" type="PackedScene" id=2] 5 | 6 | [node name="PedestalGroup" type="Spatial"] 7 | script = ExtResource( 1 ) 8 | spacing = 3.0 9 | 10 | [node name="0" parent="." instance=ExtResource( 2 )] 11 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.054, 0 ) 12 | 13 | [node name="1" parent="." instance=ExtResource( 2 )] 14 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3, -1.054, 0 ) 15 | 16 | [node name="2" parent="." instance=ExtResource( 2 )] 17 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 6, -1.054, 0 ) 18 | 19 | [node name="3" parent="." instance=ExtResource( 2 )] 20 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 9, -1.054, 0 ) 21 | 22 | [node name="4" parent="." instance=ExtResource( 2 )] 23 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 12, -1.054, 0 ) 24 | 25 | [node name="5" parent="." instance=ExtResource( 2 )] 26 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 15, -1.054, 0 ) 27 | 28 | [node name="6" parent="." instance=ExtResource( 2 )] 29 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 18, -1.054, 0 ) 30 | 31 | [node name="7" parent="." instance=ExtResource( 2 )] 32 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 21, -1.054, 0 ) 33 | 34 | [node name="8" parent="." instance=ExtResource( 2 )] 35 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 24, -1.054, 0 ) 36 | 37 | [node name="9" parent="." instance=ExtResource( 2 )] 38 | transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 27, -1.054, 0 ) 39 | -------------------------------------------------------------------------------- /game/games/sortit/sort_it.gd: -------------------------------------------------------------------------------- 1 | class_name SortItRoot 2 | extends MarginContainer 3 | 4 | enum InputType { WASD_KEYS, IJKL_KEYS, NUMPAD_KEYS, ARROW_KEYS, JOY } 5 | 6 | var game_scene = load("res://games/sortit/game.tscn") 7 | var input_map = { 8 | InputType.WASD_KEYS: 9 | { 10 | "actions": 11 | { 12 | "left": KEY_A, 13 | "right": KEY_D, 14 | "up": KEY_W, 15 | "down": KEY_S, 16 | "left_magnet": KEY_Q, 17 | "right_magnet": KEY_E 18 | }, 19 | "name": "WASD", 20 | "control_detail": "Left Magnet: Q\nRight Magnet: E" 21 | }, 22 | InputType.IJKL_KEYS: 23 | { 24 | "actions": 25 | { 26 | "left": KEY_J, 27 | "right": KEY_L, 28 | "up": KEY_I, 29 | "down": KEY_K, 30 | "left_magnet": KEY_U, 31 | "right_magnet": KEY_O, 32 | }, 33 | "name": "IJKL", 34 | "control_detail": "Left Magnet: U\nRight Magnet: O" 35 | }, 36 | InputType.NUMPAD_KEYS: 37 | { 38 | "actions": 39 | { 40 | "left": KEY_KP_4, 41 | "right": KEY_KP_6, 42 | "up": KEY_KP_8, 43 | "down": KEY_KP_5, 44 | "left_magnet": KEY_KP_7, 45 | "right_magnet": KEY_KP_9, 46 | }, 47 | "name": "Numpad", 48 | "control_detail": "Left Magnet: Numpad 7\nRight Magnet: Numpad 9" 49 | }, 50 | InputType.ARROW_KEYS: 51 | { 52 | "actions": 53 | { 54 | "left": KEY_LEFT, 55 | "right": KEY_RIGHT, 56 | "up": KEY_UP, 57 | "down": KEY_DOWN, 58 | "left_magnet": KEY_DELETE, 59 | "right_magnet": KEY_PAGEDOWN, 60 | }, 61 | "name": "Arrow keys", 62 | "control_detail": "Left Magnet: Delete\nRight Magnet: Page Down" 63 | }, 64 | InputType.JOY: 65 | { 66 | "actions": 67 | { 68 | "left": JOY_AXIS_0, 69 | "right": JOY_AXIS_0, 70 | "up": JOY_AXIS_1, 71 | "down": JOY_AXIS_1, 72 | "left_magnet": JOY_L, 73 | "right_magnet": JOY_R, 74 | }, 75 | "name": "Controller", 76 | "control_detail": 77 | """Joystick to move 78 | Left Magnet: Left Shoulder Button 79 | Right Magnet: Right Shoulder Button""" 80 | } 81 | } 82 | 83 | 84 | func _on_player_selector_start_game(player_inputs: Array): 85 | $PlayerSelector.hide() 86 | var game = game_scene.instance() 87 | var players_node = game.get_node("Players") 88 | players_node.player_inputs = player_inputs 89 | players_node.player_count = len(player_inputs) 90 | add_child(game) 91 | -------------------------------------------------------------------------------- /game/games/sortit/sort_it.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://games/sortit/ui/player_selector.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://games/sortit/sort_it.gd" type="Script" id=2] 5 | 6 | [node name="SortIt" type="MarginContainer"] 7 | anchor_right = 1.0 8 | anchor_bottom = 1.0 9 | size_flags_horizontal = 3 10 | size_flags_vertical = 3 11 | script = ExtResource( 2 ) 12 | 13 | [node name="PlayerSelector" parent="." instance=ExtResource( 1 )] 14 | 15 | [connection signal="start_game" from="PlayerSelector" to="." method="_on_player_selector_start_game"] 16 | -------------------------------------------------------------------------------- /game/games/sortit/ui/help.gd: -------------------------------------------------------------------------------- 1 | extends MarginContainer 2 | 3 | var close_menu := false 4 | onready var _pc := $PC 5 | 6 | 7 | func _ready(): 8 | set_process_input(false) 9 | 10 | 11 | func _on_ExitBtn_pressed(): 12 | hide() 13 | 14 | 15 | func _input(event): 16 | if event is InputEventMouseButton: 17 | if !_pc.get_rect().has_point(event.position): 18 | hide() 19 | get_tree().set_input_as_handled() 20 | 21 | 22 | func _on_Help_visibility_changed(): 23 | set_process_input(visible) 24 | if visible: 25 | return 26 | if close_menu: 27 | close_menu = false 28 | PauseMenu.unpause() 29 | -------------------------------------------------------------------------------- /game/games/sortit/ui/mini_map.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | export(float) var player_size = 5.0 4 | export(float) var player_height = 0.0 5 | 6 | var _players 7 | onready var _impostors = $Impostors 8 | 9 | 10 | func set_players(players: Array): 11 | _players = players 12 | # Create impostor for every player 13 | for i in range(len(players)): 14 | var player: KinematicBody = _players[i] 15 | # Copy all sub meshes into new impostor node 16 | var impostor = Spatial.new() 17 | for mesh in player.get_node("Mesh").get_children(): 18 | # Duplicate mesh and only show it on the mini map 19 | var impostor_mesh = mesh.duplicate() 20 | (impostor_mesh as MeshInstance).set_layer_mask_bit(0, false) 21 | (impostor_mesh as MeshInstance).set_layer_mask_bit(1, false) 22 | (impostor_mesh as MeshInstance).set_layer_mask_bit(2, true) 23 | impostor_mesh.cast_shadow = MeshInstance.SHADOW_CASTING_SETTING_OFF 24 | impostor_mesh.generate_lightmap = false 25 | impostor.add_child(impostor_mesh) 26 | # Offset impostor to be at correct height 27 | impostor.scale *= player_size 28 | impostor.transform.origin = Vector3(0, player_height + player_size / 2.0, 0) 29 | _impostors.add_child(impostor) 30 | $MiniMapCamera.show() 31 | 32 | 33 | func _process(_delta): 34 | # Move and rotate the impostors 35 | # So that they are at the actual player positions and rotations 36 | for i in range(len(_players)): 37 | var player: KinematicBody = _players[i] 38 | var imposter: Spatial = _impostors.get_child(i) 39 | var player_pos = player.global_transform.origin 40 | var imposter_pos = imposter.global_transform.origin 41 | imposter_pos = Vector3(player_pos.x, imposter_pos.y, player_pos.z) 42 | imposter.global_transform.origin = imposter_pos 43 | imposter.rotation = player.rotation 44 | -------------------------------------------------------------------------------- /game/games/sortit/ui/mini_map.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://games/sortit/ui/mini_map.gd" type="Script" id=1] 4 | 5 | [sub_resource type="Environment" id=1] 6 | background_energy = 0.0 7 | ambient_light_color = Color( 0.180392, 0.192157, 0.25098, 1 ) 8 | tonemap_mode = 3 9 | tonemap_exposure = 0.54 10 | tonemap_white = 0.2 11 | adjustment_enabled = true 12 | adjustment_brightness = 0.77 13 | adjustment_contrast = 1.34 14 | adjustment_saturation = 2.58 15 | 16 | [node name="MiniMap" type="Node"] 17 | script = ExtResource( 1 ) 18 | player_height = 13.0 19 | 20 | [node name="MiniMapCamera" type="Camera" parent="."] 21 | transform = Transform( -4.37114e-08, 1, -3.59989e-21, 4.37114e-08, 1.91069e-15, 1, 1, 4.37114e-08, -4.37114e-08, 7.586, 30, -3.92 ) 22 | visible = false 23 | cull_mask = 1048573 24 | environment = SubResource( 1 ) 25 | projection = 1 26 | size = 167.756 27 | near = 0.02 28 | far = 1838.4 29 | 30 | [node name="Impostors" type="Node" parent="."] 31 | -------------------------------------------------------------------------------- /game/games/sortit/ui/player_select.gd: -------------------------------------------------------------------------------- 1 | tool 2 | extends PanelContainer 3 | 4 | signal got_input(input_type) 5 | 6 | export(StyleBoxFlat) var get_input_style 7 | export(bool) var get_input setget set_get_input, get_get_input 8 | export(bool) var display setget set_display, get_display 9 | 10 | var _control_scheme_name = "" 11 | var _control_scheme_detail = "" 12 | var _display = false 13 | var _get_input = false 14 | 15 | onready var _player_text = $CenterContainer/VBoxContainer/PlayerText 16 | onready var _description_text = $CenterContainer/VBoxContainer/DescriptionText 17 | onready var _controll_detail_text = $CenterContainer/VBoxContainer/ControllText 18 | 19 | 20 | func set_display(do_display: bool): 21 | if do_display: 22 | self.add_stylebox_override("panel", null) 23 | $CenterContainer.show() 24 | else: 25 | self.add_stylebox_override("panel", StyleBoxEmpty.new()) 26 | $CenterContainer.hide() 27 | _display = do_display 28 | 29 | 30 | func get_display() -> bool: 31 | return _display 32 | 33 | 34 | func set_get_input(do_get_input: bool): 35 | # This check is needed, because the onready vars might not be initialized when the node is created 36 | if not is_inside_tree(): 37 | _get_input = do_get_input 38 | return 39 | 40 | if do_get_input: 41 | set_process_input(true) 42 | self.add_stylebox_override("panel", get_input_style) 43 | _description_text.text = "Press button to add" 44 | _controll_detail_text.text = "" 45 | else: 46 | set_process_input(false) 47 | self.add_stylebox_override("panel", null) 48 | _description_text.text = _control_scheme_name 49 | _controll_detail_text.text = _control_scheme_detail 50 | _get_input = do_get_input 51 | 52 | 53 | func get_get_input() -> bool: 54 | return _get_input 55 | 56 | 57 | func _ready(): 58 | if Engine.is_editor_hint(): 59 | return 60 | _player_text.text = name 61 | # Update the state once all the onready nodes are initialized 62 | set_get_input(_get_input) 63 | set_display(_display) 64 | 65 | 66 | func _input(event): 67 | var input_map = $"../../../../../..".input_map as Dictionary 68 | if event is InputEventKey: 69 | if not event.pressed: 70 | var keyboard_input_type = null 71 | # Try to find a control scheme, that contains the released button 72 | for input_type in input_map.keys(): 73 | match typeof(input_type): 74 | SortItRoot.InputType.JOY: 75 | pass 76 | _: 77 | var actions = input_map[input_type]["actions"] as Dictionary 78 | for action_key in actions.values(): 79 | if action_key == event.scancode: 80 | keyboard_input_type = input_type 81 | if keyboard_input_type == null: 82 | return 83 | _control_scheme_name = "Keyboard: " + input_map[keyboard_input_type]["name"] 84 | _control_scheme_detail = input_map[keyboard_input_type]["control_detail"] 85 | emit_signal("got_input", [keyboard_input_type, -1]) 86 | if event is InputEventJoypadButton: 87 | if not event.pressed: 88 | _control_scheme_name = ( 89 | input_map[SortItRoot.InputType.JOY]["name"] 90 | + " " 91 | + str(event.device) 92 | ) 93 | _control_scheme_detail = input_map[SortItRoot.InputType.JOY]["control_detail"] 94 | emit_signal("got_input", [SortItRoot.InputType.JOY, event.device]) 95 | -------------------------------------------------------------------------------- /game/games/sortit/ui/player_select.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=2] 2 | 3 | [ext_resource path="res://games/sortit/ui/player_select.gd" type="Script" id=1] 4 | [ext_resource path="res://shared/fonts/roboto/roboto_black.ttf" type="DynamicFontData" id=2] 5 | 6 | [sub_resource type="StyleBoxEmpty" id=23] 7 | 8 | [sub_resource type="StyleBoxFlat" id=20] 9 | draw_center = false 10 | border_width_left = 3 11 | border_width_top = 3 12 | border_width_right = 3 13 | border_width_bottom = 3 14 | border_color = Color( 0.262745, 0.262745, 0.262745, 1 ) 15 | corner_radius_top_left = 8 16 | corner_radius_top_right = 8 17 | corner_radius_bottom_right = 8 18 | corner_radius_bottom_left = 8 19 | 20 | [sub_resource type="DynamicFont" id=22] 21 | size = 20 22 | font_data = ExtResource( 2 ) 23 | 24 | [node name="PlayerInput" type="PanelContainer"] 25 | margin_right = 392.0 26 | margin_bottom = 247.0 27 | size_flags_horizontal = 3 28 | size_flags_vertical = 3 29 | custom_styles/panel = SubResource( 23 ) 30 | script = ExtResource( 1 ) 31 | get_input_style = SubResource( 20 ) 32 | 33 | [node name="CenterContainer" type="CenterContainer" parent="."] 34 | visible = false 35 | margin_left = 7.0 36 | margin_top = 7.0 37 | margin_right = 385.0 38 | margin_bottom = 240.0 39 | 40 | [node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"] 41 | margin_left = 152.0 42 | margin_top = 86.0 43 | margin_right = 225.0 44 | margin_bottom = 146.0 45 | 46 | [node name="PlayerText" type="Label" parent="CenterContainer/VBoxContainer"] 47 | margin_right = 73.0 48 | margin_bottom = 14.0 49 | custom_colors/font_color = Color( 0.694118, 0.698039, 0.709804, 1 ) 50 | text = "PlayerInput" 51 | align = 1 52 | 53 | [node name="DescriptionText" type="Label" parent="CenterContainer/VBoxContainer"] 54 | margin_top = 18.0 55 | margin_right = 73.0 56 | margin_bottom = 32.0 57 | align = 1 58 | 59 | [node name="ControllText" type="Label" parent="CenterContainer/VBoxContainer"] 60 | margin_top = 18.0 61 | margin_right = 73.0 62 | margin_bottom = 32.0 63 | custom_colors/font_color = Color( 0.313726, 0.313726, 0.34902, 1 ) 64 | custom_fonts/font = SubResource( 22 ) 65 | align = 1 66 | -------------------------------------------------------------------------------- /game/games/sortit/ui/remaining_time.gd: -------------------------------------------------------------------------------- 1 | extends Label 2 | 3 | export(NodePath) var root_game_path 4 | export(Gradient) var color_gradient 5 | onready var _end_timer = get_node(root_game_path).get_node("EndTimer") 6 | onready var _hbox_container = $"../../../" 7 | onready var _vbox_container = $"../../../.." 8 | 9 | 10 | func _ready(): 11 | var players = get_node(root_game_path).get_node("Players") 12 | set_timer_location(players.player_count) 13 | 14 | 15 | # Set the location of the label, based on how many players there are 16 | func set_timer_location(player_count: int): 17 | if player_count == 1: 18 | # Top Left 19 | _hbox_container.alignment = BoxContainer.ALIGN_BEGIN 20 | else: 21 | _hbox_container.alignment = BoxContainer.ALIGN_CENTER 22 | 23 | if player_count > 2: 24 | # Top middel 25 | _vbox_container.alignment = BoxContainer.ALIGN_CENTER 26 | else: 27 | # Center 28 | _vbox_container.alignment = BoxContainer.ALIGN_BEGIN 29 | 30 | 31 | func _process(_delta): 32 | var left_seconds = _end_timer.time_left 33 | var minutes = left_seconds / 60.0 34 | var seconds = fposmod(minutes, 1) * 60 35 | if minutes < 1: 36 | text = str(floor(seconds)) 37 | add_color_override("font_color", color_gradient.interpolate(1 - seconds / 60.0)) 38 | else: 39 | text = "%02d:%02d" % [minutes, seconds] 40 | -------------------------------------------------------------------------------- /game/games/sortit/ui/status_display.gd: -------------------------------------------------------------------------------- 1 | extends VBoxContainer 2 | 3 | const STATUS_TEXT = "%d points" 4 | 5 | export(float) var arrow_corner_separation = 10 6 | export(float) var arrow_screen_size_fraction = 0.3 7 | 8 | var _display_pointing_arrow = false 9 | var _last_viewport_height = 0 10 | 11 | onready var _pointing_arrow: Sprite = $PoinitingArrow 12 | onready var _screen_height: int = OS.get_screen_size().y 13 | 14 | 15 | func display_score(score: int): 16 | $HBoxContainer/StatusLabel.text = STATUS_TEXT % score 17 | 18 | 19 | func set_pedestal_direction_angle(angle: float): 20 | _pointing_arrow.rotation = angle 21 | 22 | 23 | func set_display_pointing_arrow(display: bool): 24 | # Only do something if the display state changed 25 | if display == _display_pointing_arrow: 26 | return 27 | _display_pointing_arrow = display 28 | # Play Fade in / Fade out animation 29 | var animation_player = _pointing_arrow.get_node("Fader") as AnimationPlayer 30 | if display: 31 | animation_player.play("Fade") 32 | else: 33 | animation_player.play_backwards("Fade") 34 | 35 | 36 | func _update_pointing_arrow_position(): 37 | # Only recalculate arrow position/scale, if viewport size changed 38 | var viewport_height = get_viewport().size.y 39 | if viewport_height == _last_viewport_height: 40 | return 41 | # Calculate arrow scale/size based on window and screen size 42 | var viewport_fraction = viewport_height / _screen_height 43 | var arrow_scale = viewport_fraction * arrow_screen_size_fraction 44 | _pointing_arrow.scale = Vector2(arrow_scale, arrow_scale) 45 | var arrow_size = _pointing_arrow.texture.get_size() * arrow_scale 46 | # Place arrow in bottom left corner with separation 47 | _pointing_arrow.position = Vector2( 48 | arrow_corner_separation * viewport_fraction + arrow_size.x / 2.0, 49 | viewport_height - arrow_size.y / 2.0 - arrow_corner_separation * viewport_fraction 50 | ) 51 | 52 | 53 | func _process(_delta): 54 | _update_pointing_arrow_position() 55 | -------------------------------------------------------------------------------- /game/games/sortit/ui/status_display.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=2] 2 | 3 | [ext_resource path="res://games/sortit/ui/status_display.gd" type="Script" id=1] 4 | [ext_resource path="res://shared/fonts/roboto/roboto_black.ttf" type="DynamicFontData" id=2] 5 | [ext_resource path="res://games/sortit/assets/images/arrow.png" type="Texture" id=3] 6 | 7 | [sub_resource type="DynamicFont" id=1] 8 | size = 20 9 | font_data = ExtResource( 2 ) 10 | 11 | [sub_resource type="Animation" id=2] 12 | resource_name = "New Anim" 13 | length = 0.3 14 | tracks/0/type = "value" 15 | tracks/0/path = NodePath("PoinitingArrow:self_modulate") 16 | tracks/0/interp = 1 17 | tracks/0/loop_wrap = true 18 | tracks/0/imported = false 19 | tracks/0/enabled = true 20 | tracks/0/keys = { 21 | "times": PoolRealArray( 0, 0.3 ), 22 | "transitions": PoolRealArray( 1, 1 ), 23 | "update": 0, 24 | "values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ] 25 | } 26 | 27 | [node name="StatusDisplay" type="VBoxContainer"] 28 | anchor_right = 1.0 29 | anchor_bottom = 1.0 30 | size_flags_horizontal = 3 31 | size_flags_vertical = 3 32 | script = ExtResource( 1 ) 33 | 34 | [node name="HBoxContainer" type="HBoxContainer" parent="."] 35 | margin_right = 1024.0 36 | margin_bottom = 24.0 37 | 38 | [node name="StatusLabel" type="Label" parent="HBoxContainer"] 39 | margin_right = 1024.0 40 | margin_bottom = 24.0 41 | size_flags_horizontal = 3 42 | custom_colors/font_color = Color( 0, 0, 0, 1 ) 43 | custom_fonts/font = SubResource( 1 ) 44 | align = 1 45 | 46 | [node name="PoinitingArrow" type="Sprite" parent="."] 47 | self_modulate = Color( 1, 1, 1, 0 ) 48 | position = Vector2( 81.4161, 527.26 ) 49 | scale = Vector2( 0.147467, 0.147467 ) 50 | texture = ExtResource( 3 ) 51 | 52 | [node name="Fader" type="AnimationPlayer" parent="PoinitingArrow"] 53 | root_node = NodePath("../..") 54 | anims/Fade = SubResource( 2 ) 55 | -------------------------------------------------------------------------------- /game/games/sortit/viewports.gd: -------------------------------------------------------------------------------- 1 | extends GridContainer 2 | 3 | const STATUS_DISPLAY_SCENE = preload("res://games/sortit/ui/status_display.tscn") 4 | onready var _players: Node = $"../Players" 5 | onready var _minimap = $MiniMap 6 | 7 | 8 | func _add_viewport_container() -> Viewport: 9 | # Create viewport and viewport container 10 | var viewport_container = ViewportContainer.new() 11 | viewport_container.stretch = true 12 | viewport_container.size_flags_horizontal = SIZE_EXPAND_FILL 13 | viewport_container.size_flags_vertical = SIZE_EXPAND_FILL 14 | var viewport = Viewport.new() 15 | viewport.shadow_atlas_size = 1 16 | viewport.msaa = Viewport.MSAA_4X 17 | viewport_container.add_child(viewport) 18 | # Add viewport container 19 | add_child(viewport_container) 20 | return viewport 21 | 22 | 23 | func create_viewports(): 24 | var player_count = _players.player_count 25 | if player_count == 1: 26 | columns = 1 27 | for i in range(player_count): 28 | var viewport = _add_viewport_container() 29 | # Create camerea and status display for player 30 | var camera = Camera.new() 31 | camera.fov = 50 32 | camera.rotation_degrees.x = -70 33 | camera.rotation_degrees.y = -90 34 | camera.set_cull_mask_bit(2, false) 35 | viewport.add_child(camera) 36 | var status_display = STATUS_DISPLAY_SCENE.instance() 37 | viewport.add_child(status_display) 38 | # Assign camerea and status display to player 39 | var player = _players.get_child(i) 40 | player.camera = camera 41 | player.status_display = status_display 42 | if player_count == 3: 43 | # Move minimap camera into new viewport to fill empty spot 44 | var viewport = _add_viewport_container() 45 | viewport.shadow_atlas_size = 0 # Disable shadows for mini map 46 | remove_child(_minimap) 47 | _minimap.set_players($"../Players".get_children()) 48 | viewport.add_child(_minimap) 49 | else: 50 | _minimap.set_process(false) 51 | -------------------------------------------------------------------------------- /game/games/testgame/README.md: -------------------------------------------------------------------------------- 1 | # How to add you own Minigame - A Step-by-step Guide 2 | 3 | ## 1. Choose a folder for your minigame 4 | All files related to your game only go into a folder inside `res://games/` with a random name you choose. You shouldn't rename it after the game is first merged. 5 | There are no rules what to call it. A good idea is to use your name and the name of your game (ex. `asecondguy_assimilator`) to avoid any accidental collisions. 6 | 7 | ## 2. Make a game.cfg 8 | The game.cfg file resides in your minigame folder. It defines how your game is loaded and displayed in the game selection menu. 9 | You can find all relevant keys in this document. 10 | If you are unsure copy the game.cfg from the testgame and change the values to your need. 11 | It will always contain all required and optional settings clearly marked. 12 | 13 | ## 3. Make your game work 14 | * GameManager is always available in every script and has useful functions(like `end_game()`). A list of these functions can be found in this document or the full list with all functions in [this README](../../menu/README.md) 15 | * Don't add `Autoload` scripts. They are loaded on startup and run all the time so it is bad practice to use one in a minigame. 16 | * The scene you defined in `game.cfg` will be loaded with `get_tree().change_scene()`. So It'll work like it is the main scene. 17 | * To return to the game selection use `GameManager.end_game("This is the end message", score)` 18 | * The PauseMenu will work immediately. It will pause the game using `get_tree().paused` so make sure none of your gameplay nodes have the pause mode on PROCESS. 19 | 20 | # game.cfg keys 21 | * Section: `game` 22 | * Choose a memorable name 23 | `name="Balloon pop"` 24 | * Say what your game is about. 25 | `desc="Pop the balloons of the right [color=blue]color[/color]"` 26 | * These paths are relative to the game folder. 27 | `main_scene="balloon_pop.tscn"` 28 | `icon="balloon.png"` 29 | * Version has no effect. But it might be shown in debug menus. 30 | `version="1.0"` 31 | * Put your name here. Has no effect. 32 | `creator="ASecondGuy"` 33 | * Section: `page modules` 34 | * Any key here will add a page of the same name to the pause menu. 35 | If the name is a translation key it will be translated automatically. 36 | ex: `T_HELP="help_page.tscn"` 37 | You can add as many as you want ore none at all. 38 | 39 | # Useful functions 40 | * **`end_game(message: String = "", score = null)`** 41 | Ends the game and displays the message. This behaviour will change in the future. 42 | If your game has a score representet by a comperable constant type, then pass it as `score`. 43 | If the score is more complex you can even pass a Dictionary with a `"score"` key that has a comperable value and constant type. 44 | 45 | * **`load_game(game_cfg: ConfigFile)`** 46 | Loads the game specified by the config file. 47 | -------------------------------------------------------------------------------- /game/games/testgame/balloon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/testgame/balloon.png -------------------------------------------------------------------------------- /game/games/testgame/balloon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/balloon.png-a4cb4cec73bb2954300b057639860f49.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/testgame/balloon.png" 13 | dest_files=[ "res://.import/balloon.png-a4cb4cec73bb2954300b057639860f49.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/testgame/balloon.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://games/testgame/balloon.png" type="Texture" id=1] 4 | [ext_resource path="res://games/testgame/string.png" type="Texture" id=2] 5 | 6 | [node name="balloon" type="TextureButton"] 7 | margin_right = 1024.0 8 | margin_bottom = 1024.0 9 | rect_scale = Vector2( 0.1, 0.1 ) 10 | texture_normal = ExtResource( 1 ) 11 | 12 | [node name="String" type="TextureRect" parent="."] 13 | modulate = Color( 0.423529, 0.423529, 0.423529, 1 ) 14 | show_behind_parent = true 15 | texture = ExtResource( 2 ) 16 | -------------------------------------------------------------------------------- /game/games/testgame/balloon_pop.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://games/testgame/balloon_pop.gd" type="Script" id=1] 4 | 5 | [sub_resource type="ParticlesMaterial" id=1] 6 | lifetime_randomness = 0.05 7 | emission_shape = 1 8 | emission_sphere_radius = 10.0 9 | flag_disable_z = true 10 | spread = 180.0 11 | gravity = Vector3( 0, 0, 0 ) 12 | initial_velocity = 39.22 13 | initial_velocity_random = 0.18 14 | orbit_velocity = 0.0 15 | orbit_velocity_random = 0.0 16 | angle_random = 1.0 17 | scale = 2.0 18 | scale_random = 1.0 19 | hue_variation = 1.0 20 | hue_variation_random = 1.0 21 | 22 | [node name="balloonPop" type="MarginContainer"] 23 | anchor_right = 1.0 24 | anchor_bottom = 1.0 25 | script = ExtResource( 1 ) 26 | 27 | [node name="Timer" type="Timer" parent="."] 28 | autostart = true 29 | 30 | [node name="RespawnTimer" type="Timer" parent="."] 31 | one_shot = true 32 | 33 | [node name="VBoxContainer" type="VBoxContainer" parent="."] 34 | margin_right = 1024.0 35 | margin_bottom = 600.0 36 | 37 | [node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"] 38 | margin_right = 1024.0 39 | margin_bottom = 14.0 40 | 41 | [node name="ColorLabel" type="Label" parent="VBoxContainer/HBoxContainer"] 42 | margin_bottom = 14.0 43 | 44 | [node name="StatusLabel" type="Label" parent="VBoxContainer/HBoxContainer"] 45 | margin_left = 4.0 46 | margin_right = 1024.0 47 | margin_bottom = 14.0 48 | size_flags_horizontal = 3 49 | align = 2 50 | 51 | [node name="balloonArea" type="Control" parent="VBoxContainer"] 52 | margin_top = 18.0 53 | margin_right = 1024.0 54 | margin_bottom = 600.0 55 | size_flags_horizontal = 3 56 | size_flags_vertical = 3 57 | 58 | [node name="Particles2D" type="Particles2D" parent="VBoxContainer"] 59 | emitting = false 60 | amount = 80 61 | one_shot = true 62 | explosiveness = 0.64 63 | process_material = SubResource( 1 ) 64 | 65 | [connection signal="timeout" from="RespawnTimer" to="." method="_on_RespawnTimer_timeout"] 66 | -------------------------------------------------------------------------------- /game/games/testgame/game.cfg: -------------------------------------------------------------------------------- 1 | ; This example file lists all required and optional Values. 2 | ; It is meant for easy identification of games. 3 | 4 | [game] 5 | ; Choose a memorable name. 6 | name="Balloon Pop" 7 | ; Say what your game is about. 8 | desc="Pop the balloons of the right color" 9 | ; These paths are relative to the game folder. 10 | main_scene="balloon_pop.tscn" 11 | icon="balloon.png" 12 | ; Version has no effect. But it might be shown in debug menus. 13 | version="1.0" 14 | ; Put your name here. 15 | creator="ASecondGuy" 16 | 17 | [page modules] 18 | ; You can add pages to the pause menu by listing them here. 19 | T_HELP="help/help.tscn" 20 | -------------------------------------------------------------------------------- /game/games/testgame/help/help.gd: -------------------------------------------------------------------------------- 1 | extends MarginContainer 2 | 3 | 4 | func _on_Button_pressed(): 5 | hide() 6 | -------------------------------------------------------------------------------- /game/games/testgame/help/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/testgame/help/help.png -------------------------------------------------------------------------------- /game/games/testgame/help/help.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/help.png-732a56a1b05cae12506783a6988632ee.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/testgame/help/help.png" 13 | dest_files=[ "res://.import/help.png-732a56a1b05cae12506783a6988632ee.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/games/testgame/help/help.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://app/style/main_theme.tres" type="Theme" id=1] 4 | [ext_resource path="res://games/testgame/help/help.png" type="Texture" id=2] 5 | [ext_resource path="res://games/testgame/help/help.gd" type="Script" id=3] 6 | 7 | [node name="Help" type="MarginContainer"] 8 | anchor_right = 1.0 9 | anchor_bottom = 1.0 10 | theme = ExtResource( 1 ) 11 | custom_constants/margin_right = 40 12 | custom_constants/margin_top = 40 13 | custom_constants/margin_left = 40 14 | custom_constants/margin_bottom = 40 15 | script = ExtResource( 3 ) 16 | 17 | [node name="PC" type="PanelContainer" parent="."] 18 | margin_left = 40.0 19 | margin_top = 40.0 20 | margin_right = 984.0 21 | margin_bottom = 560.0 22 | 23 | [node name="VBoxContainer" type="VBoxContainer" parent="PC"] 24 | margin_left = 8.0 25 | margin_top = 8.0 26 | margin_right = 936.0 27 | margin_bottom = 512.0 28 | 29 | [node name="TextureRect" type="TextureRect" parent="PC/VBoxContainer"] 30 | margin_right = 928.0 31 | margin_bottom = 464.0 32 | size_flags_horizontal = 3 33 | size_flags_vertical = 3 34 | texture = ExtResource( 2 ) 35 | expand = true 36 | stretch_mode = 6 37 | 38 | [node name="Button" type="Button" parent="PC/VBoxContainer"] 39 | margin_top = 469.0 40 | margin_right = 90.0 41 | margin_bottom = 504.0 42 | size_flags_horizontal = 0 43 | text = "T_CLOSE" 44 | 45 | [connection signal="pressed" from="PC/VBoxContainer/Button" to="." method="_on_Button_pressed"] 46 | -------------------------------------------------------------------------------- /game/games/testgame/string.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/games/testgame/string.png -------------------------------------------------------------------------------- /game/games/testgame/string.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/string.png-0a5bb3bf0e50ed69408bc2c2791dd82a.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://games/testgame/string.png" 13 | dest_files=[ "res://.import/string.png-0a5bb3bf0e50ed69408bc2c2791dd82a.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/icon.png -------------------------------------------------------------------------------- /game/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | process/normal_map_invert_y=false 32 | stream=false 33 | size_limit=0 34 | detect_3d=true 35 | svg/scale=1.0 36 | -------------------------------------------------------------------------------- /game/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ { 12 | "base": "Reference", 13 | "class": "PixelSideScrollerUtils", 14 | "language": "GDScript", 15 | "path": "res://games/pixel_side_scroller/utils.gd" 16 | }, { 17 | "base": "RigidBody", 18 | "class": "SortItBox", 19 | "language": "GDScript", 20 | "path": "res://games/sortit/box.gd" 21 | }, { 22 | "base": "StaticBody", 23 | "class": "SortItPedestal", 24 | "language": "GDScript", 25 | "path": "res://games/sortit/pedestal.gd" 26 | }, { 27 | "base": "KinematicBody", 28 | "class": "SortItPlayer", 29 | "language": "GDScript", 30 | "path": "res://games/sortit/player.gd" 31 | }, { 32 | "base": "MarginContainer", 33 | "class": "SortItRoot", 34 | "language": "GDScript", 35 | "path": "res://games/sortit/sort_it.gd" 36 | } ] 37 | _global_script_class_icons={ 38 | "PixelSideScrollerUtils": "", 39 | "SortItBox": "", 40 | "SortItPedestal": "", 41 | "SortItPlayer": "", 42 | "SortItRoot": "" 43 | } 44 | 45 | [application] 46 | 47 | config/name="Suffragium" 48 | run/main_scene="res://app/scenes/splash_screen/splashed_menu.tscn" 49 | boot_splash/image="res://app/images/alpha_pixel_1.png" 50 | boot_splash/fullsize=false 51 | boot_splash/use_filter=false 52 | boot_splash/bg_color=Color( 0, 0, 0, 1 ) 53 | config/icon="res://icon.png" 54 | 55 | [autoload] 56 | 57 | GameManager="*res://app/singleton/game_manager.gd" 58 | UserSettings="*res://app/singleton/user_settings.gd" 59 | Utils="*res://app/singleton/utils.gd" 60 | PauseMenu="*res://app/pause_menu/pause_menu.tscn" 61 | PlayerManager="*res://app/singleton/player_manager.gd" 62 | 63 | [global] 64 | 65 | control=false 66 | 67 | [input] 68 | 69 | flap={ 70 | "deadzone": 0.5, 71 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null) 72 | ] 73 | } 74 | 75 | [locale] 76 | 77 | translations=PoolStringArray( "res://translations/tr.de.translation", "res://translations/tr.en.translation" ) 78 | 79 | [physics] 80 | 81 | common/enable_pause_aware_picking=true 82 | 83 | [rendering] 84 | 85 | 2d/snapping/use_gpu_pixel_snap=true 86 | environment/default_environment="res://default_env.tres" 87 | -------------------------------------------------------------------------------- /game/shared/fonts/README.md: -------------------------------------------------------------------------------- 1 | # Font usage guidelines 2 | 3 | In general you should only use `Roboto`. 4 | If you need a mono font use `Roboto Mono`. 5 | 6 | If you need flavoured text in handwriting or pixelart style use `Caveat` or `Press Start 2P` respectively. Use these saparingly and with purpose. 7 | 8 | You may also use the variants provided in the folders. 9 | -------------------------------------------------------------------------------- /game/shared/fonts/caveat.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="DynamicFont" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://shared/fonts/caveat/caveat_variable_font_wght.ttf" type="DynamicFontData" id=1] 4 | 5 | [resource] 6 | font_data = ExtResource( 1 ) 7 | -------------------------------------------------------------------------------- /game/shared/fonts/caveat/README.txt: -------------------------------------------------------------------------------- 1 | Caveat Variable Font 2 | ==================== 3 | 4 | This download contains Caveat as both a variable font and static fonts. 5 | 6 | Caveat is a variable font with this axis: 7 | wght 8 | 9 | This means all the styles are contained in a single file: 10 | Caveat-VariableFont_wght.ttf 11 | 12 | If your app fully supports variable fonts, you can now pick intermediate styles 13 | that aren’t available as static fonts. Not all apps support variable fonts, and 14 | in those cases you can use the static font files for Caveat: 15 | static/Caveat-Regular.ttf 16 | static/Caveat-Medium.ttf 17 | static/Caveat-SemiBold.ttf 18 | static/Caveat-Bold.ttf 19 | 20 | Get started 21 | ----------- 22 | 23 | 1. Install the font files you want to use 24 | 25 | 2. Use your app's font picker to view the font family and all the 26 | available styles 27 | 28 | Learn more about variable fonts 29 | ------------------------------- 30 | 31 | https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts 32 | https://variablefonts.typenetwork.com 33 | https://medium.com/variable-fonts 34 | 35 | In desktop apps 36 | 37 | https://theblog.adobe.com/can-variable-fonts-illustrator-cc 38 | https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts 39 | 40 | Online 41 | 42 | https://developers.google.com/fonts/docs/getting_started 43 | https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide 44 | https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts 45 | 46 | Installing fonts 47 | 48 | MacOS: https://support.apple.com/en-us/HT201749 49 | Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux 50 | Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows 51 | 52 | Android Apps 53 | 54 | https://developers.google.com/fonts/docs/android 55 | https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts 56 | 57 | License 58 | ------- 59 | Please read the full license text (OFL.txt) to understand the permissions, 60 | restrictions and requirements for usage, redistribution, and modification. 61 | 62 | You can use them in your products & projects - print or digital, 63 | commercial or otherwise. 64 | 65 | This isn't legal advice, please consider consulting a lawyer and see the full 66 | license for all details. 67 | -------------------------------------------------------------------------------- /game/shared/fonts/caveat/caveat_variable_font_wght.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/caveat/caveat_variable_font_wght.ttf -------------------------------------------------------------------------------- /game/shared/fonts/caveat/static/caveat_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/caveat/static/caveat_bold.ttf -------------------------------------------------------------------------------- /game/shared/fonts/caveat/static/caveat_medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/caveat/static/caveat_medium.ttf -------------------------------------------------------------------------------- /game/shared/fonts/caveat/static/caveat_regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/caveat/static/caveat_regular.ttf -------------------------------------------------------------------------------- /game/shared/fonts/caveat/static/caveat_semi_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/caveat/static/caveat_semi_bold.ttf -------------------------------------------------------------------------------- /game/shared/fonts/press_start2p.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="DynamicFont" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://shared/fonts/press_start_2p/press_start2p_regular.ttf" type="DynamicFontData" id=1] 4 | 5 | [resource] 6 | font_data = ExtResource( 1 ) 7 | -------------------------------------------------------------------------------- /game/shared/fonts/press_start2p/press_start2p_regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/press_start2p/press_start2p_regular.ttf -------------------------------------------------------------------------------- /game/shared/fonts/press_start_2p_18px.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="DynamicFont" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://shared/fonts/press_start2p/press_start2p_regular.ttf" type="DynamicFontData" id=1] 4 | 5 | [resource] 6 | size = 18 7 | font_data = ExtResource( 1 ) 8 | -------------------------------------------------------------------------------- /game/shared/fonts/roboto.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="DynamicFont" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://shared/fonts/roboto/roboto_regular.ttf" type="DynamicFontData" id=1] 4 | 5 | [resource] 6 | font_data = ExtResource( 1 ) 7 | -------------------------------------------------------------------------------- /game/shared/fonts/roboto/roboto_black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto/roboto_black.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto/roboto_black_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto/roboto_black_italic.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto/roboto_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto/roboto_bold.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto/roboto_bold_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto/roboto_bold_italic.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto/roboto_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto/roboto_italic.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto/roboto_light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto/roboto_light.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto/roboto_light_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto/roboto_light_italic.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto/roboto_medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto/roboto_medium.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto/roboto_medium_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto/roboto_medium_italic.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto/roboto_regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto/roboto_regular.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto/roboto_thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto/roboto_thin.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto/roboto_thin_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto/roboto_thin_italic.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto_mono.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="DynamicFont" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://shared/fonts/roboto_mono/roboto_mono_variable_font_wght.ttf" type="DynamicFontData" id=1] 4 | 5 | [resource] 6 | font_data = ExtResource( 1 ) 7 | -------------------------------------------------------------------------------- /game/shared/fonts/roboto_mono/README.txt: -------------------------------------------------------------------------------- 1 | Roboto Mono Variable Font 2 | ========================= 3 | 4 | This download contains Roboto Mono as both variable fonts and static fonts. 5 | 6 | Roboto Mono is a variable font with this axis: 7 | wght 8 | 9 | This means all the styles are contained in these files: 10 | RobotoMono-VariableFont_wght.ttf 11 | RobotoMono-Italic-VariableFont_wght.ttf 12 | 13 | If your app fully supports variable fonts, you can now pick intermediate styles 14 | that aren’t available as static fonts. Not all apps support variable fonts, and 15 | in those cases you can use the static font files for Roboto Mono: 16 | static/RobotoMono-Thin.ttf 17 | static/RobotoMono-ExtraLight.ttf 18 | static/RobotoMono-Light.ttf 19 | static/RobotoMono-Regular.ttf 20 | static/RobotoMono-Medium.ttf 21 | static/RobotoMono-SemiBold.ttf 22 | static/RobotoMono-Bold.ttf 23 | static/RobotoMono-ThinItalic.ttf 24 | static/RobotoMono-ExtraLightItalic.ttf 25 | static/RobotoMono-LightItalic.ttf 26 | static/RobotoMono-Italic.ttf 27 | static/RobotoMono-MediumItalic.ttf 28 | static/RobotoMono-SemiBoldItalic.ttf 29 | static/RobotoMono-BoldItalic.ttf 30 | 31 | Get started 32 | ----------- 33 | 34 | 1. Install the font files you want to use 35 | 36 | 2. Use your app's font picker to view the font family and all the 37 | available styles 38 | 39 | Learn more about variable fonts 40 | ------------------------------- 41 | 42 | https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts 43 | https://variablefonts.typenetwork.com 44 | https://medium.com/variable-fonts 45 | 46 | In desktop apps 47 | 48 | https://theblog.adobe.com/can-variable-fonts-illustrator-cc 49 | https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts 50 | 51 | Online 52 | 53 | https://developers.google.com/fonts/docs/getting_started 54 | https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide 55 | https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts 56 | 57 | Installing fonts 58 | 59 | MacOS: https://support.apple.com/en-us/HT201749 60 | Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux 61 | Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows 62 | 63 | Android Apps 64 | 65 | https://developers.google.com/fonts/docs/android 66 | https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts 67 | 68 | License 69 | ------- 70 | Please read the full license text (LICENSE.txt) to understand the permissions, 71 | restrictions and requirements for usage, redistribution, and modification. 72 | 73 | You can use them in your products & projects - print or digital, 74 | commercial or otherwise. 75 | 76 | This isn't legal advice, please consider consulting a lawyer and see the full 77 | license for all details. 78 | -------------------------------------------------------------------------------- /game/shared/fonts/roboto_mono/roboto_mono_italic_variable_font_wght.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto_mono/roboto_mono_italic_variable_font_wght.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto_mono/roboto_mono_variable_font_wght.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto_mono/roboto_mono_variable_font_wght.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto_mono/static/roboto_mono_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto_mono/static/roboto_mono_bold.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto_mono/static/roboto_mono_bold_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto_mono/static/roboto_mono_bold_italic.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto_mono/static/roboto_mono_extra_light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto_mono/static/roboto_mono_extra_light.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto_mono/static/roboto_mono_extra_light_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto_mono/static/roboto_mono_extra_light_italic.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto_mono/static/roboto_mono_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto_mono/static/roboto_mono_italic.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto_mono/static/roboto_mono_light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto_mono/static/roboto_mono_light.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto_mono/static/roboto_mono_light_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto_mono/static/roboto_mono_light_italic.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto_mono/static/roboto_mono_medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto_mono/static/roboto_mono_medium.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto_mono/static/roboto_mono_medium_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto_mono/static/roboto_mono_medium_italic.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto_mono/static/roboto_mono_regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto_mono/static/roboto_mono_regular.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto_mono/static/roboto_mono_semi_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto_mono/static/roboto_mono_semi_bold.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto_mono/static/roboto_mono_semi_bold_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto_mono/static/roboto_mono_semi_bold_italic.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto_mono/static/roboto_mono_thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto_mono/static/roboto_mono_thin.ttf -------------------------------------------------------------------------------- /game/shared/fonts/roboto_mono/static/roboto_mono_thin_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsgamedev/Suffragium/88d97971d429b24b87189d7b772ab9940cd618d0/game/shared/fonts/roboto_mono/static/roboto_mono_thin_italic.ttf -------------------------------------------------------------------------------- /game/translations/tr.csv.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="csv_translation" 4 | type="Translation" 5 | 6 | [deps] 7 | 8 | files=[ "res://translations/tr.de.translation", "res://translations/tr.en.translation" ] 9 | 10 | source_file="res://translations/tr.csv" 11 | dest_files=[ "res://translations/tr.de.translation", "res://translations/tr.en.translation" ] 12 | 13 | [params] 14 | 15 | compress=true 16 | delimiter=0 17 | -------------------------------------------------------------------------------- /tools/pull_requests_overview/pull_requests_overview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PR Overview - Suffragium 6 | 7 | 8 | 9 | 10 | 11 | 12 | Suffragium pull requst overview 13 | 14 | Refresh 15 | Active 16 | Merge 17 | Close 18 | 19 | 20 | 21 | Authentication required 22 | 23 | The remaining request limit is not sufficient to fetch the required data. 24 | Please authenticate with a Github personal access token. 25 | 26 | 27 | Generate a personal access token! 28 | (No scope needs to be selected) 29 | 30 | 31 | 33 | Authenticate 34 | Continue without Token 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /tools/pull_requests_overview/styles.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0px; 3 | padding: 0px; 4 | color: #c9d1d9; 5 | text-decoration: none; 6 | } 7 | 8 | @font-face { 9 | font-family: 'Roboto'; 10 | src: url('../../game/shared/fonts/roboto/roboto_regular.ttf'); 11 | } 12 | 13 | body { 14 | font-family: 'Roboto'; 15 | margin: 2vmin; 16 | box-sizing: border-box; 17 | background-color: #0d1117; 18 | } 19 | 20 | h1 { 21 | margin-bottom: 3vmin; 22 | } 23 | 24 | h2, 25 | h3 { 26 | margin-bottom: 1vmin; 27 | } 28 | 29 | a { 30 | color: #58a6ff; 31 | } 32 | 33 | a:hover { 34 | text-decoration: underline; 35 | } 36 | 37 | span { 38 | margin-right: 3vmin; 39 | } 40 | 41 | .pr_box { 42 | padding-left: 2vmin; 43 | padding-top: 1vmin; 44 | padding-bottom: 1vmin; 45 | background: #131922; 46 | border-radius: 1vmin; 47 | } 48 | 49 | .pr_outer_box { 50 | padding-left: 1vmin; 51 | margin-top: 1vmin; 52 | background: #1b3f75; 53 | border-radius: 1vmin; 54 | border-top-right-radius: 2vmin; 55 | border-bottom-right-radius: 2vmin; 56 | } 57 | 58 | .pr_draft { 59 | background: #161920; 60 | color: #999fa5; 61 | } 62 | 63 | .status_active { 64 | background-color: rgb(128, 192, 255); 65 | } 66 | 67 | .status_merge { 68 | background-color: rgb(134, 134, 0); 69 | } 70 | 71 | .status_delete { 72 | background-color: rgb(150, 57, 57); 73 | } 74 | 75 | .legend { 76 | position: absolute; 77 | top: 0px; 78 | right: 0px; 79 | border-radius: 1vmin; 80 | padding: 1vmin; 81 | margin-right: 2vmin; 82 | margin-top: 2vmin; 83 | } 84 | 85 | .legend span { 86 | border-radius: 1vmin; 87 | padding: 1vmin; 88 | margin-right: 1vmin; 89 | } 90 | 91 | @media only screen and (max-width: 825px) { 92 | .legend { 93 | position: inherit; 94 | } 95 | } 96 | 97 | #dialog { 98 | margin: 2vmin; 99 | top: 1vmin; 100 | bottom: 1vmin; 101 | left: 1vmin; 102 | right: 1vmin; 103 | background-color: rgb(128, 192, 255); 104 | } 105 | 106 | #token_dialog p { 107 | margin-bottom: 1vmin; 108 | } 109 | 110 | .center { 111 | margin: 0 auto; 112 | width: 100%; 113 | } 114 | 115 | .hide { 116 | display: none; 117 | } 118 | 119 | .right_spacer { 120 | margin-right: 4vmin; 121 | } 122 | 123 | button { 124 | border-radius: 1vmin; 125 | padding: 1vmin; 126 | background-color: rgb(65, 65, 66); 127 | border-color: #ffffff34; 128 | cursor: pointer; 129 | } 130 | 131 | button:hover { 132 | background-color: #2e5786; 133 | } 134 | 135 | input { 136 | padding: 1vmin; 137 | } 138 | -------------------------------------------------------------------------------- /tools/run_gdtoolkit.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """This Script runs gdformat and gdlint on all files in game folder. 3 | https://github.com/Scony/godot-gdscript-toolkit 4 | """ 5 | import sys 6 | import argparse 7 | import subprocess 8 | 9 | from os.path import abspath, dirname, join 10 | from typing import Union 11 | 12 | 13 | def main() -> Union[int, str, None]: 14 | """Execute gdformat and gdlint and return whether there was an error.""" 15 | parser = argparse.ArgumentParser( 16 | description="This Script runs gdformat and gdlint on all files in game folder", 17 | formatter_class=argparse.ArgumentDefaultsHelpFormatter, 18 | ) 19 | parser.add_argument( 20 | "-d", 21 | "--diff", 22 | action="store_true", 23 | help="Don't write the files back, just suggest formattting changes", 24 | ) 25 | parser.add_argument( 26 | "-s", "--skip", action="store_true", help="Skip the pause at the end on windows" 27 | ) 28 | args = parser.parse_args() 29 | config = vars(args) 30 | 31 | err: Union[int, str, None] 32 | if sys.version_info < (3, 7): 33 | err = "Please upgrade your Python version to 3.7.0 or higher" 34 | else: 35 | game_path = join(dirname(dirname(abspath(__file__))), "game") 36 | 37 | try: 38 | print("--- Format ---") 39 | parameters = ["gdformat", game_path] 40 | if config.get("diff"): 41 | parameters.append("-d") 42 | err = run_command(parameters) 43 | 44 | print("\n--- Lint ---") 45 | err = err or run_command(["gdlint", game_path]) 46 | except OSError: 47 | err = "ERROR: GDScript Toolkit not installed!" 48 | 49 | if sys.platform != "win32" or config.get("skip"): 50 | return err 51 | 52 | if err and isinstance(err, str): 53 | print(err) 54 | 55 | input("\nPress Enter to close.") 56 | return 1 if err else 0 57 | 58 | 59 | def run_command(args: list[str]) -> int: 60 | """Run a given command with the given arguments.""" 61 | result = subprocess.run(args, stderr=sys.stderr, stdout=sys.stdout, check=False) 62 | return result.returncode 63 | 64 | 65 | if __name__ == "__main__": 66 | sys.exit(main()) 67 | --------------------------------------------------------------------------------
23 | The remaining request limit is not sufficient to fetch the required data. 24 | Please authenticate with a Github personal access token. 25 |
27 | Generate a personal access token! 28 | (No scope needs to be selected) 29 |