Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cc973b9f0d | |||
| 8a552f7993 | |||
| 93841bc85d | |||
| 9ba8847626 | |||
| 51b7328310 | |||
| fdc352596d | |||
| 89ba5cc985 | |||
| fdc79166a0 | |||
| b84487336b | |||
| e4ab103c4d | |||
| 3b6cf0252b | |||
| e908cd3085 | |||
| 6b23fdbd26 | |||
| ea6258ff19 | |||
| 5e54f0f83b | |||
| f00439a430 | |||
| 02ec230b3f | |||
| 867554b835 |
@@ -10,44 +10,22 @@ on:
|
|||||||
- "**"
|
- "**"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
GODOT_VERSION: 4.6
|
||||||
GAME_NAME: MovementTests
|
GAME_NAME: MovementTests
|
||||||
ITCHIO_USERNAME: Minimata
|
ITCHIO_USERNAME: Minimata
|
||||||
ITCHIO_GAMEID: MovementTests
|
ITCHIO_GAMEID: MovementTests
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Export:
|
Export:
|
||||||
runs-on: ubuntu-latest
|
runs-on: godot
|
||||||
env:
|
|
||||||
RUNNER_TOOL_CACHE: /toolcache # Runner Tool Cache
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install node, xvfb and curl
|
- name: Checkout with LFS
|
||||||
run: |
|
uses: https://git.game-dev.space/minimata/checkout-with-lfs.git@main
|
||||||
apt update && apt -y install curl nodejs xvfb
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
lfs: false
|
|
||||||
|
|
||||||
- name: Checkout LFS
|
|
||||||
run: |
|
|
||||||
UrlBase=$GITHUB_SERVER_URL; \
|
|
||||||
UrlLfsBase=$UrlBase/${{ gitea.repository }}.git/info/lfs/objects; \
|
|
||||||
Auth=`/usr/bin/git config --get --local http.$UrlBase/.extraheader`; \
|
|
||||||
/usr/bin/git config --local http.${UrlLfsBase}/batch.extraheader "$Auth"; \
|
|
||||||
/usr/bin/git config --local http.${UrlLfsBase}/.extraheader ''
|
|
||||||
|
|
||||||
git config --local lfs.transfer.maxretries 1
|
|
||||||
|
|
||||||
/usr/bin/git lfs fetch origin refs/remotes/origin/${{ gitea.ref_name }}
|
|
||||||
/usr/bin/git lfs checkout
|
|
||||||
/usr/bin/git add .
|
|
||||||
/usr/bin/git reset --hard
|
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
uses: godot-gdunit-labs/gdUnit4-action@v1
|
uses: godot-gdunit-labs/gdUnit4-action@v1
|
||||||
with:
|
with:
|
||||||
godot-version: '4.6.0'
|
godot-version: ${GODOT_VERSION}
|
||||||
godot-net: true
|
godot-net: true
|
||||||
godot-force-mono: true
|
godot-force-mono: true
|
||||||
dotnet-version: 'net9.0'
|
dotnet-version: 'net9.0'
|
||||||
@@ -56,7 +34,7 @@ jobs:
|
|||||||
timeout: 1
|
timeout: 1
|
||||||
publish-report: false
|
publish-report: false
|
||||||
upload-report: false
|
upload-report: false
|
||||||
|
|
||||||
- name: Upload test report
|
- name: Upload test report
|
||||||
uses: actions/upload-artifact@v3-node20
|
uses: actions/upload-artifact@v3-node20
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ jobs:
|
|||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
token: ${{ secrets.TOKEN }}
|
||||||
lfs: false
|
lfs: false
|
||||||
- name: Remove buggy pre-push hook
|
- name: Remove buggy pre-push hook
|
||||||
run: |
|
run: |
|
||||||
@@ -39,17 +40,11 @@ jobs:
|
|||||||
|
|
||||||
Test:
|
Test:
|
||||||
runs-on: godot
|
runs-on: godot
|
||||||
env:
|
# env:
|
||||||
RUNNER_TOOL_CACHE: /toolcache # Runner Tool Cache
|
# RUNNER_TOOL_CACHE: /toolcache # Runner Tool Cache
|
||||||
steps:
|
steps:
|
||||||
# - name: Install node, xvfb and curl
|
- name: Checkout with LFS
|
||||||
# run: |
|
uses: https://git.game-dev.space/minimata/checkout-with-lfs.git@main
|
||||||
# apt update && apt -y install curl nodejs xvfb
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
lfs: true
|
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
uses: godot-gdunit-labs/gdUnit4-action@v1
|
uses: godot-gdunit-labs/gdUnit4-action@v1
|
||||||
@@ -72,77 +67,50 @@ jobs:
|
|||||||
|
|
||||||
Export:
|
Export:
|
||||||
runs-on: godot
|
runs-on: godot
|
||||||
env:
|
needs:
|
||||||
RUNNER_TOOL_CACHE: /toolcache # Runner Tool Cache
|
- BumpTag
|
||||||
# needs:
|
|
||||||
# - BumpTag
|
|
||||||
# - Test # Wait for tests to finish
|
|
||||||
container:
|
|
||||||
image: barichello/godot-ci:mono-4.6
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# - name: Install node, curl and zip
|
- name: Checkout with LFS
|
||||||
# run: |
|
uses: https://git.game-dev.space/minimata/checkout-with-lfs.git@main
|
||||||
# apt update && apt -y install curl zip nodejs
|
|
||||||
|
|
||||||
- name: Checkout
|
- name: Setup Godot
|
||||||
uses: actions/checkout@v6
|
id: setup-godot
|
||||||
|
uses: https://git.game-dev.space/minimata/setup-godot.git@main
|
||||||
with:
|
with:
|
||||||
lfs: true
|
godot-version: '4.6'
|
||||||
|
dotnet-version: 'net9.0'
|
||||||
# - name: Checkout LFS
|
|
||||||
# run: |
|
- name: Remove GDUnit addon
|
||||||
# UrlBase=$GITHUB_SERVER_URL; \
|
|
||||||
# UrlLfsBase=$UrlBase/${{ gitea.repository }}.git/info/lfs/objects; \
|
|
||||||
# Auth=`/usr/bin/git config --get --local http.$UrlBase/.extraheader`; \
|
|
||||||
# /usr/bin/git config --local http.${UrlLfsBase}/batch.extraheader "$Auth"; \
|
|
||||||
# /usr/bin/git config --local http.${UrlLfsBase}/.extraheader ''
|
|
||||||
#
|
|
||||||
# git config --local lfs.transfer.maxretries 1
|
|
||||||
#
|
|
||||||
# /usr/bin/git lfs fetch origin refs/remotes/origin/${{ gitea.ref_name }}
|
|
||||||
# /usr/bin/git lfs checkout
|
|
||||||
# /usr/bin/git add .
|
|
||||||
# /usr/bin/git reset --hard
|
|
||||||
|
|
||||||
# - name: Checkout
|
|
||||||
# uses: actions/checkout@v6
|
|
||||||
# with:
|
|
||||||
# lfs: false
|
|
||||||
# persist-credentials: true
|
|
||||||
#
|
|
||||||
# - name: Checkout LFS
|
|
||||||
# run: |
|
|
||||||
# git lfs install --local
|
|
||||||
# AUTH=$(git config http.${{ gitea.server_url }}/.extraheader)
|
|
||||||
# AUTH_FILE=$(git config includeif.gitdir:/workspace/${{ gitea.repository }}/.git.path)
|
|
||||||
# git config -f $AUTH_FILE --unset http.${{ gitea.server_url }}/.extraheader
|
|
||||||
# git config -f $AUTH_FILE http.${{ gitea.server_url }}/${{ gitea.repository }}.git/info/lfs/objects/batch.extraheader "$AUTH"
|
|
||||||
# git lfs pull
|
|
||||||
|
|
||||||
# - name: Remove GDUnit addon folder because it breaks the build
|
|
||||||
# run: |
|
|
||||||
# rm -rf ${{ gitea.workspace }}/addons/gdunit4
|
|
||||||
|
|
||||||
- uses: actions/setup-dotnet@v5
|
|
||||||
with:
|
|
||||||
dotnet-version: '9.x'
|
|
||||||
|
|
||||||
- name: Import resources and build solution
|
|
||||||
run: |
|
run: |
|
||||||
godot --headless --editor --build-solutions --quit --import --path $PWD
|
rm -rf ${{ gitea.workspace }}/addons/gdUnit4
|
||||||
|
|
||||||
- name: Build Windows
|
- name: Build Windows
|
||||||
run: |
|
run: |
|
||||||
mkdir -v -p build/windows
|
mkdir -v -p build/windows
|
||||||
godot --headless --verbose --export-release "Windows Desktop" build/windows/${{ env.GAME_NAME }}.exe
|
${{ steps.setup-godot.outputs.godot_bin }} --headless --verbose --export-release "Windows Desktop" build/windows/${{ env.GAME_NAME }}.exe
|
||||||
zip -r Windows.zip build/windows
|
zip -r Windows.zip build/windows
|
||||||
- name: Upload to Itch
|
|
||||||
uses: KikimoraGames/itch-publish@v0.0.3
|
- name: Setup Butler
|
||||||
with:
|
shell: bash
|
||||||
butlerApiKey: ${{ secrets.BUTLER_TOKEN }}
|
env:
|
||||||
itchUsername: ${{ env.ITCHIO_USERNAME }}
|
BUTLER_API_KEY: ${{ secrets.BUTLER_TOKEN }}
|
||||||
itchGameId: ${{ env.ITCHIO_GAMEID }}
|
run: |
|
||||||
buildNumber: 0.1.0 # ${{ needs.BumpTag.outputs.tag_name }}
|
mkdir ./tools 2>/dev/null || true
|
||||||
gameData: Windows.zip
|
pushd tools
|
||||||
buildChannel: windows
|
curl -sSLfo ./butler.zip "https://broth.itch.zone/butler/linux-amd64/LATEST/archive/default"
|
||||||
|
unzip butler.zip
|
||||||
|
chmod +x ./butler
|
||||||
|
popd
|
||||||
|
./tools/butler -V
|
||||||
|
|
||||||
|
- name: Upload to itch.io
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
BUTLER_API_KEY: ${{ secrets.BUTLER_TOKEN }}
|
||||||
|
run: |
|
||||||
|
versionArgument="--userversion ${{ needs.BumpTag.outputs.tag_name }}"
|
||||||
|
./tools/butler push \
|
||||||
|
"Windows.zip" \
|
||||||
|
${{ env.ITCHIO_USERNAME }}/${{ env.ITCHIO_GAMEID }}:windows ${versionArgument}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ on:
|
|||||||
- "**"
|
- "**"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
GODOT_VERSION: 4.6
|
||||||
GAME_NAME: MovementTests
|
GAME_NAME: MovementTests
|
||||||
ITCHIO_USERNAME: Minimata
|
ITCHIO_USERNAME: Minimata
|
||||||
ITCHIO_GAMEID: MovementTests
|
ITCHIO_GAMEID: MovementTests
|
||||||
@@ -26,99 +27,90 @@ jobs:
|
|||||||
separator: '/'
|
separator: '/'
|
||||||
|
|
||||||
Release:
|
Release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: godot
|
||||||
if: ${{ contains(gitea.ref_name, 'release/') }}
|
if: ${{ contains(gitea.ref_name, 'release/') }}
|
||||||
needs: ReleaseName
|
needs: ReleaseName
|
||||||
env:
|
|
||||||
RUNNER_TOOL_CACHE: /toolcache # Runner Tool Cache
|
|
||||||
container:
|
|
||||||
image: barichello/godot-ci:mono-4.6
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install node, curl and zip
|
- name: Checkout with LFS
|
||||||
run: |
|
uses: https://git.game-dev.space/minimata/checkout-with-lfs.git@main
|
||||||
apt update && apt -y install curl zip nodejs
|
|
||||||
|
|
||||||
- name: Checkout
|
- name: Setup Godot
|
||||||
uses: actions/checkout@v3
|
id: setup-godot
|
||||||
|
uses: https://git.game-dev.space/minimata/setup-godot.git@main
|
||||||
with:
|
with:
|
||||||
lfs: false
|
godot-version: '4.6'
|
||||||
|
dotnet-version: 'net9.0'
|
||||||
- name: Checkout LFS
|
|
||||||
|
- name: Setup Butler
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
BUTLER_API_KEY: ${{ secrets.BUTLER_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
UrlBase=$GITHUB_SERVER_URL; \
|
mkdir ./tools 2>/dev/null || true
|
||||||
UrlLfsBase=$UrlBase/${{ gitea.repository }}.git/info/lfs/objects; \
|
pushd tools
|
||||||
Auth=`/usr/bin/git config --get --local http.$UrlBase/.extraheader`; \
|
curl -sSLfo ./butler.zip "https://broth.itch.zone/butler/linux-amd64/LATEST/archive/default"
|
||||||
/usr/bin/git config --local http.${UrlLfsBase}/batch.extraheader "$Auth"; \
|
unzip butler.zip
|
||||||
/usr/bin/git config --local http.${UrlLfsBase}/.extraheader ''
|
chmod +x ./butler
|
||||||
|
popd
|
||||||
git config --local lfs.transfer.maxretries 1
|
./tools/butler -V
|
||||||
|
|
||||||
/usr/bin/git lfs fetch origin refs/remotes/origin/${{ gitea.ref_name }}
|
|
||||||
/usr/bin/git lfs checkout
|
|
||||||
/usr/bin/git add .
|
|
||||||
/usr/bin/git reset --hard
|
|
||||||
|
|
||||||
- name: Import resources and build solution
|
|
||||||
run: |
|
|
||||||
godot --headless --editor --build-solutions --quit --import --path $PWD
|
|
||||||
|
|
||||||
- name: Build Windows
|
- name: Build Windows
|
||||||
run: |
|
run: |
|
||||||
mkdir -v -p build/windows
|
mkdir -v -p build/windows
|
||||||
godot --headless --verbose --build-solutions --export-release "Windows Desktop" build/windows/${{ env.GAME_NAME }}.exe
|
godot --headless --verbose --build-solutions --export-release "Windows Desktop" build/windows/${{ env.GAME_NAME }}.exe
|
||||||
zip -r Windows.zip build/windows
|
zip -r Windows.zip build/windows
|
||||||
- name: Upload to Itch
|
- name: Upload Windows to itch.io
|
||||||
uses: KikimoraGames/itch-publish@v0.0.3
|
shell: bash
|
||||||
with:
|
env:
|
||||||
butlerApiKey: ${{ secrets.BUTLER_TOKEN }}
|
BUTLER_API_KEY: ${{ secrets.BUTLER_TOKEN }}
|
||||||
itchUsername: ${{ env.ITCHIO_USERNAME }}
|
run: |
|
||||||
itchGameId: ${{ env.ITCHIO_GAMEID }}
|
versionArgument="--userversion ${{ needs.ReleaseName.outputs.release_name }}"
|
||||||
buildNumber: ${{ needs.ReleaseName.outputs.release_name }}
|
./tools/butler push \
|
||||||
gameData: Windows.zip
|
"Windows.zip" \
|
||||||
buildChannel: windows
|
${{ env.ITCHIO_USERNAME }}/${{ env.ITCHIO_GAMEID }}:windows ${versionArgument}
|
||||||
|
|
||||||
- name: Build Windows ARM
|
- name: Build Windows ARM
|
||||||
run: |
|
run: |
|
||||||
mkdir -v -p build/windowsArm
|
mkdir -v -p build/windowsArm
|
||||||
godot --headless --verbose --build-solutions --export-release "Windows ARM" build/windowsArm/${{ env.GAME_NAME }}.exe
|
godot --headless --verbose --build-solutions --export-release "Windows ARM" build/windowsArm/${{ env.GAME_NAME }}.exe
|
||||||
zip -r WindowsArm.zip build/windowsArm
|
zip -r WindowsArm.zip build/windowsArm
|
||||||
- name: Upload to Itch
|
- name: Upload Windows to itch.io
|
||||||
uses: KikimoraGames/itch-publish@v0.0.3
|
shell: bash
|
||||||
with:
|
env:
|
||||||
butlerApiKey: ${{ secrets.BUTLER_TOKEN }}
|
BUTLER_API_KEY: ${{ secrets.BUTLER_TOKEN }}
|
||||||
itchUsername: ${{ env.ITCHIO_USERNAME }}
|
run: |
|
||||||
itchGameId: ${{ env.ITCHIO_GAMEID }}
|
versionArgument="--userversion ${{ needs.ReleaseName.outputs.release_name }}"
|
||||||
buildNumber: ${{ needs.ReleaseName.outputs.release_name }}
|
./tools/butler push \
|
||||||
gameData: WindowsArm.zip
|
"WindowsArm.zip" \
|
||||||
buildChannel: windows-arm
|
${{ env.ITCHIO_USERNAME }}/${{ env.ITCHIO_GAMEID }}:windows-arm ${versionArgument}
|
||||||
|
|
||||||
- name: Linux Build
|
- name: Linux Build
|
||||||
run: |
|
run: |
|
||||||
mkdir -v -p build/linux
|
mkdir -v -p build/linux
|
||||||
godot --headless --verbose --export-release "Linux/X11" build/linux/${{ env.GAME_NAME }}.x86_64
|
godot --headless --verbose --export-release "Linux/X11" build/linux/${{ env.GAME_NAME }}.x86_64
|
||||||
zip -r Linux.zip build/linux
|
zip -r Linux.zip build/linux
|
||||||
- name: Upload to Itch
|
- name: Upload Windows to itch.io
|
||||||
uses: KikimoraGames/itch-publish@v0.0.3
|
shell: bash
|
||||||
with:
|
env:
|
||||||
butlerApiKey: ${{ secrets.BUTLER_TOKEN }}
|
BUTLER_API_KEY: ${{ secrets.BUTLER_TOKEN }}
|
||||||
itchUsername: ${{ env.ITCHIO_USERNAME }}
|
run: |
|
||||||
itchGameId: ${{ env.ITCHIO_GAMEID }}
|
versionArgument="--userversion ${{ needs.ReleaseName.outputs.release_name }}"
|
||||||
buildNumber: ${{ needs.ReleaseName.outputs.release_name }}
|
./tools/butler push \
|
||||||
gameData: Linux.zip
|
"Linux.zip" \
|
||||||
buildChannel: linux
|
${{ env.ITCHIO_USERNAME }}/${{ env.ITCHIO_GAMEID }}:linux ${versionArgument}
|
||||||
|
|
||||||
- name: Mac Build
|
- name: Mac Build
|
||||||
run: |
|
run: |
|
||||||
mkdir -v -p build/mac
|
mkdir -v -p build/mac
|
||||||
godot --headless --verbose --export-release "macOS" build/mac/${{ env.GAME_NAME }}.zip
|
godot --headless --verbose --export-release "macOS" build/mac/${{ env.GAME_NAME }}.zip
|
||||||
zip -r Mac.zip build/mac
|
zip -r Mac.zip build/mac
|
||||||
- name: Upload to Itch
|
- name: Upload Windows to itch.io
|
||||||
uses: KikimoraGames/itch-publish@v0.0.3
|
shell: bash
|
||||||
with:
|
env:
|
||||||
butlerApiKey: ${{ secrets.BUTLER_TOKEN }}
|
BUTLER_API_KEY: ${{ secrets.BUTLER_TOKEN }}
|
||||||
itchUsername: ${{ env.ITCHIO_USERNAME }}
|
run: |
|
||||||
itchGameId: ${{ env.ITCHIO_GAMEID }}
|
versionArgument="--userversion ${{ needs.ReleaseName.outputs.release_name }}"
|
||||||
buildNumber: ${{ needs.ReleaseName.outputs.release_name }}
|
./tools/butler push \
|
||||||
gameData: Mac.zip
|
"Mac.zip" \
|
||||||
buildChannel: mac
|
${{ env.ITCHIO_USERNAME }}/${{ env.ITCHIO_GAMEID }}:mac ${versionArgument}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
[GlobalClass, Icon("res://assets/ui/IconGodotNode/control/icon_heart.png")]
|
[GlobalClass, Icon("res://assets/ui/IconGodotNode/node_3D/icon_heart.png")]
|
||||||
public partial class CHealthbar : Sprite3D
|
public partial class CHealthbar : Sprite3D
|
||||||
{
|
{
|
||||||
private Healthbar _healthbar;
|
private Healthbar _healthbar;
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ metadata/_custom_type_script = "uid://baiapod3csndf"
|
|||||||
|
|
||||||
[node name="Main" unique_id=1551129541 instance=ExtResource("1_w4y6q")]
|
[node name="Main" unique_id=1551129541 instance=ExtResource("1_w4y6q")]
|
||||||
|
|
||||||
[node name="BackgroundMusicPlayer" parent="." index="0"]
|
[node name="BackgroundMusicPlayer" parent="." index="0" unique_id=879496303]
|
||||||
autoplay = false
|
autoplay = false
|
||||||
|
|
||||||
[node name="Player" parent="." index="5"]
|
[node name="Player" parent="." index="5" unique_id=1309399929]
|
||||||
transform = Transform3D(0.99999994, 0, 0, 0, 1, 0, 0, 0, 0.99999994, 2, 1.5, 9.5)
|
transform = Transform3D(0.99999994, 0, 0, 0, 1, 0, 0, 0, 0.99999994, 2, 1.5, 9.5)
|
||||||
|
|
||||||
[node name="Greybox" type="CSGCombiner3D" parent="." index="7" unique_id=646927976]
|
[node name="Greybox" type="CSGCombiner3D" parent="." index="7" unique_id=646927976]
|
||||||
@@ -125,18 +125,19 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10, 7, -16)
|
|||||||
Target = NodePath("../Player")
|
Target = NodePath("../Player")
|
||||||
RMovement = SubResource("Resource_xixm3")
|
RMovement = SubResource("Resource_xixm3")
|
||||||
|
|
||||||
[node name="GroundedSpawner" parent="." index="14" unique_id=557145011 instance=ExtResource("7_ba7rw")]
|
[node name="GroundedSpawner" parent="." index="14" unique_id=557145011 node_paths=PackedStringArray("Target") instance=ExtResource("7_ba7rw")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 12, 2.5, -15)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5, 2.5, -15)
|
||||||
EnemyToSpawn = ExtResource("4_5mjy0")
|
EnemyToSpawn = ExtResource("4_5mjy0")
|
||||||
MovementInputs = ExtResource("8_cdhvi")
|
MovementInputs = ExtResource("8_cdhvi")
|
||||||
HealthInputs = SubResource("Resource_epn1o")
|
HealthInputs = SubResource("Resource_epn1o")
|
||||||
DamageInputs = ExtResource("10_xyaoo")
|
DamageInputs = ExtResource("10_xyaoo")
|
||||||
|
Target = NodePath("../Player")
|
||||||
IsActiveOnStart = false
|
IsActiveOnStart = false
|
||||||
|
|
||||||
[node name="FlyingSpawner" parent="." index="15" unique_id=974076606 instance=ExtResource("7_ba7rw")]
|
[node name="FlyingSpawner" parent="." index="15" unique_id=974076606 node_paths=PackedStringArray("Target") instance=ExtResource("7_ba7rw")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 18, 11, -14)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 18, 11, -14)
|
||||||
EnemyToSpawn = ExtResource("6_xuqf0")
|
EnemyToSpawn = ExtResource("6_xuqf0")
|
||||||
MovementInputs = ExtResource("11_yug0s")
|
MovementInputs = ExtResource("11_yug0s")
|
||||||
HealthInputs = ExtResource("12_qgrw7")
|
HealthInputs = ExtResource("12_qgrw7")
|
||||||
DamageInputs = ExtResource("13_qulje")
|
DamageInputs = ExtResource("13_qulje")
|
||||||
IsActiveOnStart = false
|
Target = NodePath("../Player")
|
||||||
|
|||||||
@@ -22,21 +22,14 @@ public partial class Spawner : Node3D
|
|||||||
[Export]
|
[Export]
|
||||||
public bool IsActiveOnStart { get; set; } = true;
|
public bool IsActiveOnStart { get; set; } = true;
|
||||||
|
|
||||||
private float _spawnTimer;
|
private Timer _timer;
|
||||||
private bool _isActive;
|
|
||||||
|
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
_isActive = IsActiveOnStart;
|
_timer = GetNode<Timer>("Timer");
|
||||||
_spawnTimer = SpawnInterval;
|
_timer.WaitTime = SpawnInterval;
|
||||||
}
|
_timer.Timeout += Spawn;
|
||||||
|
if (IsActiveOnStart) StartSpawning();
|
||||||
public override void _Process(double delta)
|
|
||||||
{
|
|
||||||
if (!_isActive) return;
|
|
||||||
|
|
||||||
_spawnTimer -= (float) delta;
|
|
||||||
if (_spawnTimer <= 0) Spawn();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Spawn()
|
public void Spawn()
|
||||||
@@ -44,27 +37,24 @@ public partial class Spawner : Node3D
|
|||||||
if (EnemyToSpawn == null || !EnemyToSpawn.CanInstantiate()) return;
|
if (EnemyToSpawn == null || !EnemyToSpawn.CanInstantiate()) return;
|
||||||
|
|
||||||
if (EnemyToSpawn.Instantiate() is not Enemy spawnedInstance) return;
|
if (EnemyToSpawn.Instantiate() is not Enemy spawnedInstance) return;
|
||||||
|
|
||||||
|
GetTree().GetCurrentScene().AddChild(spawnedInstance);
|
||||||
|
spawnedInstance.GlobalPosition = GlobalPosition;
|
||||||
|
|
||||||
spawnedInstance.Target = Target;
|
spawnedInstance.Target = Target;
|
||||||
spawnedInstance.RMovement = MovementInputs;
|
spawnedInstance.RMovement = MovementInputs;
|
||||||
spawnedInstance.RDamage = DamageInputs;
|
spawnedInstance.RDamage = DamageInputs;
|
||||||
spawnedInstance.RHealth = HealthInputs;
|
spawnedInstance.RHealth = HealthInputs;
|
||||||
spawnedInstance.Initialize();
|
spawnedInstance.Initialize();
|
||||||
|
|
||||||
GetTree().GetCurrentScene().AddChild(spawnedInstance);
|
|
||||||
spawnedInstance.GlobalPosition = GlobalPosition;
|
|
||||||
|
|
||||||
_spawnTimer = SpawnInterval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StartSpawning()
|
public void StartSpawning()
|
||||||
{
|
{
|
||||||
_isActive = true;
|
_timer.Start();
|
||||||
_spawnTimer = SpawnInterval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StopSpawning()
|
public void StopSpawning()
|
||||||
{
|
{
|
||||||
_isActive = false;
|
_timer.Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,3 +6,5 @@
|
|||||||
script = ExtResource("1_2otbo")
|
script = ExtResource("1_2otbo")
|
||||||
|
|
||||||
[node name="Marker3D" type="Marker3D" parent="." unique_id=610854505]
|
[node name="Marker3D" type="Marker3D" parent="." unique_id=610854505]
|
||||||
|
|
||||||
|
[node name="Timer" type="Timer" parent="." unique_id=1842357493]
|
||||||
|
|||||||
Reference in New Issue
Block a user