Compare commits

..

1 commit

Author SHA1 Message Date
khushmmehta
a26e37d301 Audio And Stuff 2023-04-12 12:56:44 +05:30
21 changed files with 503 additions and 3 deletions

View file

@ -0,0 +1,99 @@
name: "godot-ci export"
on:
push:
branches:
- stable
jobs:
export_game:
runs-on: ubuntu-latest
name: Export Game
steps:
- name: Checkout
uses: https://github.com/actions/checkout@v3.3.0
- name: Install Packages
id: wine_install
run: |
apt update -y && apt upgrade -y
apt install -y wine64 nodejs p7zip-full ca-certificates tree jq curl zip
echo "WINE_PATH=$(which wine64)" >> $GITHUB_OUTPUT
- name: Download Godot build-libs
run: |
mkdir -p /root/.local/share/godot/
wget -nv https://github.com/godotengine/godot/releases/download/4.0.2-stable/Godot_v4.0.2-stable_linux.x86_64.zip -O "/root/.local/share/godot/godot.zip"
wget -nv https://github.com/godotengine/godot/releases/download/4.0.2-stable/Godot_v4.0.2-stable_export_templates.tpz -O /root/.local/share/godot/godot_templates.tpz
- name: Setup Godot build-libs
run: |
7z x /root/.local/share/godot/godot.zip -o/root/.local/share/godot/godot_executable -y
chmod +x /root/.local/share/godot/godot_executable/Godot_v4.0.2-stable_linux.x86_64
unzip /root/.local/share/godot/godot_templates.tpz -d /root/.local/share/godot
mv /root/.local/share/godot/templates /root/.local/share/godot/4.0.2.stable
mkdir -p /root/.local/share/godot/export_templates
mv /root/.local/share/godot/4.0.2.stable /root/.local/share/godot/export_templates
/root/.local/share/godot/godot_executable/Godot_v4.0.2-stable_linux.x86_64 --version
- name: Export for Web
run: |
mkdir -p ./builds/web/
/root/.local/share/godot/godot_executable/Godot_v4.0.2-stable_linux.x86_64 /var/lib/actions/project.godot -v --headless --export-release "Web" ./builds/web/Game.html
- name: Package for Web
run: |
cd builds
tar -czvf web.zip -C web/ .
- name: Export for Linux
run: |
mkdir -p ./builds/linux/
/root/.local/share/godot/godot_executable/Godot_v4.0.2-stable_linux.x86_64 /var/lib/actions/project.godot -v --headless --export-release "Linux/X11" ./builds/linux/Game.x86_64
- name: Package for Linux
run: |
cd builds
tar -czvf linux.tar.gz -C linux/ .
- name: Export for Windows
run: |
mkdir -p ./builds/windows/
/root/.local/share/godot/godot_executable/Godot_v4.0.2-stable_linux.x86_64 /var/lib/actions/project.godot -v --headless --export-release "Windows Desktop" ./builds/windows/Game.exe
- name: Package for Windows
run: |
cd builds
cd windows; zip -r ../windows.zip *
cd ..
- name: Create Release
run: |
echo "Getting last Release Tag"
VERSION=$(curl -X 'GET' 'https://git.euph.dev/api/v1/repos/${{ github.repository }}/releases?page=1&limit=1' -H 'accept: application/json' -H 'Authorization: token ${{ secrets.RELEASE_TOKEN }}' )
echo $VERSION | jq -r '.[0].tag_name'
VERSION=$(echo $VERSION | jq -r '.[0].tag_name' | awk -F. -v OFS=. '{$NF += 1 ; print}')
echo "Generate new Release with tag: $VERSION"
ID=$(curl -X 'POST' \
'https://git.euph.dev/api/v1/repos/${{ github.repository }}/releases' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: token ${{ secrets.RELEASE_TOKEN }}' \
-d "{
\"body\": \"Automated Build\",
\"draft\": true,
\"name\": \"Automated Release $VERSION\",
\"prerelease\": true,
\"tag_name\": \"$VERSION\"
}")
ID=$(echo $ID | jq -r '.id')
echo $ID Upload Web
curl -X 'POST' \
"https://git.euph.dev/api/v1/repos/${{ github.repository }}/releases/$ID/assets?name=Web.zip" \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-H 'Authorization: token ${{ secrets.RELEASE_TOKEN }}' \
-F 'attachment=@./builds/web.zip;type=application/gzip'
echo $ID Upload Linux
curl -X 'POST' \
"https://git.euph.dev/api/v1/repos/${{ github.repository }}/releases/$ID/assets?name=Linux.tar.gz" \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-H 'Authorization: token ${{ secrets.RELEASE_TOKEN }}' \
-F 'attachment=@./builds/linux.tar.gz;type=application/gzip'
echo $ID Upload Windows
curl -X 'POST' \
"https://git.euph.dev/api/v1/repos/${{ github.repository }}/releases/$ID/assets?name=Windows.zip" \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-H 'Authorization: token ${{ secrets.RELEASE_TOKEN }}' \
-F 'attachment=@./builds/windows.zip;type=application/gzip'

