添加多个模型/贴图

This commit is contained in:
Zhao Yunlong 2025-04-10 14:33:46 +08:00
parent 86caf176fc
commit 373a457457
24 changed files with 215 additions and 5 deletions

19
Bullet.tscn Normal file
View File

@ -0,0 +1,19 @@
[gd_scene load_steps=4 format=3 uid="uid://xks0ar34uqsr"]
[ext_resource type="Script" uid="uid://1kxyq4s6uft4" path="res://VGDL/vgdl_object.gd" id="1_ayd6b"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ayd6b"]
emission_enabled = true
emission = Color(1, 0, 0, 1)
[sub_resource type="SphereMesh" id="SphereMesh_ayd6b"]
radius = 0.25
height = 0.5
[node name="VGDLObject" type="Node3D"]
script = ExtResource("1_ayd6b")
metadata/_edit_horizontal_guides_ = [-64.0]
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
material_override = SubResource("StandardMaterial3D_ayd6b")
mesh = SubResource("SphereMesh_ayd6b")

8
Spaceship.tscn Normal file
View File

@ -0,0 +1,8 @@
[gd_scene load_steps=3 format=3 uid="uid://bwvtd3f17vl5t"]
[ext_resource type="PackedScene" uid="uid://dvxuu7qux7qw0" path="res://assets/pixel_low_poly_spaceship.glb" id="1_p8lcy"]
[ext_resource type="Script" uid="uid://1kxyq4s6uft4" path="res://VGDL/vgdl_object.gd" id="2_q1owq"]
[node name="Player" instance=ExtResource("1_p8lcy")]
transform = Transform3D(-1, 3.82137e-15, -8.74228e-08, 8.74228e-08, 4.37114e-08, -1, 0, -1, -4.37114e-08, 0, 0, 0)
script = ExtResource("2_q1owq")

8
UFO.tscn Normal file
View File

@ -0,0 +1,8 @@
[gd_scene load_steps=3 format=3 uid="uid://cf31rs33pliht"]
[ext_resource type="PackedScene" uid="uid://c7oi32ojscrut" path="res://assets/space_harrier_carrier.glb" id="1_hlmu5"]
[ext_resource type="Script" uid="uid://1kxyq4s6uft4" path="res://VGDL/vgdl_object.gd" id="2_m2gmv"]
[node name="Enemy" instance=ExtResource("1_hlmu5")]
transform = Transform3D(1, -8.74228e-08, 8.74228e-08, -8.74228e-08, -4.37114e-08, 1, -8.74228e-08, -1, -4.37114e-08, 0, 0, 0)
script = ExtResource("2_m2gmv")

View File

@ -11,6 +11,13 @@ func parsing_state(state: JSObject):
if VGDLObjects.has(obj.ID):
var current_object: VGDLObject = VGDLObjects[obj.ID]
current_object.update_object_state(obj)
elif obj.blueprint != null:
var current_object: VGDLObject = load("res://%s.tscn" % obj.blueprint) .instantiate()
current_object.name = "%d_%s" % [obj.ID, obj.name]
current_object.renderer = self
add_child(current_object)
VGDLObjects[obj.ID] = current_object
current_object.update_object_state(obj)
else:
var current_object: VGDLObject = VGDL_OBJECT.instantiate()
current_object.name = "%d_%s" % [obj.ID, obj.name]

12
Wall.tscn Normal file
View File

@ -0,0 +1,12 @@
[gd_scene load_steps=3 format=3 uid="uid://oifd3ihylqqv"]
[ext_resource type="Script" uid="uid://1kxyq4s6uft4" path="res://VGDL/vgdl_object.gd" id="1_l6igm"]
[sub_resource type="BoxMesh" id="BoxMesh_l6igm"]
[node name="VGDLObject" type="Node3D"]
script = ExtResource("1_l6igm")
metadata/_edit_horizontal_guides_ = [-64.0]
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
mesh = SubResource("BoxMesh_l6igm")

Binary file not shown.

View File

@ -0,0 +1,37 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://dvxuu7qux7qw0"
path="res://.godot/imported/pixel_low_poly_spaceship.glb-c3500d4cc6008848a3f0ab0ddf80b5b2.scn"
[deps]
source_file="res://assets/pixel_low_poly_spaceship.glb"
dest_files=["res://.godot/imported/pixel_low_poly_spaceship.glb-c3500d4cc6008848a3f0ab0ddf80b5b2.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1,39 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://caw5muybt67du"
path.s3tc="res://.godot/imported/pixel_low_poly_spaceship_0.png-07b694ab7d986b73796689c97100bacf.s3tc.ctex"
path.etc2="res://.godot/imported/pixel_low_poly_spaceship_0.png-07b694ab7d986b73796689c97100bacf.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
generator_parameters={
"md5": "401e8e406e3cacfb84362ab6fdd1493a"
}
[deps]
source_file="res://assets/pixel_low_poly_spaceship_0.png"
dest_files=["res://.godot/imported/pixel_low_poly_spaceship_0.png-07b694ab7d986b73796689c97100bacf.s3tc.ctex", "res://.godot/imported/pixel_low_poly_spaceship_0.png-07b694ab7d986b73796689c97100bacf.etc2.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

Binary file not shown.

View File

@ -0,0 +1,37 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://c7oi32ojscrut"
path="res://.godot/imported/space_harrier_carrier.glb-1401a68098021f7adf31a39630c7c305.scn"
[deps]
source_file="res://assets/space_harrier_carrier.glb"
dest_files=["res://.godot/imported/space_harrier_carrier.glb-1401a68098021f7adf31a39630c7c305.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=0.1
nodes/import_as_skeleton_bones=false
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -0,0 +1,39 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://chwyj26ru3ipe"
path.s3tc="res://.godot/imported/space_harrier_carrier_0.png-8e894ee058b403b67e6f3ab93109360e.s3tc.ctex"
path.etc2="res://.godot/imported/space_harrier_carrier_0.png-8e894ee058b403b67e6f3ab93109360e.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
generator_parameters={
"md5": "4a848aefcd55260ddeaf4ad85997c81f"
}
[deps]
source_file="res://assets/space_harrier_carrier_0.png"
dest_files=["res://.godot/imported/space_harrier_carrier_0.png-8e894ee058b403b67e6f3ab93109360e.s3tc.ctex", "res://.godot/imported/space_harrier_carrier_0.png-8e894ee058b403b67e6f3ab93109360e.etc2.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

View File

@ -107,7 +107,7 @@ min_pitch = -70.0
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(-1, 0, 0, 0, 0.496586, 0.867987, 0, 0.867987, -0.496586, 53.3291, 4.03761, -218.786)
transform = Transform3D(-1, 0, 0, 0, 0.496621, 0.867968, 0, 0.867968, -0.496621, 53.3291, 4.03754, -218.786)
[node name="PhantomCameraHost" type="Node" parent="Camera3D"]
process_priority = 300
@ -115,7 +115,7 @@ process_physics_priority = 300
script = ExtResource("9_oylil")
[node name="PlayerFollower" type="Node3D" parent="." node_paths=PackedStringArray("follow_target", "look_at_target")]
transform = Transform3D(-0.988921, 0, 0, 0, 0.496556, 0.867889, 0, 0.867936, -0.49653, 53.3291, 4.03761, -218.786)
transform = Transform3D(-0.988921, 0, 0, 0, 0.496591, 0.867869, 0, 0.867916, -0.496564, 53.3291, 4.03754, -218.786)
script = ExtResource("10_cd38x")
priority = 10
follow_mode = 6

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -2,11 +2,11 @@ export const aliens_game = `
BasicGame block_size=5
SpriteSet
background > Immovable img=oryx/space1 hidden=True
base > Immovable color=WHITE img=oryx/space5
base > Immovable color=WHITE img=oryx/space5 blueprint=Wall
avatar > FlakAvatar stype=sam img=oryx/spaceship1 blueprint=Spaceship
missile > Missile
sam > orientation=UP color=BLUE singleton=True img=oryx/bullet2
bomb > orientation=DOWN color=RED speed=0.5 img=oryx/bullet2
sam > orientation=UP color=BLUE singleton=True img=oryx/bullet2 blueprint=Bullet
bomb > orientation=DOWN color=RED speed=0.5 img=oryx/bullet2 blueprint=Bullet
alien > Bomber stype=bomb prob=0.05 cooldown=3 speed=0.8 blueprint=UFO
alienGreen > img=oryx/alien3
alienBlue > img=oryx/alien1

View File

@ -80,6 +80,10 @@ locale/translations_pot_files=PackedStringArray("res://dialogue/ask_playing.dial
3d_physics/layer_1="Environment"
3d_physics/layer_2="Player"
[physics]
common/physics_interpolation=true
[rendering]
textures/vram_compression/import_etc2_astc=true