Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
outfrost committed Nov 13, 2020
0 parents commit ac03020
Show file tree
Hide file tree
Showing 31 changed files with 1,308 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build and release

on:
push:
tags:
- 'v[0-9]+.*'

jobs:
export_release_project:
# Always use ubuntu-latest for this action
runs-on: ubuntu-latest
name: Export and release project
steps:

- name: Checkout
uses: actions/[email protected]
# Ensure that we get the entire project history
with:
fetch-depth: 0

# Job creates release under the same version as the tag
- name: Get version from tag
id: tag_version
run: |
echo ::set-output name=TAG_VERSION::${GITHUB_REF#refs/tags/v}
- name: Export and release
uses: firebelley/[email protected]
with:
godot_executable_download_url: https://downloads.tuxfamily.org/godotengine/3.2.3/Godot_v3.2.3-stable_linux_headless.64.zip
godot_export_templates_download_url: https://downloads.tuxfamily.org/godotengine/3.2.3/Godot_v3.2.3-stable_export_templates.tpz
relative_project_path: ./
create_release: true
generate_release_notes: true
base_version: ${{ steps.tag_version.outputs.TAG_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build

on:
pull_request:
branches:
- main

jobs:
export_project:
# Always use ubuntu-latest for this action
runs-on: ubuntu-latest
name: Export project
steps:

- name: Checkout
uses: actions/[email protected]

- name: Export
uses: firebelley/[email protected]
with:
godot_executable_download_url: https://downloads.tuxfamily.org/godotengine/3.2.3/Godot_v3.2.3-stable_linux_headless.64.zip
godot_export_templates_download_url: https://downloads.tuxfamily.org/godotengine/3.2.3/Godot_v3.2.3-stable_export_templates.tpz
relative_project_path: ./
create_release: false
use_preset_export_path: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Linux X11 amd64 build
uses: actions/upload-artifact@v2
with:
name: Linux-X11-amd64
path: build/linux_amd64/Linux-X11-amd64/
if-no-files-found: error

- name: Upload macOS build
uses: actions/upload-artifact@v2
with:
name: macOS
path: build/macos/macOS/
if-no-files-found: error

- name: Upload Windows amd64 build
uses: actions/upload-artifact@v2
with:
name: Windows-amd64
path: build/windows_amd64/Windows-amd64/
if-no-files-found: error

- name: Upload Windows i686 build
uses: actions/upload-artifact@v2
with:
name: Windows-i686
path: build/windows_i686/Windows-i686/
if-no-files-found: error
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Build
/build/

# Debug script
/[Dd]ebug.gd

# Godot Engine generated files
.import/
export.cfg

# Mono
.mono/
/Properties/
*.csproj
*.sln
mono_crash.*

# GNU nano
*.swp

# VSCode
.vscode/
7 changes: 7 additions & 0 deletions default_env.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[gd_resource type="Environment" load_steps=2 format=2]

[sub_resource type="ProceduralSky" id=1]

[resource]
background_mode = 2
background_sky = SubResource( 1 )
142 changes: 142 additions & 0 deletions export_presets.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
[preset.0]

name="Linux-X11-amd64"
platform="Linux/X11"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter="build/*"
export_path="build/linux_amd64/game.x86_64"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""

[preset.0.options]

texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
binary_format/64_bits=true
binary_format/embed_pck=false
custom_template/release=""
custom_template/debug=""

[preset.1]

name="Windows-amd64"
platform="Windows Desktop"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter="build/*"
export_path="build/windows_amd64/game.exe"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""

[preset.1.options]

texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
binary_format/64_bits=true
binary_format/embed_pck=false
custom_template/release=""
custom_template/debug=""
codesign/enable=false
codesign/identity=""
codesign/password=""
codesign/timestamp=true
codesign/timestamp_server_url=""
codesign/digest_algorithm=1
codesign/description=""
codesign/custom_options=PoolStringArray( )
application/icon=""
application/file_version=""
application/product_version=""
application/company_name=""
application/product_name=""
application/file_description=""
application/copyright=""
application/trademarks=""

[preset.2]

name="Windows-i686"
platform="Windows Desktop"
runnable=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter="build/*"
export_path="build/windows_i686/game.exe"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""

[preset.2.options]

texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
binary_format/64_bits=false
binary_format/embed_pck=false
custom_template/release=""
custom_template/debug=""
codesign/enable=false
codesign/identity=""
codesign/password=""
codesign/timestamp=true
codesign/timestamp_server_url=""
codesign/digest_algorithm=1
codesign/description=""
codesign/custom_options=PoolStringArray( )
application/icon=""
application/file_version=""
application/product_version=""
application/company_name=""
application/product_name=""
application/file_description=""
application/copyright=""
application/trademarks=""

[preset.3]

name="macOS"
platform="Mac OSX"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="build/macos/game.zip"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""

[preset.3.options]

custom_template/debug=""
custom_template/release=""
application/name=""
application/info="Made with Godot Engine"
application/icon=""
application/identifier=""
application/signature=""
application/short_version="1.0"
application/version="1.0"
application/copyright=""
display/high_res=false
privacy/camera_usage_description=""
privacy/microphone_usage_description=""
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
25 changes: 25 additions & 0 deletions game/DebugLabel.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2020 Outfrost
# This work is free software. It comes without any warranty, to the extent
# permitted by applicable law. You can redistribute it and/or modify it under
# the terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See the LICENSE.WTFPL file for more details.

class_name DebugLabel
extends Label

var buffer: String = ""

func _ready():
text = ""

func _process(_delta):
text = buffer
buffer = ""

func display_impl(s: String):
buffer += s + "\n"

static func display(ref, s):
var label = ref.get_tree().root.find_node("DebugLabel", true, false) as DebugLabel
if label:
label.display_impl(s)
28 changes: 28 additions & 0 deletions game/Game.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
class_name Game
extends Node

onready var main_menu: Control = $UI/MainMenu
onready var transition_screen: TransitionScreen = $UI/TransitionScreen

var debug: Reference

func _ready() -> void:
if OS.has_feature("debug"):
var debug_script = load("res://debug.gd")
if debug_script:
debug = debug_script.new(self)
debug.startup()

main_menu.connect("start_game", self, "on_start_game")

func _process(delta: float) -> void:
DebugLabel.display(self, "fps %d" % Performance.get_monitor(Performance.TIME_FPS))

if Input.is_action_just_pressed("menu"):
back_to_menu()

func on_start_game() -> void:
main_menu.hide()

func back_to_menu() -> void:
main_menu.show()
35 changes: 35 additions & 0 deletions game/Game.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[gd_scene load_steps=6 format=2]

[ext_resource path="res://game/ui-theme/ui_theme.tres" type="Theme" id=1]
[ext_resource path="res://game/DebugLabel.gd" type="Script" id=2]
[ext_resource path="res://game/menu/MainMenu.tscn" type="PackedScene" id=3]
[ext_resource path="res://game/loading/TransitionScreen.tscn" type="PackedScene" id=4]
[ext_resource path="res://game/Game.gd" type="Script" id=5]

[node name="Game" type="Node"]
script = ExtResource( 5 )

[node name="MusicPlayer" type="AudioStreamPlayer" parent="."]

[node name="UI" type="Control" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 1
theme = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="MainMenu" parent="UI" instance=ExtResource( 3 )]

[node name="TransitionScreen" parent="UI" instance=ExtResource( 4 )]
visible = false

[node name="DebugLabel" type="Label" parent="."]
margin_right = 75.0
margin_bottom = 14.0
text = "DebugLabel"
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
29 changes: 29 additions & 0 deletions game/GroupMessenger.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2020 Outfrost
# This work is free software. It comes without any warranty, to the extent
# permitted by applicable law. You can redistribute it and/or modify it under
# the terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See the LICENSE.WTFPL file for more details.

class_name GroupMessenger

var message: String
var groups: Array = []
var owner: Node

func _init(owner: Node, message: String, groups: Array = []):
self.owner = owner
self.message = message
self.groups = groups

func add_group(group: String):
groups.push_back(group)

func remove_group(group: String):
var i = groups.find(group)
if i != -1:
groups.remove(i)

func dispatch(args: Array = []):
var tree = owner.get_tree()
for group in groups:
tree.call_group(group, "on_" + message, args)
Loading

0 comments on commit ac03020

Please sign in to comment.