Binary file not shown.

View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://u3g25xyorgbr"
path="res://.godot/imported/Evil Bunny.wav-55d1f7efb7dcde9eb6a304b8c08e67e6.sample"
[deps]
source_file="res://Assets/SFX/Bunnies/Evil Bunny.wav"
dest_files=["res://.godot/imported/Evil Bunny.wav-55d1f7efb7dcde9eb6a304b8c08e67e6.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

Binary file not shown.

View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://c1tvxquysrs50"
path="res://.godot/imported/Footstep Variation 1.wav-23ef30b06d2ed0a57ea7ab93019b0ec9.sample"
[deps]
source_file="res://Assets/SFX/Jesus/Footsteps/Footstep Variation 1.wav"
dest_files=["res://.godot/imported/Footstep Variation 1.wav-23ef30b06d2ed0a57ea7ab93019b0ec9.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

Binary file not shown.

View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://bwgri4cpbrmjk"
path="res://.godot/imported/Footstep Variation 2.wav-2a7a23042ee87e2b16ebe21f93bcab40.sample"
[deps]
source_file="res://Assets/SFX/Jesus/Footsteps/Footstep Variation 2.wav"
dest_files=["res://.godot/imported/Footstep Variation 2.wav-2a7a23042ee87e2b16ebe21f93bcab40.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

Binary file not shown.

View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://dnkv3mvbiyppb"
path="res://.godot/imported/Footstep Variation 3.wav-631e7c0b24f25d0d8a725b8163b9732a.sample"
[deps]
source_file="res://Assets/SFX/Jesus/Footsteps/Footstep Variation 3.wav"
dest_files=["res://.godot/imported/Footstep Variation 3.wav-631e7c0b24f25d0d8a725b8163b9732a.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

Binary file not shown.

View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://dornq2kwau6bg"
path="res://.godot/imported/Throw Variation 1.wav-cb6e200c1a7508bd3b1eaae71204fc57.sample"
[deps]
source_file="res://Assets/SFX/Jesus/Projectile/Throw Variation 1.wav"
dest_files=["res://.godot/imported/Throw Variation 1.wav-cb6e200c1a7508bd3b1eaae71204fc57.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

Binary file not shown.

View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://b2pd7efb2r7g5"
path="res://.godot/imported/Throw Variation 2.wav-29a6debbe12d45d7a1d5ed60acdd2d8f.sample"
[deps]
source_file="res://Assets/SFX/Jesus/Projectile/Throw Variation 2.wav"
dest_files=["res://.godot/imported/Throw Variation 2.wav-29a6debbe12d45d7a1d5ed60acdd2d8f.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

Binary file not shown.

View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://cqxnclejfbmvb"
path="res://.godot/imported/Throw Variation 3.wav-6149b642d398d05b4c6ebfab8846c3e5.sample"
[deps]
source_file="res://Assets/SFX/Jesus/Projectile/Throw Variation 3.wav"
dest_files=["res://.godot/imported/Throw Variation 3.wav-6149b642d398d05b4c6ebfab8846c3e5.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

View file

@ -41,7 +41,7 @@
[ext_resource type="StyleBox" uid="uid://0jfr1uwuog0s" path="res://Assets/UI/Slider/v/background.tres" id="39_dl1e4"] [ext_resource type="StyleBox" uid="uid://0jfr1uwuog0s" path="res://Assets/UI/Slider/v/background.tres" id="39_dl1e4"]
[ext_resource type="FontFile" uid="uid://dqdeftjkwxe64" path="res://Assets/Fonts/Dogica/dogicapixel.ttf" id="40_bmcvq"] [ext_resource type="FontFile" uid="uid://dqdeftjkwxe64" path="res://Assets/Fonts/Dogica/dogicapixel.ttf" id="40_bmcvq"]
[sub_resource type="Image" id="Image_fjlcl"] [sub_resource type="Image" id="Image_48lf4"]
data = { data = {
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0), "data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 64, 255, 255, 255, 64, 255, 255, 255, 0),
"format": "RGBA8", "format": "RGBA8",
@ -51,7 +51,7 @@ data = {
} }
[sub_resource type="ImageTexture" id="ImageTexture_g5bup"] [sub_resource type="ImageTexture" id="ImageTexture_g5bup"]
image = SubResource("Image_fjlcl") image = SubResource("Image_48lf4")
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_sj7h5"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_sj7h5"]

View file

@ -1,7 +1,10 @@
[gd_scene load_steps=4 format=3 uid="uid://csxh42o8twxwn"] [gd_scene load_steps=7 format=3 uid="uid://csxh42o8twxwn"]
[ext_resource type="Script" path="res://Scripts/WeaponSystem/Projectile.gd" id="1_os652"] [ext_resource type="Script" path="res://Scripts/WeaponSystem/Projectile.gd" id="1_os652"]
[ext_resource type="Texture2D" uid="uid://dlxjdb0tchrps" path="res://Assets/Sprites/crucefix.png" id="2_ibs3t"] [ext_resource type="Texture2D" uid="uid://dlxjdb0tchrps" path="res://Assets/Sprites/crucefix.png" id="2_ibs3t"]
[ext_resource type="AudioStream" uid="uid://dornq2kwau6bg" path="res://Assets/SFX/Jesus/Projectile/Throw Variation 1.wav" id="4_11fc8"]
[ext_resource type="AudioStream" uid="uid://b2pd7efb2r7g5" path="res://Assets/SFX/Jesus/Projectile/Throw Variation 2.wav" id="5_njike"]
[ext_resource type="AudioStream" uid="uid://cqxnclejfbmvb" path="res://Assets/SFX/Jesus/Projectile/Throw Variation 3.wav" id="6_ky3xa"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_ki5cp"] [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_ki5cp"]
radius = 8.57143 radius = 8.57143
@ -11,6 +14,7 @@ height = 22.8571
collision_layer = 8 collision_layer = 8
collision_mask = 5 collision_mask = 5
script = ExtResource("1_os652") script = ExtResource("1_os652")
audio_pool = [NodePath("ProjectileAudioPool/Audio1"), NodePath("ProjectileAudioPool/Audio2"), NodePath("ProjectileAudioPool/Audio3")]
map_collision_layer = 1 map_collision_layer = 1
bunny_collision_layer = 4 bunny_collision_layer = 4
@ -20,4 +24,15 @@ texture = ExtResource("2_ibs3t")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."] [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CapsuleShape2D_ki5cp") shape = SubResource("CapsuleShape2D_ki5cp")
[node name="ProjectileAudioPool" type="Node" parent="."]
[node name="Audio1" type="AudioStreamPlayer" parent="ProjectileAudioPool"]
stream = ExtResource("4_11fc8")
[node name="Audio2" type="AudioStreamPlayer" parent="ProjectileAudioPool"]
stream = ExtResource("5_njike")
[node name="Audio3" type="AudioStreamPlayer" parent="ProjectileAudioPool"]
stream = ExtResource("6_ky3xa")
[connection signal="body_entered" from="." to="." method="_on_collision"] [connection signal="body_entered" from="." to="." method="_on_collision"]

193
Scenes/GameSFX.tscn Normal file

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,22 @@
extends Node
@export var player_audio_pool = []
var random_audio : AudioStreamPlayer
func _ready():
pass
func _process(delta):
random_audio_setter()
if !self.get_parent().velocity.is_zero_approx() && !random_audio.is_playing():
random_audio.play()
pass
pass
func random_audio_setter():
random_audio = get_node(player_audio_pool[randi_range(0, 2)])
random_audio.set_max_polyphony(10000)
pass

View file

@ -2,6 +2,7 @@ extends Area2D
@export var speed : float = 80.0 @export var speed : float = 80.0
@export var damage : int = 1 @export var damage : int = 1
@export var audio_pool = []
@export_flags_2d_physics var map_collision_layer : int @export_flags_2d_physics var map_collision_layer : int
@export_flags_2d_physics var bunny_collision_layer : int @export_flags_2d_physics var bunny_collision_layer : int

View file

@ -19,10 +19,12 @@ func rotate_to_pointer():
func spawn_projectile(pos : Vector2, dir : float, speed: float, damage : int): func spawn_projectile(pos : Vector2, dir : float, speed: float, damage : int):
var projectile = projectilePrefab.instantiate() var projectile = projectilePrefab.instantiate()
var projectile_audio = projectile.get_node(projectile.audio_pool[randi_range(0, 2)])
projectile.global_position = pos projectile.global_position = pos
projectile.dir = dir projectile.dir = dir
projectile.speed = speed projectile.speed = speed
projectile.damage = damage projectile.damage = damage
projectile.is_displayed_folded() projectile.is_displayed_folded()
get_tree().root.add_child(projectile) get_tree().root.add_child(projectile)
projectile_audio.play()
pass pass