Skip to content

Commit

Permalink
Merge pull request #11 from GREEN-CHAOS/main
Browse files Browse the repository at this point in the history
moving changes to release to trigger building
  • Loading branch information
haennes authored Apr 26, 2021
2 parents 6da6973 + 3f8c83f commit 202e371
Show file tree
Hide file tree
Showing 13 changed files with 470 additions and 41 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
bin/
export.cfg
exportpresets.cfg
*.import
97 changes: 97 additions & 0 deletions export_presets.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
[preset.0]

name="Windows Desktop"
platform="Windows Desktop"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="builds/Windows.exe"
script_export_mode=1
script_encryption_key=""

[preset.0.options]

custom_template/debug=""
custom_template/release=""
binary_format/64_bits=true
binary_format/embed_pck=false
texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
codesign/enable=false
codesign/identity=""
codesign/password=""
codesign/timestamp=true
codesign/timestamp_server_url=""
codesign/digest_algorithm=1
codesign/description=""
codesign/custom_options=PoolStringArray( )
application/icon=""
application/file_version=""
application/product_version=""
application/company_name=""
application/product_name=""
application/file_description=""
application/copyright=""
application/trademarks=""

[preset.1]

name="Linux/X11"
platform="Linux/X11"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="builds/Linux.x86_64"
script_export_mode=1
script_encryption_key=""

[preset.1.options]

custom_template/debug=""
custom_template/release=""
binary_format/64_bits=true
binary_format/embed_pck=false
texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true

[preset.2]

name="Mac OSX"
platform="Mac OSX"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="builds/MacOS.zip"
script_export_mode=1
script_encryption_key=""

[preset.2.options]

custom_template/debug=""
custom_template/release=""
application/name=""
application/info="Made with Godot Engine"
application/icon=""
application/identifier=""
application/signature=""
application/short_version="1.0"
application/version="1.0"
application/copyright=""
display/high_res=false
privacy/camera_usage_description=""
privacy/microphone_usage_description=""
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
50 changes: 50 additions & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ _global_script_classes=[ {
"language": "GDScript",
"path": "res://scripts/RocketParts/parts.gd"
}, {
"base": "SpringArm",
"class": "PersonCamera",
"language": "GDScript",
"path": "res://scripts/Player/3rdPersonCamera.gd"
}, {
"base": "KinematicBody",
"class": "Player",
"language": "GDScript",
Expand All @@ -54,6 +59,7 @@ _global_script_class_icons={
"FuelTank": "",
"GravityObject": "",
"Part": "",
"PersonCamera": "",
"Player": "",
"RCSThruster": "",
"Rocket": "",
Expand All @@ -71,6 +77,10 @@ config/version="0.1.0"
window/size/width=1600
window/size/height=800

[editor_plugins]

enabled=PoolStringArray( )

[input]

ui_accept={
Expand Down Expand Up @@ -190,6 +200,46 @@ rcs_down={
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777237,"unicode":0,"echo":false,"script":null)
]
}
scroll_in={
"deadzone": 0.5,
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":4,"pressed":false,"doubleclick":false,"script":null)
]
}
scroll_out={
"deadzone": 0.5,
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":5,"pressed":false,"doubleclick":false,"script":null)
]
}
ESC={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null)
]
}
change_camera={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":67,"unicode":0,"echo":false,"script":null)
]
}
pitch_forward={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
]
}
pitch_backward={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
]
}
yaw_right={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
]
}
yaw_left={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
]
}

[layer_names]

Expand Down
11 changes: 11 additions & 0 deletions scenes/Player/PersonCamera.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[gd_scene load_steps=2 format=2]

[ext_resource path="res://scripts/Player/3rdPersonCamera.gd" type="Script" id=1]

[node name="PersonCamera" type="SpringArm"]
transform = Transform( 1, -0.000510735, 0.000318044, 0.000510832, 1, -0.000278954, -0.00031789, 0.00027913, 1, 0, 0, 0 )
spring_length = 20.0
script = ExtResource( 1 )

[node name="Camera" type="Camera" parent="."]
far = 8192.0
5 changes: 4 additions & 1 deletion scenes/Rocket/Rocket.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[gd_scene load_steps=6 format=2]
[gd_scene load_steps=7 format=2]

[ext_resource path="res://scenes/RocketParts/Engines/EngineTemplate.tscn" type="PackedScene" id=1]
[ext_resource path="res://scripts/Rocket/Rocket.gd" type="Script" id=2]
[ext_resource path="res://scenes/RocketParts/FuelTanks/FuelTank.tscn" type="PackedScene" id=3]
[ext_resource path="res://scenes/Player/PersonCamera.tscn" type="PackedScene" id=4]
[ext_resource path="res://scenes/RocketParts/RCSThruster/RCSThrusterTemplate.tscn" type="PackedScene" id=5]

[sub_resource type="Curve3D" id=1]
Expand All @@ -26,6 +27,8 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0 )
custom_integrator = true
affected_by_gravity = false

[node name="PersonCamera" parent="Tank" instance=ExtResource( 4 )]

[node name="RCS" parent="." instance=ExtResource( 5 )]
transform = Transform( -1, -3.25841e-07, 0, 3.25841e-07, -1, 0, 0, 0, 1, -1.5, 1, 0 )
mass = 0.01
Expand Down
2 changes: 2 additions & 0 deletions scenes/RocketParts/Engines/EngineTemplate.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

[node name="Engine" type="RigidBody"]
script = ExtResource( 1 )
thrust_total = 20
offset_node = NodePath("offset")

