]> Untitled Git - lightcycles.git/commitdiff
Initial project
authorClifton Palmer <clifton.james.palmer@protonmail.com>
Sun, 15 Dec 2024 10:04:00 +0000 (12:04 +0200)
committerClifton Palmer <clifton.james.palmer@protonmail.com>
Sun, 15 Dec 2024 10:04:00 +0000 (12:04 +0200)
.gitattributes [new file with mode: 0644]
.gitignore [new file with mode: 0644]
icon.svg [new file with mode: 0644]
map/world.gd [new file with mode: 0644]
map/world.tscn [new file with mode: 0644]
player/player.gd [new file with mode: 0644]
player/player.tscn [new file with mode: 0644]
project.godot [new file with mode: 0644]
skins/bike/bike.glb [new file with mode: 0644]
skins/bike/bike.tscn [new file with mode: 0644]
textures/untextured.png [new file with mode: 0644]

diff --git a/.gitattributes b/.gitattributes
new file mode 100644 (file)
index 0000000..8ad74f7
--- /dev/null
@@ -0,0 +1,2 @@
+# Normalize EOL for all files that Git considers text files.
+* text=auto eol=lf
diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..ae14545
--- /dev/null
@@ -0,0 +1,5 @@
+# Godot 4+ specific ignores
+.godot/
+/android/
+*.import
+*swp
diff --git a/icon.svg b/icon.svg
new file mode 100644 (file)
index 0000000..9d8b7fa
--- /dev/null
+++ b/icon.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>
\ No newline at end of file
diff --git a/map/world.gd b/map/world.gd
new file mode 100644 (file)
index 0000000..d1979f7
--- /dev/null
@@ -0,0 +1,6 @@
+extends Node3D
+
+
+func _input(event: InputEvent) -> void:
+       if event.is_action_pressed("ui_cancel"):
+               get_tree().quit()
diff --git a/map/world.tscn b/map/world.tscn
new file mode 100644 (file)
index 0000000..a3f6d32
--- /dev/null
@@ -0,0 +1,41 @@
+[gd_scene load_steps=7 format=3 uid="uid://6tmryoxhs3yq"]
+
+[ext_resource type="PackedScene" uid="uid://dysxftv7xniv0" path="res://player/player.tscn" id="1_3tqxd"]
+[ext_resource type="Script" path="res://map/world.gd" id="1_mjcfj"]
+[ext_resource type="Texture2D" uid="uid://cp8pv6wya3ep2" path="res://textures/untextured.png" id="2_sxhh7"]
+
+[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ul8mq"]
+albedo_color = Color(0.199732, 0.199732, 0.199732, 1)
+albedo_texture = ExtResource("2_sxhh7")
+uv1_scale = Vector3(20, 20, 20)
+texture_filter = 0
+
+[sub_resource type="PlaneMesh" id="PlaneMesh_43sel"]
+material = SubResource("StandardMaterial3D_ul8mq")
+size = Vector2(50, 50)
+
+[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_mhr6o"]
+data = PackedVector3Array(25, 0, 25, -25, 0, 25, 25, 0, -25, -25, 0, 25, -25, 0, -25, 25, 0, -25)
+
+[node name="World" type="Node3D"]
+script = ExtResource("1_mjcfj")
+
+[node name="map" type="Node3D" parent="."]
+
+[node name="DirectionalLight3D" type="DirectionalLight3D" parent="map"]
+transform = Transform3D(-0.866025, -0.433013, 0.25, 0, 0.5, 0.866025, -0.5, 0.75, -0.433013, 0, 10, 0)
+shadow_enabled = true
+
+[node name="MeshInstance3D" type="MeshInstance3D" parent="map"]
+mesh = SubResource("PlaneMesh_43sel")
+skeleton = NodePath("../..")
+
+[node name="StaticBody3D" type="StaticBody3D" parent="map/MeshInstance3D"]
+
+[node name="CollisionShape3D" type="CollisionShape3D" parent="map/MeshInstance3D/StaticBody3D"]
+shape = SubResource("ConcavePolygonShape3D_mhr6o")
+
+[node name="player" parent="." instance=ExtResource("1_3tqxd")]
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -16)
+speed = 5.0
+distance = 3.0
diff --git a/player/player.gd b/player/player.gd
new file mode 100644 (file)
index 0000000..27754a4
--- /dev/null
@@ -0,0 +1,22 @@
+extends CharacterBody3D
+
+@export_category("Movement")
+@export var speed = 5.0
+
+@export_category("Camera")
+@export var distance = 3.0
+
+@onready var _springArm = $SpringArm3D
+@onready var _skin = %skin
+
+
+
+func _input(event: InputEvent) -> void:
+       if event.is_action_pressed("player_left"):
+               global_rotate(Vector3.UP, PI/2)
+       elif event.is_action_pressed("player_right"):
+               global_rotate(Vector3.UP, -PI/2)
+
+func _physics_process(delta: float) -> void:
+       velocity = global_transform.basis.z * speed
+       move_and_slide()
diff --git a/player/player.tscn b/player/player.tscn
new file mode 100644 (file)
index 0000000..e52446e
--- /dev/null
@@ -0,0 +1,23 @@
+[gd_scene load_steps=4 format=3 uid="uid://dysxftv7xniv0"]
+
+[ext_resource type="Script" path="res://player/player.gd" id="1_kh0vu"]
+[ext_resource type="PackedScene" uid="uid://d13jnq5vpvhl0" path="res://skins/bike/bike.tscn" id="1_m3abw"]
+
+[sub_resource type="BoxShape3D" id="BoxShape3D_vtbkq"]
+size = Vector3(0.25116, 0.472717, 0.987427)
+
+[node name="Player" type="CharacterBody3D"]
+script = ExtResource("1_kh0vu")
+
+[node name="skin" parent="." instance=ExtResource("1_m3abw")]
+unique_name_in_owner = true
+
+[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00430298, 0.24234, 0.0166626)
+shape = SubResource("BoxShape3D_vtbkq")
+
+[node name="SpringArm3D" type="SpringArm3D" parent="."]
+transform = Transform3D(-1, 0, -8.74228e-08, -2.26267e-08, 0.965926, 0.258819, 8.44439e-08, 0.258819, -0.965926, 0, 0.453074, 0)
+spring_length = 5.0
+
+[node name="Camera3D" type="Camera3D" parent="SpringArm3D"]
diff --git a/project.godot b/project.godot
new file mode 100644 (file)
index 0000000..c16c1f2
--- /dev/null
@@ -0,0 +1,44 @@
+; 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=5
+
+[application]
+
+config/name="Lightcycles"
+run/main_scene="res://map/world.tscn"
+config/features=PackedStringArray("4.3", "Forward Plus")
+config/icon="res://icon.svg"
+
+[display]
+
+window/size/viewport_width=2304
+window/size/viewport_height=1296
+
+[input]
+
+player_left={
+"deadzone": 0.5,
+"events": [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)
+]
+}
+player_right={
+"deadzone": 0.5,
+"events": [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":70,"key_label":0,"unicode":102,"location":0,"echo":false,"script":null)
+]
+}
+player_forward={
+"deadzone": 0.5,
+"events": [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":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null)
+]
+}
+player_backward={
+"deadzone": 0.5,
+"events": [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)
+]
+}
diff --git a/skins/bike/bike.glb b/skins/bike/bike.glb
new file mode 100644 (file)
index 0000000..b8bd984
Binary files /dev/null and b/skins/bike/bike.glb differ
diff --git a/skins/bike/bike.tscn b/skins/bike/bike.tscn
new file mode 100644 (file)
index 0000000..c2190bf
--- /dev/null
@@ -0,0 +1,8 @@
+[gd_scene load_steps=2 format=3 uid="uid://d13jnq5vpvhl0"]
+
+[ext_resource type="PackedScene" uid="uid://4k4cakwd4deq" path="res://skins/bike/bike.glb" id="1_oaqa0"]
+
+[node name="bike" instance=ExtResource("1_oaqa0")]
+
+[node name="Cylinder_001" parent="." index="0"]
+transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
diff --git a/textures/untextured.png b/textures/untextured.png
new file mode 100644 (file)
index 0000000..a22b16c
Binary files /dev/null and b/textures/untextured.png differ