Added a new scene
This commit is contained in:
parent
19140b4b2e
commit
fb446fe24f
@ -18,3 +18,38 @@ config/icon="res://icon.svg"
|
||||
[dotnet]
|
||||
|
||||
project/assembly_name="Promiscuity"
|
||||
|
||||
[input]
|
||||
|
||||
ui_left={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194319,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
ui_right={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194321,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
ui_up={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194320,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
ui_down={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194322,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
41
scenes/level.tscn
Normal file
41
scenes/level.tscn
Normal file
@ -0,0 +1,41 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://dchj6g2i8ebph"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bpxggc8nr6tf6" path="res://scenes/player.gd" id="2_w7c3h"]
|
||||
|
||||
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_2q6dc"]
|
||||
bounce = 0.5
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_2q6dc"]
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_w7c3h"]
|
||||
|
||||
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_w8frs"]
|
||||
bounce = 0.5
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_mx8sn"]
|
||||
|
||||
[node name="Node3D" type="Node3D"]
|
||||
|
||||
[node name="Thing" type="RigidBody3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -3.7986288)
|
||||
physics_material_override = SubResource("PhysicsMaterial_2q6dc")
|
||||
gravity_scale = 0.0
|
||||
contact_monitor = true
|
||||
max_contacts_reported = 5
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Thing"]
|
||||
shape = SubResource("SphereShape3D_2q6dc")
|
||||
debug_color = Color(0.29772994, 0.6216631, 0.28140613, 0.41960785)
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="Thing"]
|
||||
mesh = SubResource("SphereMesh_w7c3h")
|
||||
|
||||
[node name="Player" type="RigidBody3D" parent="."]
|
||||
physics_material_override = SubResource("PhysicsMaterial_w8frs")
|
||||
gravity_scale = 0.0
|
||||
script = ExtResource("2_w7c3h")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Player"]
|
||||
shape = SubResource("SphereShape3D_mx8sn")
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="Player"]
|
||||
16
scenes/player.gd
Normal file
16
scenes/player.gd
Normal file
@ -0,0 +1,16 @@
|
||||
extends RigidBody3D
|
||||
|
||||
# Initially I used a CharacterBody3D, however, I wanted the player to bounce off
|
||||
# other objects in the environment and that would have required manual handling
|
||||
# of collisions. So that's why we're using a RigidBody3D instead.
|
||||
|
||||
const ACCELLERATION = 5.0
|
||||
|
||||
func _integrate_forces(state):
|
||||
var input_dir = Vector3.ZERO
|
||||
input_dir.x = Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")
|
||||
input_dir.z = Input.get_action_strength("ui_down") - Input.get_action_strength("ui_up")
|
||||
input_dir = input_dir.normalized()
|
||||
|
||||
linear_velocity.x += input_dir.x * (ACCELLERATION * state.step)
|
||||
linear_velocity.z += input_dir.z * (ACCELLERATION * state.step)
|
||||
1
scenes/player.gd.uid
Normal file
1
scenes/player.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://bpxggc8nr6tf6
|
||||
@ -2,8 +2,7 @@ extends Control
|
||||
|
||||
|
||||
func _on_start_button_pressed():
|
||||
pass # TODO: update below with the game scene
|
||||
# get_tree().change_scene_to_file("TODO")
|
||||
get_tree().change_scene_to_file("res://scenes/level.tscn")
|
||||
|
||||
func _on_settings_button_pressed():
|
||||
get_tree().change_scene_to_file("res://scenes/Settings.tscn")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user