Initial commit
This commit is contained in:
commit
a71b9445b7
11
.gitignore
vendored
Normal file
11
.gitignore
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
# Godot-specific ignores
|
||||
.import/
|
||||
export.cfg
|
||||
export_presets.cfg
|
||||
|
||||
# Imported translations (automatically generated from CSV files)
|
||||
*.translation
|
||||
|
||||
# Mono-specific ignores
|
||||
.mono/
|
||||
data_*/
|
58
Main.tscn
Normal file
58
Main.tscn
Normal file
@ -0,0 +1,58 @@
|
||||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://Player.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://Pickups.gd" type="Script" id=2]
|
||||
[ext_resource path="res://UI.gd" type="Script" id=4]
|
||||
|
||||
[sub_resource type="SpatialMaterial" id=5]
|
||||
albedo_color = Color( 0.192157, 0.313726, 0.164706, 1 )
|
||||
roughness = 0.45
|
||||
|
||||
[sub_resource type="PlaneMesh" id=6]
|
||||
material = SubResource( 5 )
|
||||
size = Vector2( 250, 250 )
|
||||
|
||||
[node name="Main" type="Spatial"]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource( 1 )]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0 )
|
||||
|
||||
[node name="RemoteTransform" type="RemoteTransform" parent="Player"]
|
||||
remote_path = NodePath("../../CameraOffset")
|
||||
update_scale = false
|
||||
|
||||
[node name="Pickups" type="Spatial" parent="."]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1 )
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="Floor" type="MeshInstance" parent="."]
|
||||
mesh = SubResource( 6 )
|
||||
|
||||
[node name="DirectionalLight" type="DirectionalLight" parent="."]
|
||||
transform = Transform( 0.615606, 0.318267, -0.720926, 0, 0.914819, 0.403865, 0.788054, -0.248622, 0.563168, 0, 6.48088, 0 )
|
||||
shadow_enabled = true
|
||||
directional_shadow_normal_bias = 0.493
|
||||
|
||||
[node name="CameraOffset" type="Spatial" parent="."]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0 )
|
||||
|
||||
[node name="Camera" type="Camera" parent="CameraOffset"]
|
||||
transform = Transform( -1, -6.18172e-08, 6.18172e-08, 0, 0.707107, 0.707107, -8.74228e-08, 0.707107, -0.707107, 0, 20, -15 )
|
||||
|
||||
[node name="UI" type="CanvasLayer" parent="."]
|
||||
script = ExtResource( 4 )
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="UI"]
|
||||
margin_right = 14.0
|
||||
margin_bottom = 14.0
|
||||
|
||||
[node name="FollowRotation" type="CheckBox" parent="UI/PanelContainer"]
|
||||
margin_left = 7.0
|
||||
margin_top = 7.0
|
||||
margin_right = 133.0
|
||||
margin_bottom = 31.0
|
||||
pressed = true
|
||||
text = "Follow Rotation"
|
||||
|
||||
[connection signal="toggled" from="UI/PanelContainer/FollowRotation" to="UI" method="_on_FollowRotation_toggled"]
|
15
Pickup.tscn
Normal file
15
Pickup.tscn
Normal file
@ -0,0 +1,15 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[sub_resource type="CubeMesh" id=4]
|
||||
|
||||
[sub_resource type="BoxShape" id=7]
|
||||
|
||||
[node name="Pickup" type="Area" groups=["pickup"]]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -2.41371 )
|
||||
|
||||
[node name="MeshInstance" type="MeshInstance" parent="."]
|
||||
mesh = SubResource( 4 )
|
||||
skeleton = NodePath("../..")
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape" parent="."]
|
||||
shape = SubResource( 7 )
|
10
Pickups.gd
Normal file
10
Pickups.gd
Normal file
@ -0,0 +1,10 @@
|
||||
extends Spatial
|
||||
|
||||
const Pickup = preload("res://Pickup.tscn")
|
||||
|
||||
func _ready():
|
||||
for y in range(-50,51):
|
||||
for x in range(-50, 51):
|
||||
var pickup := Pickup.instance()
|
||||
pickup.translate(Vector3(x * 2.3, 0.0, y * 2.3))
|
||||
add_child(pickup)
|
18
Player.gd
Normal file
18
Player.gd
Normal file
@ -0,0 +1,18 @@
|
||||
extends KinematicBody
|
||||
|
||||
const MAX_ANGULAR_VELOCITY = deg2rad(135.0) # rad/s
|
||||
const MAX_VELOCITY = 600.0 # m/s
|
||||
|
||||
func _physics_process(delta):
|
||||
rotate_y(Input.get_axis("right", "left") * MAX_ANGULAR_VELOCITY * delta)
|
||||
var movement_input = Vector3(0.0, 0.0, Input.get_axis("down", "up"))
|
||||
move_and_slide(transform.basis.xform(movement_input) * MAX_VELOCITY * delta)
|
||||
update_audio(movement_input.length_squared() > 0.1)
|
||||
|
||||
func update_audio(is_moving: bool):
|
||||
if is_moving != $AudioStreamPlayer.playing:
|
||||
$AudioStreamPlayer.playing = is_moving
|
||||
|
||||
func _on_HitBox_area_entered(area: Area):
|
||||
if area.is_in_group("pickup"):
|
||||
area.queue_free()
|
32
Player.tscn
Normal file
32
Player.tscn
Normal file
@ -0,0 +1,32 @@
|
||||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://Player.gd" type="Script" id=1]
|
||||
[ext_resource path="res://assets/wakka.ogg" type="AudioStream" id=2]
|
||||
|
||||
[sub_resource type="CubeMesh" id=1]
|
||||
|
||||
[sub_resource type="SpatialMaterial" id=2]
|
||||
albedo_color = Color( 1, 0.541176, 0.847059, 1 )
|
||||
|
||||
[sub_resource type="BoxShape" id=3]
|
||||
|
||||
[node name="Player" type="KinematicBody"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="MeshInstance" type="MeshInstance" parent="."]
|
||||
mesh = SubResource( 1 )
|
||||
skeleton = NodePath("../..")
|
||||
material/0 = SubResource( 2 )
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape" parent="."]
|
||||
shape = SubResource( 3 )
|
||||
|
||||
[node name="HitBox" type="Area" parent="."]
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape" parent="HitBox"]
|
||||
shape = SubResource( 3 )
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource( 2 )
|
||||
|
||||
[connection signal="area_entered" from="HitBox" to="." method="_on_HitBox_area_entered"]
|
4
UI.gd
Normal file
4
UI.gd
Normal file
@ -0,0 +1,4 @@
|
||||
extends CanvasLayer
|
||||
|
||||
func _on_FollowRotation_toggled(button_pressed: bool):
|
||||
$"%Player/RemoteTransform".update_rotation = button_pressed
|
BIN
assets/wakka.ogg
Normal file
BIN
assets/wakka.ogg
Normal file
Binary file not shown.
15
assets/wakka.ogg.import
Normal file
15
assets/wakka.ogg.import
Normal file
@ -0,0 +1,15 @@
|
||||
[remap]
|
||||
|
||||
importer="ogg_vorbis"
|
||||
type="AudioStreamOGGVorbis"
|
||||
path="res://.import/wakka.ogg-94fab257ab3d88afd7a1065fce2805b2.oggstr"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/wakka.ogg"
|
||||
dest_files=[ "res://.import/wakka.ogg-94fab257ab3d88afd7a1065fce2805b2.oggstr" ]
|
||||
|
||||
[params]
|
||||
|
||||
loop=true
|
||||
loop_offset=0
|
7
default_env.tres
Normal file
7
default_env.tres
Normal file
@ -0,0 +1,7 @@
|
||||
[gd_resource type="Environment" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=1]
|
||||
|
||||
[resource]
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 1 )
|
35
icon.png.import
Normal file
35
icon.png.import
Normal file
@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.png"
|
||||
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.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
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
67
project.godot
Normal file
67
project.godot
Normal file
@ -0,0 +1,67 @@
|
||||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=4
|
||||
|
||||
[application]
|
||||
|
||||
config/name="ForAustin"
|
||||
run/main_scene="res://Main.tscn"
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/width=1690
|
||||
window/size/height=1059
|
||||
window/size/resizable=false
|
||||
window/dpi/allow_hidpi=true
|
||||
|
||||
[gui]
|
||||
|
||||
common/drop_mouse_on_gui_input_disabled=true
|
||||
|
||||
[input]
|
||||
|
||||
up={
|
||||
"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":0,"physical_scancode":87,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
down={
|
||||
"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":0,"physical_scancode":83,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
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":0,"physical_scancode":65,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
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":0,"physical_scancode":68,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[physics]
|
||||
|
||||
common/enable_pause_aware_picking=true
|
||||
|
||||
[rendering]
|
||||
|
||||
quality/driver/driver_name="GLES2"
|
||||
vram_compression/import_etc=true
|
||||
vram_compression/import_etc2=false
|
||||
quality/reflections/texture_array_reflections=false
|
||||
quality/reflections/high_quality_ggx=false
|
||||
quality/depth/hdr=false
|
||||
environment/default_environment="res://default_env.tres"
|
Loading…
x
Reference in New Issue
Block a user