Added visual objects and general improvements

pull/1/head
DAMO238 2020-08-16 13:10:31 +01:00
parent 8a4fedddfa
commit 5e788816a9
42 changed files with 380684 additions and 36 deletions

Binary file not shown.

15
Environment.tres Normal file
View File

@ -0,0 +1,15 @@
[gd_resource type="Environment" load_steps=3 format=2]
[ext_resource path="res://Images/panorama_image.png" type="Texture" id=1]
[sub_resource type="PanoramaSky" id=1]
panorama = ExtResource( 1 )
[resource]
background_mode = 2
background_sky = SubResource( 1 )
ambient_light_color = Color( 0.117647, 0.117647, 0.117647, 1 )
fog_sun_amount = 0.1
ss_reflections_enabled = true
glow_enabled = true
adjustment_enabled = true

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/SkyboxRenders0001.png-e90d5f0e63c7d1480412f2de6b949d06.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Images/SkyboxRenders0001.png"
dest_files=[ "res://.import/SkyboxRenders0001.png-e90d5f0e63c7d1480412f2de6b949d06.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/SkyboxRenders0002.png-4b870b253eb492764816d60b140de504.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Images/SkyboxRenders0002.png"
dest_files=[ "res://.import/SkyboxRenders0002.png-4b870b253eb492764816d60b140de504.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/SkyboxRenders0003.png-5bed2ac3068f6d85afdcb306db03373f.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Images/SkyboxRenders0003.png"
dest_files=[ "res://.import/SkyboxRenders0003.png-5bed2ac3068f6d85afdcb306db03373f.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/SkyboxRenders0004.png-5e5fbe1a5d82fa24e1b715deacded9a1.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Images/SkyboxRenders0004.png"
dest_files=[ "res://.import/SkyboxRenders0004.png-5e5fbe1a5d82fa24e1b715deacded9a1.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/SkyboxRenders0005.png-367c082d7cd1d522f620057b642f3fa8.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Images/SkyboxRenders0005.png"
dest_files=[ "res://.import/SkyboxRenders0005.png-367c082d7cd1d522f620057b642f3fa8.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/SkyboxRenders0006.png-eab2f649cc6c30c576ef73f086479c2a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Images/SkyboxRenders0006.png"
dest_files=[ "res://.import/SkyboxRenders0006.png-eab2f649cc6c30c576ef73f086479c2a.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
Images/TurnEndBanner.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/TurnEndBanner.png-a90b9a4eed25ec1b1f123b58935ae15d.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Images/TurnEndBanner.png"
dest_files=[ "res://.import/TurnEndBanner.png-a90b9a4eed25ec1b1f123b58935ae15d.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
Images/TurnEndBanner.xcf Normal file

Binary file not shown.

BIN
Images/panorama_image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/panorama_image.png-178bb12d9e039543725b0fef97a1b592.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Images/panorama_image.png"
dest_files=[ "res://.import/panorama_image.png-178bb12d9e039543725b0fef97a1b592.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
Images/untitled.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/untitled.png-a0f1fc1860ecf9644cee4cc88bcd28e6.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Images/untitled.png"
dest_files=[ "res://.import/untitled.png-a0f1fc1860ecf9644cee4cc88bcd28e6.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

1526
Models/Arrow.obj Normal file

File diff suppressed because it is too large Load Diff

19
Models/Arrow.obj.import Normal file
View File

@ -0,0 +1,19 @@
[remap]
importer="wavefront_obj"
type="Mesh"
path="res://.import/Arrow.obj-f256cfacd791e4c2bd7755e5546b08ad.mesh"
[deps]
files=[ "res://.import/Arrow.obj-f256cfacd791e4c2bd7755e5546b08ad.mesh" ]
source_file="res://Models/Arrow.obj"
dest_files=[ "res://.import/Arrow.obj-f256cfacd791e4c2bd7755e5546b08ad.mesh", "res://.import/Arrow.obj-f256cfacd791e4c2bd7755e5546b08ad.mesh" ]
[params]
generate_tangents=true
scale_mesh=Vector3( 1, 1, 1 )
offset_mesh=Vector3( 0, 0, 0 )
optimize_mesh=true

Binary file not shown.

Binary file not shown.

375301
Models/RotateArrow.obj Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,19 @@
[remap]
importer="wavefront_obj"
type="Mesh"
path="res://.import/RotateArrow.obj-449845451b89d81b4cb27588b1771bb7.mesh"
[deps]
files=[ "res://.import/RotateArrow.obj-449845451b89d81b4cb27588b1771bb7.mesh" ]
source_file="res://Models/RotateArrow.obj"
dest_files=[ "res://.import/RotateArrow.obj-449845451b89d81b4cb27588b1771bb7.mesh", "res://.import/RotateArrow.obj-449845451b89d81b4cb27588b1771bb7.mesh" ]
[params]
generate_tangents=true
scale_mesh=Vector3( 1, 1, 1 )
offset_mesh=Vector3( 0, 0, 0 )
optimize_mesh=true

BIN
Models/spaceship-engine.glb Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

BIN
Models/spaceship.glb Normal file

Binary file not shown.

1062
Models/spaceship.glb.import Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,33 @@
[gd_scene load_steps=4 format=2]
[sub_resource type="ParticlesMaterial" id=1]
lifetime_randomness = 0.41
spread = 5.0
gravity = Vector3( 0, 0, 0 )
initial_velocity = 100.0
initial_velocity_random = 0.66
tangential_accel_random = 1.0
damping = 11.49
scale = 0.2
scale_random = 0.51
[sub_resource type="SpatialMaterial" id=2]
albedo_color = Color( 0, 0, 0, 1 )
emission_enabled = true
emission = Color( 0, 0.905882, 1, 1 )
emission_energy = 16.0
emission_operator = 0
emission_on_uv2 = false
[sub_resource type="SphereMesh" id=3]
material = SubResource( 2 )
radius = 0.2
height = 0.2
[node name="Particles" type="Particles"]
transform = Transform( -0.00766045, 0.00642787, 0, -0.00642787, -0.00766045, 0, 0, 0, 0.01, 0, 0, 0 )
emitting = false
amount = 50
lifetime = 0.4
process_material = SubResource( 1 )
draw_pass_1 = SubResource( 3 )

View File

@ -1,17 +1,120 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=12 format=2]
[ext_resource path="res://Scripts/Player.gd" type="Script" id=1]
[ext_resource path="res://Models/Arrow.obj" type="ArrayMesh" id=2]
[ext_resource path="res://Models/RotateArrow.obj" type="ArrayMesh" id=3]
[ext_resource path="res://Shaders/ArrowMaterial.tres" type="Material" id=4]
[ext_resource path="res://Models/spaceship_model_modified.tscn" type="PackedScene" id=5]
[ext_resource path="res://Models/spaceship_engine_model_modified.tscn" type="PackedScene" id=6]
[ext_resource path="res://Scenes/EngineParticles.tscn" type="PackedScene" id=7]
[ext_resource path="res://Images/TurnEndBanner.png" type="Texture" id=8]
[ext_resource path="res://Animations/TurnEndBanner.anim" type="Animation" id=9]
[sub_resource type="CapsuleMesh" id=1]
radius = 0.1
mid_height = 0.5
[sub_resource type="CapsuleShape" id=1]
radius = 0.15
height = 0.6
[node name="Player" type="Spatial"]
[sub_resource type="CanvasItemMaterial" id=2]
light_mode = 1
[node name="Player" type="RigidBody"]
gravity_scale = -128.0
script = ExtResource( 1 )
[node name="MeshInstance" type="MeshInstance" parent="."]
mesh = SubResource( 1 )
material/0 = null
[node name="EngineParticleContainer" type="Spatial" parent="."]
[node name="S-X,R+Y" parent="EngineParticleContainer" instance=ExtResource( 7 )]
transform = Transform( 0.01, 0, 0, 0, 0.01, 0, 0, 0, 0.01, 0.170458, 0, 0.243815 )
[node name="S-X,R-Y" parent="EngineParticleContainer" instance=ExtResource( 7 )]
transform = Transform( 0.01, 0, 0, 0, 0.01, 0, 0, 0, 0.01, 0.21263, 0, -0.339794 )
[node name="S+X,R+Y" parent="EngineParticleContainer" instance=ExtResource( 7 )]
transform = Transform( -0.01, 0, 3.25841e-09, 0, 0.01, 0, -3.25841e-09, 0, -0.01, -0.214023, 0, -0.339794 )
[node name="S+X,R-Y" parent="EngineParticleContainer" instance=ExtResource( 7 )]
transform = Transform( -0.01, 0, 3.25841e-09, 0, 0.01, 0, -3.25841e-09, 0, -0.01, -0.176102, 0, 0.244114 )
[node name="S-Y,R+Z,R+X" parent="EngineParticleContainer" instance=ExtResource( 7 )]
transform = Transform( -1.62921e-09, -0.01, 0, 0.01, -1.62921e-09, 0, 0, 0, 0.01, -0.0497533, 0.0974464, 0.270828 )
[node name="S-Y,R-Z,R+X" parent="EngineParticleContainer" instance=ExtResource( 7 )]
transform = Transform( -1.62921e-09, -0.01, 0, 0.01, -1.62921e-09, 0, 0, 0, 0.01, 0.0501123, 0.0974464, 0.270828 )
[node name="S-Y,R-Z,R-X" parent="EngineParticleContainer" instance=ExtResource( 7 )]
transform = Transform( -1.62921e-09, -0.01, 0, 0.01, -1.62921e-09, 0, 0, 0, 0.01, 0.0697536, 0.127716, -0.354388 )
[node name="S-Y,R+Z,R-X" parent="EngineParticleContainer" instance=ExtResource( 7 )]
transform = Transform( -1.62921e-09, -0.01, 0, 0.01, -1.62921e-09, 0, 0, 0, 0.01, -0.0699186, 0.127716, -0.354388 )
[node name="S+Y,R-Z,R+X" parent="EngineParticleContainer" instance=ExtResource( 7 )]
transform = Transform( 1.19249e-10, 0.01, 0, -0.01, 1.19249e-10, 0, 0, 0, 0.01, -0.0699186, -0.128048, -0.354388 )
[node name="S+Y,R+Z,R+X" parent="EngineParticleContainer" instance=ExtResource( 7 )]
transform = Transform( 1.19249e-10, 0.01, 0, -0.01, 1.19249e-10, 0, 0, 0, 0.01, 0.0700162, -0.128048, -0.354388 )
[node name="S+Y,R-Z,R-X" parent="EngineParticleContainer" instance=ExtResource( 7 )]
transform = Transform( 1.19249e-10, 0.01, 0, -0.01, 1.19249e-10, 0, 0, 0, 0.01, -0.0497533, -0.126886, 0.270828 )
[node name="S+Y,R+Z,R-X" parent="EngineParticleContainer" instance=ExtResource( 7 )]
transform = Transform( 1.19249e-10, 0.01, 0, -0.01, 1.19249e-10, 0, 0, 0, 0.01, 0.0497652, -0.126886, 0.270828 )
[node name="SZ" parent="EngineParticleContainer" instance=ExtResource( 7 )]
transform = Transform( -3.25841e-09, 0, 0.02, 0, 0.02, 0, -0.02, 0, -3.25841e-09, 0.0588414, 0.000427529, -0.564202 )
[node name="SZ2" parent="EngineParticleContainer" instance=ExtResource( 7 )]
transform = Transform( -3.25841e-09, 0, 0.02, 0, 0.02, 0, -0.02, 0, -3.25841e-09, -0.0578827, 0.000427529, -0.564202 )
[node name="EngineContainer" type="Spatial" parent="."]
[node name="spaceship-engine" parent="EngineContainer" instance=ExtResource( 6 )]
transform = Transform( 0.05, 0, 0, 0, -2.18557e-09, 0.05, 0, -0.05, -2.18557e-09, -0.058048, 0, -0.499619 )
[node name="spaceship-engine2" parent="EngineContainer" instance=ExtResource( 6 )]
transform = Transform( 0.05, 0, 0, 0, -2.18557e-09, 0.05, 0, -0.05, -2.18557e-09, 0.058, 0, -0.5 )
[node name="spaceship-engine3" parent="EngineContainer" instance=ExtResource( 6 )]
transform = Transform( -3.25841e-09, -0.02, -3.25841e-09, 0, -3.25841e-09, 0.02, -0.02, 3.25841e-09, 5.30863e-16, -0.188586, 0, -0.340403 )
[node name="spaceship-engine5" parent="EngineContainer" instance=ExtResource( 6 )]
transform = Transform( -3.25841e-09, -0.02, -3.25841e-09, 0, -3.25841e-09, 0.02, -0.02, 3.25841e-09, 5.30863e-16, -0.15, 0, 0.244 )
[node name="spaceship-engine6" parent="EngineContainer" instance=ExtResource( 6 )]
transform = Transform( -3.25841e-09, 0.02, 3.25841e-09, 0, -3.25841e-09, 0.02, 0.02, 3.25841e-09, 5.30863e-16, 0.15, 0, 0.244 )
[node name="spaceship-engine4" parent="EngineContainer" instance=ExtResource( 6 )]
transform = Transform( -3.25841e-09, 0.02, 3.25841e-09, 0, -3.25841e-09, 0.02, 0.02, 3.25841e-09, 5.30863e-16, 0.189, 0, -0.34 )
[node name="spaceship-engine7" parent="EngineContainer" instance=ExtResource( 6 )]
transform = Transform( 0.02, 0, 0, 0, 0.02, 0, 0, 0, 0.02, 0.0697057, 0.102263, -0.354755 )
[node name="spaceship-engine11" parent="EngineContainer" instance=ExtResource( 6 )]
transform = Transform( 0.02, 0, 0, 0, 0.02, 0, 0, 0, 0.02, -0.07, 0.102, -0.355 )
[node name="spaceship-engine8" parent="EngineContainer" instance=ExtResource( 6 )]
transform = Transform( 0.02, 0, 0, 0, -0.02, 6.51683e-09, 0, -6.51683e-09, -0.02, 0.07, -0.102, -0.355 )
[node name="spaceship-engine12" parent="EngineContainer" instance=ExtResource( 6 )]
transform = Transform( 0.02, 0, 0, 0, -0.02, 6.51683e-09, 0, -6.51683e-09, -0.02, -0.07, -0.102, -0.355 )
[node name="spaceship-engine9" parent="EngineContainer" instance=ExtResource( 6 )]
transform = Transform( 0.02, 0, 0, 0, -0.02, 6.51683e-09, 0, -6.51683e-09, -0.02, 0.0497166, -0.102, 0.271 )
[node name="spaceship-engine13" parent="EngineContainer" instance=ExtResource( 6 )]
transform = Transform( 0.02, 0, 0, 0, -0.02, 6.51683e-09, 0, -6.51683e-09, -0.02, -0.05, -0.102, 0.271 )
[node name="spaceship-engine10" parent="EngineContainer" instance=ExtResource( 6 )]
transform = Transform( 0.02, 0, 0, 0, 0.02, 0, 0, 0, 0.02, 0.05, 0.073, 0.271 )
[node name="spaceship-engine14" parent="EngineContainer" instance=ExtResource( 6 )]
transform = Transform( 0.02, 0, 0, 0, 0.02, 0, 0, 0, 0.02, -0.05, 0.073, 0.271 )
[node name="spaceship" parent="." instance=ExtResource( 5 )]
transform = Transform( -2.44381e-08, 0, -0.15, 0, 0.15, 0, 0.15, 0, -2.44381e-08, 0, 0, 0 )
[node name="CollisionShape" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, 0.519, 0, 0, 0, 1, 0, 0, -0.034 )
shape = SubResource( 1 )
[node name="MainPanel" type="Panel" parent="."]
visible = false
@ -28,7 +131,7 @@ __meta__ = {
[node name="TimeBar" type="HSlider" parent="MainPanel"]
anchor_top = 0.5
anchor_right = 0.6
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = 10.0
grow_vertical = 2
@ -53,6 +156,19 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="PlayButton" type="Button" parent="MainPanel"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.6
anchor_bottom = 0.5
margin_left = 6.0
margin_right = -1.0
grow_vertical = 2
text = "Play"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="RemoveButton" type="Button" parent="MainPanel"]
anchor_left = 0.7
anchor_top = 0.5
@ -92,7 +208,28 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="ArrowContainer" type="Spatial" parent="."]
[node name="ArrowScaleContainer" type="Spatial" parent="ArrowContainer"]
transform = Transform( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.478 )
[node name="Arrow" type="MeshInstance" parent="ArrowContainer/ArrowScaleContainer"]
transform = Transform( 0.15, 0, 0, 0, 0.15, 0, 0, 0, 0.215, -0.00275069, -0.00179684, -0.000424862 )
mesh = ExtResource( 2 )
material/0 = ExtResource( 4 )
[node name="RotateArrowContainer" type="Spatial" parent="."]
[node name="RotateArrowScaleContainer" type="Spatial" parent="RotateArrowContainer"]
transform = Transform( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
[node name="RotateArrow" type="MeshInstance" parent="RotateArrowContainer/RotateArrowScaleContainer"]
transform = Transform( 0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 0, 0 )
mesh = ExtResource( 3 )
material/0 = ExtResource( 4 )
[node name="ThrustPanel" type="Panel" parent="."]
visible = false
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
@ -269,8 +406,29 @@ max_value = 1.0
step = 0.001
tick_count = 3
ticks_on_borders = true
[node name="TurnEndBanner" type="TextureRect" parent="."]
visible = false
modulate = Color( 1, 1, 1, 0 )
material = SubResource( 2 )
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = -20.0
margin_right = 20.0
mouse_filter = 2
texture = ExtResource( 8 )
expand = true
stretch_mode = 6
__meta__ = {
"_edit_use_anchors_": false
}
[node name="AnimationPlayer" type="AnimationPlayer" parent="TurnEndBanner"]
autoplay = "ShowEndTurnBanner"
anims/ShowEndTurnBanner = ExtResource( 9 )
[connection signal="value_changed" from="MainPanel/TimeBar" to="." method="_on_TimeBar_value_changed"]
[connection signal="pressed" from="MainPanel/AddButton" to="." method="_on_AddButton_pressed"]
[connection signal="pressed" from="MainPanel/PlayButton" to="." method="_on_PlayButton_pressed"]
[connection signal="pressed" from="MainPanel/RemoveButton" to="." method="_on_RemoveButton_pressed"]
[connection signal="pressed" from="MainPanel/ClearButton" to="." method="_on_ClearButton_pressed"]
[connection signal="pressed" from="MainPanel/EndTurnButton" to="." method="_on_EndTurnButton_pressed"]

View File

@ -1,12 +1,15 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=4 format=2]
[ext_resource path="res://Scripts/RootNode.gd" type="Script" id=1]
[ext_resource path="res://Scenes/Lobby.tscn" type="PackedScene" id=2]
[ext_resource path="res://Environment.tres" type="Environment" id=3]
[node name="RootNode" type="Node"]
script = ExtResource( 1 )
[node name="Lobby" parent="." instance=ExtResource( 2 )]
margin_top = 1.0
margin_bottom = 1.0
[node name="ConsoleOutput" type="TextEdit" parent="."]
visible = false
@ -18,3 +21,6 @@ caret_moving_by_right_click = false
__meta__ = {
"_edit_use_anchors_": false
}
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = ExtResource( 3 )

View File

@ -7,9 +7,11 @@ const Player = preload("res://Scenes/Player.tscn")
remote func place_player(player_id : int, position : Vector3, rotation : Vector3) -> void:
get_parent().console_print('Placing player with id: ' + String(player_id))
var player = Player.instance()
player.translation = position
player.rotation = rotation
player.set_name('player' + String(player_id))
add_child(player)
player.set_translation(position)
player.set_rotation(rotation)
get_parent().console_print('Player Coords: ' + String(player.translation) + String(player.rotation))
players[player_id] = player
if player_id == get_tree().get_network_unique_id():
player.is_local = true
@ -18,3 +20,7 @@ remote func place_player(player_id : int, position : Vector3, rotation : Vector3
func init():
get_parent().arena_ready()
func play_full_plans():
for player in players.values():
player.play_full_plan()

View File

@ -27,7 +27,7 @@ func remove_all_elements() -> void:
func new_turn() -> void:
for current_element in current_elements:
elements.push_back(current_elements.pop_back())
elements.push_back(current_elements.pop_front())
func sanity_check() -> bool:
# Returns true if sane and false if insane

View File

@ -1,92 +1,354 @@
extends Spatial
extends RigidBody
var plan : Plan = Plan.new()
var thrust_plan : Plan = Plan.new()
var is_local : bool = false
var running_plan : bool = false
var plan_time : float = 0.0
var last_translation : Vector3 = get_translation()
var last_rotation : Vector3 = get_rotation()
var initial_translation : Vector3 = get_translation()
var initial_rotation : Vector3 = get_rotation()
var initial_velocity : Vector3 = Vector3(0,0,0)
var initial_rotational_velocity : Vector3 = Vector3(0,0,0)
var enable_physics : bool = false
var round_time : float = 0.0
var end_of_round_translation : Vector3 = get_translation()
var end_of_round_rotation : Vector3 = get_rotation()
onready var arrow_obj : Spatial = $ArrowContainer
onready var arrow_scale_obj : Spatial = $ArrowContainer/ArrowScaleContainer
onready var rotate_arrow_obj : Spatial = $RotateArrowContainer
onready var rotate_arrow_scale_obj : Spatial = $RotateArrowContainer/RotateArrowScaleContainer
onready var turn_end_banner : TextureRect = $TurnEndBanner
const TIME_STEP : float = 0.01
const MAX_LIN_THRUST : float = 1.0
const MAX_ROT_THRUST : float = 1.0
func init() -> void:
last_rotation = get_rotation()
last_translation = get_translation()
initial_rotation = get_rotation()
initial_translation = get_translation()
enable_physics = true
get_parent().get_parent().console_print("Player is set to local? " + String(is_local))
if is_local:
$MainPanel.visible = true
$ThrustPanel.visible = true
func send_thrust_plan() -> void:
for element in thrust_plan.current_elements:
get_parent().get_parent().console_print('Sending data = ' + String(element.time) + String(element.linear_thrust) + String(element.rotational_thrust))
rpc_id(1, "add_thrust_element", element.time, element.linear_thrust, element.rotational_thrust)
remote func add_thrust_element(time: float, linear_thrust : Vector3, rotational_thrust : Vector3) -> void:
if is_local:
return
var element : ThrustElement = ThrustElement.new()
element.time = time
element.linear_thrust = linear_thrust
element.rotational_thrust = rotational_thrust
get_parent().get_parent().console_print(String(is_local) + ": Adding thrust element with the following params: time = " + String(time) + ", lin = " + String(linear_thrust) + ", rot = " + String(rotational_thrust) + ".")
thrust_plan.add_element(element)
remote func r_end_turn() -> void:
self._on_PlayButton_pressed()
if is_local:
$MainPanel/EndTurnButton.disabled = false
$MainPanel/TimeBar.value = 0
$TurnEndBanner.visible = true
$TurnEndBanner/AnimationPlayer.play()
return
thrust_plan.new_turn()
func _on_TimeBar_value_changed(value : float) -> void:
var min_time : float = plan.current_time()
get_parent().get_parent().console_print("Current plan time is " + String(min_time))
var min_time : float = thrust_plan.current_time()
get_parent().get_parent().console_print(String(is_local) + ": Current plan time is " + String(min_time))
if value <= min_time:
$MainPanel/TimeBar.value = min_time
func _on_AddButton_pressed() -> void:
var new_thrust_element : ThrustElement = ThrustElement.new()
new_thrust_element.linear_thrust = get_linear_vector()
new_thrust_element.rotational_thrust = get_rotational_vector()
new_thrust_element.time = $MainPanel/TimeBar.value - plan.current_time()
if (plan.add_element(new_thrust_element)):
get_parent().get_parent().console_print("Added thrust element")
new_thrust_element.time = $MainPanel/TimeBar.value - thrust_plan.current_time()
if (thrust_plan.add_element(new_thrust_element)):
get_parent().get_parent().console_print(String(is_local) + ": Added thrust element with " + String(new_thrust_element.time) + String(new_thrust_element.rotational_thrust) + String(new_thrust_element.linear_thrust))
else:
get_parent().get_parent().console_print("Failed to add thrust element")
get_parent().get_parent().console_print(String(is_local) + ": Failed to add thrust element")
func _on_RemoveButton_pressed() -> void:
plan.remove_last_element()
thrust_plan.remove_last_element()
func _on_ClearButton_pressed() -> void:
plan.remove_all_elements()
thrust_plan.remove_all_elements()
func _on_EndTurnButton_pressed() -> void:
plan.new_turn()
$MainPanel/EndTurnButton.disabled = true
send_thrust_plan()
rpc_id(1, "end_turn")
thrust_plan.new_turn()
round_time += 5
# TODO: Add the rest functionality
func _update_arrow() -> void:
var linear_thrust : Vector3 = get_linear_vector()
var linear_thrust_normalized : Vector3 = linear_thrust.normalized()
var linear_thrust_magnitude : float = linear_thrust.length()
var phi : float
if linear_thrust_normalized.x == 0 and linear_thrust_normalized.z == 0:
phi = PI/2
else:
phi = asin(linear_thrust_normalized.x / sqrt(pow(linear_thrust_normalized.x, 2) + pow(linear_thrust_normalized.z,2)))
if linear_thrust_normalized.z < 0:
phi = PI - phi
var theta : float = -asin(linear_thrust_normalized.y)
arrow_obj.rotation = Vector3(0,0,0)
arrow_obj.rotate(Vector3(1,0,0), theta)
arrow_obj.rotate(Vector3(0,1,0), phi)
arrow_scale_obj.scale = Vector3(linear_thrust_magnitude, linear_thrust_magnitude, linear_thrust_magnitude)
func _update_rotate_arrow() -> void:
var rotational_thrust : Vector3 = get_rotational_vector()
var rotational_thrust_normalized : Vector3 = rotational_thrust.normalized()
var rotational_thrust_magnitude : float = rotational_thrust.length()
var phi : float
if rotational_thrust_normalized.x == 0 and rotational_thrust_normalized.z == 0:
phi = PI/2
else:
phi = asin(rotational_thrust_normalized.x / sqrt(pow(rotational_thrust_normalized.x, 2) + pow(rotational_thrust_normalized.z,2)))
if rotational_thrust_normalized.z < 0:
phi = PI - phi
var theta : float = -asin(rotational_thrust_normalized.y)
rotate_arrow_obj.rotation = Vector3(0,0,0)
rotate_arrow_obj.rotate(Vector3(1,0,0), theta)
rotate_arrow_obj.rotate(Vector3(0,1,0), phi)
rotate_arrow_scale_obj.scale = Vector3(rotational_thrust_magnitude, rotational_thrust_magnitude, rotational_thrust_magnitude)
func get_linear_vector() -> Vector3:
return Vector3($ThrustPanel/XLin.value, $ThrustPanel/YLin.value, $ThrustPanel/ZLin.value)
return Vector3($ThrustPanel/XLin.value, $ThrustPanel/YLin.value, $ThrustPanel/ZLin.value) * MAX_LIN_THRUST
func get_rotational_vector() -> Vector3:
return Vector3($ThrustPanel/XRot.value, $ThrustPanel/YRot.value, $ThrustPanel/ZRot.value)
return Vector3($ThrustPanel/XRot.value, $ThrustPanel/YRot.value, $ThrustPanel/ZRot.value) * MAX_ROT_THRUST
func _on_XLin_value_changed(value : float) -> void:
get_parent().get_parent().console_print("Length of vector = " + String(get_linear_vector().length()))
self._update_arrow()
if get_linear_vector().length() < 1.0:
return
$ThrustPanel/XLin.value = sign($ThrustPanel/XLin.value) * \
sqrt(1 - pow($ThrustPanel/YLin.value, 2) - pow($ThrustPanel/ZLin.value, 2))
func _on_XRot_value_changed(value : float) -> void:
self._update_rotate_arrow()
if get_rotational_vector().length() < 1.0:
return
$ThrustPanel/XRot.value = sign($ThrustPanel/XRot.value) * \
sqrt(1 - pow($ThrustPanel/YRot.value, 2) - pow($ThrustPanel/ZRot.value, 2))
func _on_YLin_value_changed(value : float) -> void:
self._update_arrow()
if get_linear_vector().length() < 1.0:
return
$ThrustPanel/YLin.value = sign($ThrustPanel/YLin.value) * \
sqrt(1 - pow($ThrustPanel/XLin.value, 2) - pow($ThrustPanel/ZLin.value, 2))
func _on_YRot_value_changed(value : float) -> void:
self._update_rotate_arrow()
if get_rotational_vector().length() < 1.0:
return
$ThrustPanel/YRot.value = sign($ThrustPanel/YRot.value) * \
sqrt(1 - pow($ThrustPanel/XRot.value, 2) - pow($ThrustPanel/ZRot.value, 2))
func _on_ZLin_value_changed(value : float) -> void:
self._update_arrow()
if get_linear_vector().length() < 1.0:
return
$ThrustPanel/ZLin.value = sign($ThrustPanel/ZLin.value) * \
sqrt(1 - pow($ThrustPanel/YLin.value, 2) - pow($ThrustPanel/XLin.value, 2))
func _on_ZRot_value_changed(value : float) -> void:
self._update_rotate_arrow()
if get_rotational_vector().length() < 1.0:
return
$ThrustPanel/ZRot.value = sign($ThrustPanel/ZRot.value) * \
sqrt(1 - pow($ThrustPanel/YRot.value, 2) - pow($ThrustPanel/XRot.value, 2))
func _get_current_plan_element(all_elements) -> PlanElement:
var summed_time : float = 0.0
for element in all_elements:
summed_time += element.time
if summed_time > plan_time:
return element
return null
func _get_all_thrust_elements():
var all_elements = []
for element in thrust_plan.elements:
all_elements.append(element)
for element in thrust_plan.current_elements:
all_elements.append(element)
return all_elements
func _physics_process(delta : float) -> void:
if !enable_physics:
return
if !running_plan:
arrow_obj.visible = true
rotate_arrow_obj.visible = true
disable_all_engine_particles()
set_translation(last_translation)
set_rotation(last_rotation)
return
var all_thrust_elements = _get_all_thrust_elements()
var current_thrust_element : ThrustElement = _get_current_plan_element(all_thrust_elements)
if current_thrust_element == null:
last_translation = get_translation()
last_rotation = get_rotation()
running_plan = false
return
arrow_obj.visible = false
rotate_arrow_obj.visible = false
add_central_force(self.transform.basis.xform(current_thrust_element.linear_thrust))
add_torque(self.transform.basis.xform(current_thrust_element.rotational_thrust))
update_engine_particles(current_thrust_element.linear_thrust, current_thrust_element.rotational_thrust)
plan_time += delta
func disable_all_engine_particles() -> void:
var engine_particles = [
$"EngineParticleContainer/S-X,R+Y",
$"EngineParticleContainer/S+X,R-Y",
$"EngineParticleContainer/S-X,R-Y",
$"EngineParticleContainer/S+X,R+Y",
$"EngineParticleContainer/S-Y,R+Z,R+X",
$"EngineParticleContainer/S-Y,R-Z,R+X",
$"EngineParticleContainer/S-Y,R-Z,R-X",
$"EngineParticleContainer/S-Y,R+Z,R-X",
$"EngineParticleContainer/S+Y,R-Z,R+X",
$"EngineParticleContainer/S+Y,R+Z,R+X",
$"EngineParticleContainer/S+Y,R-Z,R-X",
$"EngineParticleContainer/S+Y,R+Z,R-X",
$EngineParticleContainer/SZ,
$EngineParticleContainer/SZ2
]
for ep in engine_particles:
ep.emitting = false
func update_engine_particles(linear_thrust : Vector3, rotational_thrust : Vector3) -> void:
var engine_particles : Particles = $"EngineParticleContainer/S-X,R-Y"
if linear_thrust.x < 0 or rotational_thrust.y > 0:
engine_particles.emitting = true
engine_particles.scale = Vector3.ONE * (max(-linear_thrust.x / MAX_LIN_THRUST, 0)+max(rotational_thrust.y / MAX_ROT_THRUST, 0)) * 0.005
else:
engine_particles.emitting = false
engine_particles = $"EngineParticleContainer/S+X,R+Y"
if linear_thrust.x > 0 or rotational_thrust.y < 0:
engine_particles.emitting = true
engine_particles.scale = Vector3.ONE * (max(linear_thrust.x / MAX_LIN_THRUST, 0)+max(-rotational_thrust.y / MAX_ROT_THRUST, 0)) * 0.005
else:
engine_particles.emitting = false
engine_particles = $"EngineParticleContainer/S-X,R+Y"
if linear_thrust.x < 0 or rotational_thrust.y < 0:
engine_particles.emitting = true
engine_particles.scale = Vector3.ONE * (max(-linear_thrust.x / MAX_LIN_THRUST, 0)+max(-rotational_thrust.y / MAX_ROT_THRUST, 0)) * 0.005
else:
engine_particles.emitting = false
engine_particles = $"EngineParticleContainer/S+X,R-Y"
if linear_thrust.x > 0 or rotational_thrust.y > 0:
engine_particles.emitting = true
engine_particles.scale = Vector3.ONE * (max(linear_thrust.x / MAX_LIN_THRUST, 0)+max(rotational_thrust.y / MAX_ROT_THRUST, 0)) * 0.005
else:
engine_particles.emitting = false
engine_particles = $"EngineParticleContainer/S-Y,R+Z,R+X"
if linear_thrust.y < 0 or rotational_thrust.z > 0 or rotational_thrust.x > 0:
engine_particles.emitting = true
engine_particles.scale = Vector3.ONE * (max(-linear_thrust.y / MAX_LIN_THRUST, 0)+max(rotational_thrust.z / MAX_ROT_THRUST, 0)+max(rotational_thrust.x / MAX_ROT_THRUST, 0)) * 0.01/3
else:
engine_particles.emitting = false
engine_particles = $"EngineParticleContainer/S-Y,R-Z,R+X"
if linear_thrust.y < 0 or rotational_thrust.z < 0 or rotational_thrust.x > 0:
engine_particles.emitting = true
engine_particles.scale = Vector3.ONE * (max(-linear_thrust.y / MAX_LIN_THRUST, 0)+max(-rotational_thrust.z / MAX_ROT_THRUST, 0)+max(rotational_thrust.x / MAX_ROT_THRUST, 0)) * 0.01/3
else:
engine_particles.emitting = false
engine_particles = $"EngineParticleContainer/S-Y,R-Z,R-X"
if linear_thrust.y < 0 or rotational_thrust.z < 0 or rotational_thrust.x < 0:
engine_particles.emitting = true
engine_particles.scale = Vector3.ONE * (max(-linear_thrust.y / MAX_LIN_THRUST, 0)+max(-rotational_thrust.z / MAX_ROT_THRUST, 0)+max(-rotational_thrust.x / MAX_ROT_THRUST, 0)) * 0.01/3
else:
engine_particles.emitting = false
engine_particles = $"EngineParticleContainer/S-Y,R+Z,R-X"
if linear_thrust.y < 0 or rotational_thrust.z > 0 or rotational_thrust.x < 0:
engine_particles.emitting = true
engine_particles.scale = Vector3.ONE * (max(-linear_thrust.y / MAX_LIN_THRUST, 0)+max(rotational_thrust.z / MAX_ROT_THRUST, 0)+max(-rotational_thrust.x / MAX_ROT_THRUST, 0)) * 0.01/3
else:
engine_particles.emitting = false
engine_particles = $"EngineParticleContainer/S+Y,R-Z,R+X"
if linear_thrust.y > 0 or rotational_thrust.z < 0 or rotational_thrust.x > 0:
engine_particles.emitting = true
engine_particles.scale = Vector3.ONE * (max(linear_thrust.y / MAX_LIN_THRUST, 0)+max(-rotational_thrust.z / MAX_ROT_THRUST, 0)+max(rotational_thrust.x / MAX_ROT_THRUST, 0)) * 0.01/3
else:
engine_particles.emitting = false
engine_particles = $"EngineParticleContainer/S+Y,R+Z,R+X"
if linear_thrust.y > 0 or rotational_thrust.z > 0 or rotational_thrust.x > 0:
engine_particles.emitting = true
engine_particles.scale = Vector3.ONE * (max(linear_thrust.y / MAX_LIN_THRUST, 0)+max(rotational_thrust.z / MAX_ROT_THRUST, 0)+max(rotational_thrust.x / MAX_ROT_THRUST, 0)) * 0.01/3
else:
engine_particles.emitting = false
engine_particles = $"EngineParticleContainer/S+Y,R-Z,R-X"
if linear_thrust.y > 0 or rotational_thrust.z < 0 or rotational_thrust.x < 0:
engine_particles.emitting = true
engine_particles.scale = Vector3.ONE * (max(linear_thrust.y / MAX_LIN_THRUST, 0)+max(-rotational_thrust.z / MAX_ROT_THRUST, 0)+max(-rotational_thrust.x / MAX_ROT_THRUST, 0)) * 0.01/3
else:
engine_particles.emitting = false
engine_particles = $"EngineParticleContainer/S+Y,R+Z,R-X"
if linear_thrust.y > 0 or rotational_thrust.z > 0 or rotational_thrust.x < 0:
engine_particles.emitting = true
engine_particles.scale = Vector3.ONE * (max(linear_thrust.y / MAX_LIN_THRUST, 0)+max(rotational_thrust.z / MAX_ROT_THRUST, 0)+max(-rotational_thrust.x / MAX_ROT_THRUST, 0)) * 0.01/3
else:
engine_particles.emitting = false
engine_particles = $EngineParticleContainer/SZ
var engine_particles2 : Particles = $EngineParticleContainer/SZ2
if linear_thrust.z != 0:
engine_particles.emitting = true
engine_particles2.emitting = true
var modz : float = linear_thrust.z
if modz < 0:
modz = -modz
engine_particles.scale = Vector3.ONE * (modz / MAX_ROT_THRUST) * 0.02
engine_particles2.scale = Vector3.ONE * (modz / MAX_ROT_THRUST) * 0.02
else:
engine_particles.emitting = false
engine_particles2.emitting = false
func play_current_plan():
pass
func play_all_plans():
get_parent().play_full_plans()
func play_full_plan():
set_linear_velocity(initial_velocity)
set_angular_velocity(initial_rotational_velocity)
set_translation(initial_translation)
set_rotation(initial_rotation)
running_plan = true
plan_time = 0.0
func _on_PlayButton_pressed():
play_all_plans()

View File

@ -0,0 +1,33 @@
[gd_resource type="SpatialMaterial" format=2]
[resource]
flags_transparent = true
params_diffuse_mode = 1
params_specular_mode = 2
params_cull_mode = 2
albedo_color = Color( 0.843137, 0.341176, 0.164706, 0.117647 )
metallic = 0.31
metallic_specular = 0.31
roughness = 0.0
emission_enabled = true
emission = Color( 0.309804, 0.776471, 0.905882, 1 )
emission_energy = 0.05
emission_operator = 0
emission_on_uv2 = false
clearcoat_enabled = true
clearcoat = 1.0
clearcoat_gloss = 0.5
ao_enabled = true
ao_light_affect = 0.0
ao_on_uv2 = false
ao_texture_channel = 0
transmission_enabled = true
transmission = Color( 0.843137, 0.341176, 0.164706, 1 )
refraction_enabled = true
refraction_scale = 0.54
refraction_texture_channel = 0
proximity_fade_enable = true
proximity_fade_distance = 5.0
distance_fade_mode = 1
distance_fade_min_distance = 100.0
distance_fade_max_distance = 10.0

25
export_presets.cfg Normal file
View File

@ -0,0 +1,25 @@
[preset.0]
name="Linux/X11"
platform="Linux/X11"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../Builds/Client.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=""

View File

@ -157,6 +157,17 @@ camera_yaw_left={
]
}
[locale]
fallback="en_GB"
[physics]
3d/default_gravity=0.0
[rendering]
threads/thread_model=2
quality/subsurface_scattering/quality=2
quality/filters/msaa=3
environment/default_environment="res://default_env.tres"