spawner et export
This commit is contained in:
parent
b2766cf43c
commit
0ceb6ebcd4
24
GPE/PirateSpawner/pirate_spawner.gd
Normal file
24
GPE/PirateSpawner/pirate_spawner.gd
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
extends Node2D
|
||||||
|
|
||||||
|
@export var scene_to_spawn : PackedScene
|
||||||
|
|
||||||
|
var spawned_scene
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready() -> void:
|
||||||
|
$SpawnTimer.timeout.connect(_on_spawn_timeout)
|
||||||
|
$Sprite2D.hide()
|
||||||
|
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(_delta: float) -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func _on_spawn_timeout():
|
||||||
|
if spawned_scene:
|
||||||
|
return
|
||||||
|
|
||||||
|
spawned_scene = scene_to_spawn.instantiate()
|
||||||
|
|
||||||
|
spawned_scene.position = position
|
||||||
|
get_tree().root.add_child(spawned_scene)
|
||||||
1
GPE/PirateSpawner/pirate_spawner.gd.uid
Normal file
1
GPE/PirateSpawner/pirate_spawner.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://dsealch4vp022
|
||||||
15
GPE/PirateSpawner/pirate_spawner.tscn
Normal file
15
GPE/PirateSpawner/pirate_spawner.tscn
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
[gd_scene load_steps=4 format=3 uid="uid://bjrtrtnjdk0nv"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://dsealch4vp022" path="res://GPE/PirateSpawner/pirate_spawner.gd" id="1_2v5w2"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bu2uf2i2gaybu" path="res://Characters/Ships/cannonLoose.png" id="2_c4iew"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://mh40qx1bhgs5" path="res://Characters/pirate.tscn" id="2_cwwcd"]
|
||||||
|
|
||||||
|
[node name="PirateSpawner" type="Node2D"]
|
||||||
|
script = ExtResource("1_2v5w2")
|
||||||
|
scene_to_spawn = ExtResource("2_cwwcd")
|
||||||
|
|
||||||
|
[node name="SpawnTimer" type="Timer" parent="."]
|
||||||
|
autostart = true
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
|
texture = ExtResource("2_c4iew")
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
[gd_scene load_steps=5 format=4 uid="uid://bmj5igs8dvepl"]
|
[gd_scene load_steps=6 format=4 uid="uid://bmj5igs8dvepl"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://c6rnvbhbn7ida" path="res://Maps/Tiles/Tiles.tscn" id="1_yygpi"]
|
[ext_resource type="PackedScene" uid="uid://c6rnvbhbn7ida" path="res://Maps/Tiles/Tiles.tscn" id="1_yygpi"]
|
||||||
[ext_resource type="PackedScene" uid="uid://d01b7h5474v44" path="res://Characters/player.tscn" id="2_4a06y"]
|
[ext_resource type="PackedScene" uid="uid://d01b7h5474v44" path="res://Characters/player.tscn" id="2_4a06y"]
|
||||||
[ext_resource type="TileSet" uid="uid://cy866rju3ffv3" path="res://Maps/Tiles/terrain_tileset.tres" id="2_ddepd"]
|
[ext_resource type="TileSet" uid="uid://cy866rju3ffv3" path="res://Maps/Tiles/terrain_tileset.tres" id="2_ddepd"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bjrtrtnjdk0nv" path="res://GPE/PirateSpawner/pirate_spawner.tscn" id="4_ddepd"]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_dkl6u"]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_dkl6u"]
|
||||||
size = Vector2(1000, 1000)
|
size = Vector2(1000, 1000)
|
||||||
|
|
@ -25,3 +26,15 @@ shape = SubResource("RectangleShape2D_dkl6u")
|
||||||
|
|
||||||
[node name="Player" parent="." instance=ExtResource("2_4a06y")]
|
[node name="Player" parent="." instance=ExtResource("2_4a06y")]
|
||||||
position = Vector2(487, 475)
|
position = Vector2(487, 475)
|
||||||
|
|
||||||
|
[node name="PirateSpawner" parent="." instance=ExtResource("4_ddepd")]
|
||||||
|
position = Vector2(88, 56)
|
||||||
|
|
||||||
|
[node name="PirateSpawner2" parent="." instance=ExtResource("4_ddepd")]
|
||||||
|
position = Vector2(891, 52)
|
||||||
|
|
||||||
|
[node name="PirateSpawner3" parent="." instance=ExtResource("4_ddepd")]
|
||||||
|
position = Vector2(891, 808)
|
||||||
|
|
||||||
|
[node name="PirateSpawner4" parent="." instance=ExtResource("4_ddepd")]
|
||||||
|
position = Vector2(68, 822)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,16 @@
|
||||||
[gd_scene format=3 uid="uid://br410dk87k14t"]
|
[gd_scene load_steps=4 format=3 uid="uid://br410dk87k14t"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://c6rnvbhbn7ida" path="res://Maps/Tiles/Tiles.tscn" id="1_5p561"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bjrtrtnjdk0nv" path="res://GPE/PirateSpawner/pirate_spawner.tscn" id="2_l6vc4"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://d01b7h5474v44" path="res://Characters/player.tscn" id="3_4mc6r"]
|
||||||
|
|
||||||
[node name="GymPirateSpawner" type="Node"]
|
[node name="GymPirateSpawner" type="Node"]
|
||||||
|
|
||||||
|
[node name="Tiles" parent="." instance=ExtResource("1_5p561")]
|
||||||
|
position = Vector2(1050.2191, 346.2714)
|
||||||
|
|
||||||
|
[node name="PirateSpawner" parent="." instance=ExtResource("2_l6vc4")]
|
||||||
|
position = Vector2(825, 428)
|
||||||
|
|
||||||
|
[node name="Player" parent="." instance=ExtResource("3_4mc6r")]
|
||||||
|
position = Vector2(194, 153)
|
||||||
|
|
|
||||||
113
export_presets.cfg
Normal file
113
export_presets.cfg
Normal file
|
|
@ -0,0 +1,113 @@
|
||||||
|
[preset.0]
|
||||||
|
|
||||||
|
name="Windows Desktop"
|
||||||
|
platform="Windows Desktop"
|
||||||
|
runnable=true
|
||||||
|
advanced_options=false
|
||||||
|
dedicated_server=false
|
||||||
|
custom_features=""
|
||||||
|
export_filter="all_resources"
|
||||||
|
include_filter=""
|
||||||
|
exclude_filter=""
|
||||||
|
export_path="../PirateSurvivorsExport/PirateSurvivors.exe"
|
||||||
|
patches=PackedStringArray()
|
||||||
|
encryption_include_filters=""
|
||||||
|
encryption_exclude_filters=""
|
||||||
|
seed=0
|
||||||
|
encrypt_pck=false
|
||||||
|
encrypt_directory=false
|
||||||
|
script_export_mode=2
|
||||||
|
|
||||||
|
[preset.0.options]
|
||||||
|
|
||||||
|
custom_template/debug=""
|
||||||
|
custom_template/release=""
|
||||||
|
debug/export_console_wrapper=1
|
||||||
|
binary_format/embed_pck=false
|
||||||
|
texture_format/s3tc_bptc=true
|
||||||
|
texture_format/etc2_astc=false
|
||||||
|
shader_baker/enabled=false
|
||||||
|
binary_format/architecture="x86_64"
|
||||||
|
codesign/enable=false
|
||||||
|
codesign/timestamp=true
|
||||||
|
codesign/timestamp_server_url=""
|
||||||
|
codesign/digest_algorithm=1
|
||||||
|
codesign/description=""
|
||||||
|
codesign/custom_options=PackedStringArray()
|
||||||
|
application/modify_resources=true
|
||||||
|
application/icon=""
|
||||||
|
application/console_wrapper_icon=""
|
||||||
|
application/icon_interpolation=4
|
||||||
|
application/file_version=""
|
||||||
|
application/product_version=""
|
||||||
|
application/company_name=""
|
||||||
|
application/product_name=""
|
||||||
|
application/file_description=""
|
||||||
|
application/copyright=""
|
||||||
|
application/trademarks=""
|
||||||
|
application/export_angle=0
|
||||||
|
application/export_d3d12=0
|
||||||
|
application/d3d12_agility_sdk_multiarch=true
|
||||||
|
ssh_remote_deploy/enabled=false
|
||||||
|
ssh_remote_deploy/host="user@host_ip"
|
||||||
|
ssh_remote_deploy/port="22"
|
||||||
|
ssh_remote_deploy/extra_args_ssh=""
|
||||||
|
ssh_remote_deploy/extra_args_scp=""
|
||||||
|
ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}'
|
||||||
|
$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}'
|
||||||
|
$trigger = New-ScheduledTaskTrigger -Once -At 00:00
|
||||||
|
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries
|
||||||
|
$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings
|
||||||
|
Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true
|
||||||
|
Start-ScheduledTask -TaskName godot_remote_debug
|
||||||
|
while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 }
|
||||||
|
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue"
|
||||||
|
ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
|
||||||
|
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
|
||||||
|
Remove-Item -Recurse -Force '{temp_dir}'"
|
||||||
|
|
||||||
|
[preset.1]
|
||||||
|
|
||||||
|
name="Web"
|
||||||
|
platform="Web"
|
||||||
|
runnable=true
|
||||||
|
advanced_options=false
|
||||||
|
dedicated_server=false
|
||||||
|
custom_features=""
|
||||||
|
export_filter="all_resources"
|
||||||
|
include_filter=""
|
||||||
|
exclude_filter=""
|
||||||
|
export_path="../PirateSurvivorsExport/PirateSurvivors.html"
|
||||||
|
patches=PackedStringArray()
|
||||||
|
encryption_include_filters=""
|
||||||
|
encryption_exclude_filters=""
|
||||||
|
seed=0
|
||||||
|
encrypt_pck=false
|
||||||
|
encrypt_directory=false
|
||||||
|
script_export_mode=2
|
||||||
|
|
||||||
|
[preset.1.options]
|
||||||
|
|
||||||
|
custom_template/debug=""
|
||||||
|
custom_template/release=""
|
||||||
|
variant/extensions_support=false
|
||||||
|
variant/thread_support=false
|
||||||
|
vram_texture_compression/for_desktop=true
|
||||||
|
vram_texture_compression/for_mobile=false
|
||||||
|
html/export_icon=true
|
||||||
|
html/custom_html_shell=""
|
||||||
|
html/head_include=""
|
||||||
|
html/canvas_resize_policy=2
|
||||||
|
html/focus_canvas_on_start=true
|
||||||
|
html/experimental_virtual_keyboard=false
|
||||||
|
progressive_web_app/enabled=true
|
||||||
|
progressive_web_app/ensure_cross_origin_isolation_headers=true
|
||||||
|
progressive_web_app/offline_page=""
|
||||||
|
progressive_web_app/display=1
|
||||||
|
progressive_web_app/orientation=0
|
||||||
|
progressive_web_app/icon_144x144=""
|
||||||
|
progressive_web_app/icon_180x180=""
|
||||||
|
progressive_web_app/icon_512x512=""
|
||||||
|
progressive_web_app/background_color=Color(0, 0, 0, 1)
|
||||||
|
threads/emscripten_pool_size=8
|
||||||
|
threads/godot_pool_size=4
|
||||||
78
serve.py
Normal file
78
serve.py
Normal file
|
|
@ -0,0 +1,78 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import contextlib
|
||||||
|
import os
|
||||||
|
import socket
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
from http.server import HTTPServer, SimpleHTTPRequestHandler
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
# See cpython GH-17851 and GH-17864.
|
||||||
|
class DualStackServer(HTTPServer):
|
||||||
|
def server_bind(self):
|
||||||
|
# Suppress exception when protocol is IPv4.
|
||||||
|
with contextlib.suppress(Exception):
|
||||||
|
self.socket.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0)
|
||||||
|
return super().server_bind()
|
||||||
|
|
||||||
|
|
||||||
|
class CORSRequestHandler(SimpleHTTPRequestHandler):
|
||||||
|
def end_headers(self):
|
||||||
|
self.send_header("Cross-Origin-Opener-Policy", "same-origin")
|
||||||
|
self.send_header("Cross-Origin-Embedder-Policy", "require-corp")
|
||||||
|
self.send_header("Access-Control-Allow-Origin", "*")
|
||||||
|
super().end_headers()
|
||||||
|
|
||||||
|
|
||||||
|
def shell_open(url):
|
||||||
|
if sys.platform == "win32":
|
||||||
|
os.startfile(url)
|
||||||
|
else:
|
||||||
|
opener = "open" if sys.platform == "darwin" else "xdg-open"
|
||||||
|
subprocess.call([opener, url])
|
||||||
|
|
||||||
|
|
||||||
|
def serve(root, port, run_browser):
|
||||||
|
os.chdir(root)
|
||||||
|
|
||||||
|
address = ("", port)
|
||||||
|
httpd = DualStackServer(address, CORSRequestHandler)
|
||||||
|
|
||||||
|
url = f"http://127.0.0.1:{port}"
|
||||||
|
if run_browser:
|
||||||
|
# Open the served page in the user's default browser.
|
||||||
|
print(f"Opening the served URL in the default browser (use `--no-browser` or `-n` to disable this): {url}")
|
||||||
|
shell_open(url)
|
||||||
|
else:
|
||||||
|
print(f"Serving at: {url}")
|
||||||
|
|
||||||
|
try:
|
||||||
|
httpd.serve_forever()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print("\nKeyboard interrupt received, stopping server.")
|
||||||
|
finally:
|
||||||
|
# Clean-up server
|
||||||
|
httpd.server_close()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("-p", "--port", help="port to listen on", default=8060, type=int)
|
||||||
|
parser.add_argument(
|
||||||
|
"-r", "--root", help="path to serve as root (relative to `platform/web/`)", default="../../bin", type=Path
|
||||||
|
)
|
||||||
|
browser_parser = parser.add_mutually_exclusive_group(required=False)
|
||||||
|
browser_parser.add_argument(
|
||||||
|
"-n", "--no-browser", help="don't open default web browser automatically", dest="browser", action="store_false"
|
||||||
|
)
|
||||||
|
parser.set_defaults(browser=True)
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
# Change to the directory where the script is located,
|
||||||
|
# so that the script can be run from any location.
|
||||||
|
os.chdir(Path(__file__).resolve().parent)
|
||||||
|
|
||||||
|
serve(args.root, args.port, args.browser)
|
||||||
Loading…
Reference in New Issue
Block a user