[node name="CollisionShape" type="CollisionShape" parent="."]
shape = SubResource( 1 )
Expand Down
116 changes: 116 additions & 0 deletions scenes/VehicleBuilder/VehicleBuilder.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
[gd_scene load_steps=3 format=2]

[ext_resource path="res://scripts/VehicleBuilder/VehicleBuilder.gd" type="Script" id=1]
[ext_resource path="res://scenes/Player/PersonCamera.tscn" type="PackedScene" id=2]

[node name="Control" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
tree = NodePath("HSplitContainer/PanelLeft/PanelLeft/Tree")
root_spatial = NodePath("HSplitContainer/HSplitContainer/PanelMid/PanelTop/ViewportContainer/Viewport/Spatial")
camera = NodePath("HSplitContainer/HSplitContainer/PanelMid/PanelTop/ViewportContainer/Viewport/PersonCamera")

[node name="HSplitContainer" type="HSplitContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
split_offset = 500
__meta__ = {
"_edit_use_anchors_": false
}

[node name="PanelLeft" type="VSplitContainer" parent="HSplitContainer"]
margin_right = 500.0
margin_bottom = 800.0
split_offset = 600
__meta__ = {
"_edit_use_anchors_": false
}

[node name="PanelLeft" type="Panel" parent="HSplitContainer/PanelLeft"]
margin_right = 500.0
margin_bottom = 800.0

[node name="Tree" type="Tree" parent="HSplitContainer/PanelLeft/PanelLeft"]
anchor_right = 1.0
anchor_bottom = 1.0
drop_mode_flags = 3
__meta__ = {
"_edit_use_anchors_": false
}

[node name="PanelBottom" type="Panel" parent="HSplitContainer/PanelLeft"]
visible = false
margin_top = 612.0
margin_right = 500.0
margin_bottom = 800.0

[node name="Label2" type="Label" parent="HSplitContainer/PanelLeft/PanelBottom"]
text = "Hello"
__meta__ = {
"_edit_use_anchors_": false
}

[node name="HSplitContainer" type="HSplitContainer" parent="HSplitContainer"]
margin_left = 512.0
margin_right = 1600.0
margin_bottom = 800.0
split_offset = 700

[node name="PanelMid" type="VSplitContainer" parent="HSplitContainer/HSplitContainer"]
margin_right = 700.0
margin_bottom = 800.0
split_offset = 500
__meta__ = {
"_edit_use_anchors_": false
}

[node name="PanelTop" type="Panel" parent="HSplitContainer/HSplitContainer/PanelMid"]
margin_right = 700.0
margin_bottom = 800.0

[node name="ViewportContainer" type="ViewportContainer" parent="HSplitContainer/HSplitContainer/PanelMid/PanelTop"]
anchor_right = 1.0
anchor_bottom = 1.0
stretch = true
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Viewport" type="Viewport" parent="HSplitContainer/HSplitContainer/PanelMid/PanelTop/ViewportContainer"]
size = Vector2( 700, 800 )
handle_input_locally = false
render_target_update_mode = 3

[node name="Spatial" type="Spatial" parent="HSplitContainer/HSplitContainer/PanelMid/PanelTop/ViewportContainer/Viewport"]

[node name="PersonCamera" parent="HSplitContainer/HSplitContainer/PanelMid/PanelTop/ViewportContainer/Viewport" instance=ExtResource( 2 )]

[node name="PanelBottom" type="Panel" parent="HSplitContainer/HSplitContainer/PanelMid"]
visible = false
margin_top = 512.0
margin_right = 700.0
margin_bottom = 800.0

[node name="Label2" type="Label" parent="HSplitContainer/HSplitContainer/PanelMid/PanelBottom"]
text = "Hello"
__meta__ = {
"_edit_use_anchors_": false
}

[node name="PanelRight" type="Panel" parent="HSplitContainer/HSplitContainer"]
margin_left = 712.0
margin_right = 1088.0
margin_bottom = 800.0

[node name="Label" type="Label" parent="HSplitContainer/HSplitContainer/PanelRight"]
margin_right = 40.0
margin_bottom = 14.0
text = "hello
"
__meta__ = {
"_edit_use_anchors_": false
}
48 changes: 48 additions & 0 deletions scripts/Player/3rdPersonCamera.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
class_name PersonCamera
extends SpringArm
#used for 3rd as well as first person

enum CameraMode { FIRST_PERSON , _3RD_PERSON = 2 } # _ is needed other wise it gets confused

var scroll_speed = 0.1 #move this to CameraData

var spring_length_last = spring_length
var current_camera_mode = CameraMode.FIRST_PERSON



func set_mode(mode):
current_camera_mode = mode
update_camera()

func get_mode():
return current_camera_mode

func change_mode():
print("change_mode")
if current_camera_mode == CameraMode._3RD_PERSON:
current_camera_mode = CameraMode.FIRST_PERSON
else:
current_camera_mode = CameraMode._3RD_PERSON
update_camera()

func update_camera():
if current_camera_mode == CameraMode.FIRST_PERSON:
spring_length = 0
elif current_camera_mode == CameraMode._3RD_PERSON:
spring_length = spring_length_last

func _input_pass_through(event : InputEventMouse):

if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
if event is InputEventMouseMotion:
rotation_degrees.x = clamp(rotation_degrees.x - event.relative.y*0.1,-90,90)
rotation_degrees.y -= event.relative.x*0.1
else:
if event.is_action_pressed("scroll_in"):
spring_length -= scroll_speed
elif event.is_action_pressed("scroll_out"):
spring_length += scroll_speed
spring_length_last = spring_length


Loading

0 comments on commit 202e371

Please sign in to comment.