diff --git a/assets/graphics/groove.png.import b/assets/graphics/groove.png.import new file mode 100644 index 0000000..c9cccbf --- /dev/null +++ b/assets/graphics/groove.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dgclvsxcplj81" +path="res://.godot/imported/groove.png-8c92b10a12db3786683c1041d16fee44.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/groove.png" +dest_files=["res://.godot/imported/groove.png-8c92b10a12db3786683c1041d16fee44.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/graphics/groove_eyes.png.import b/assets/graphics/groove_eyes.png.import new file mode 100644 index 0000000..9fb8189 --- /dev/null +++ b/assets/graphics/groove_eyes.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dx0tc7tfuvtn1" +path="res://.godot/imported/groove_eyes.png-577ec73d67fe7d54b7186a189cc22f6a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/groove_eyes.png" +dest_files=["res://.godot/imported/groove_eyes.png-577ec73d67fe7d54b7186a189cc22f6a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/graphics/segment.png.import b/assets/graphics/segment.png.import new file mode 100644 index 0000000..5b8d7c0 --- /dev/null +++ b/assets/graphics/segment.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b2ts7lhjewiav" +path="res://.godot/imported/segment.png-dc2d4f9f2d2d341000e7de2a6dce81c0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/segment.png" +dest_files=["res://.godot/imported/segment.png-dc2d4f9f2d2d341000e7de2a6dce81c0.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/graphics/splint.png.import b/assets/graphics/splint.png.import new file mode 100644 index 0000000..8b4540f --- /dev/null +++ b/assets/graphics/splint.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b0myjj8ggu2gt" +path="res://.godot/imported/splint.png-aabf65a10aa6fff56f82fe80da07ba22.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/splint.png" +dest_files=["res://.godot/imported/splint.png-aabf65a10aa6fff56f82fe80da07ba22.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/objects/player/groove.gd b/objects/player/groove.gd new file mode 100644 index 0000000..5aa09a8 --- /dev/null +++ b/objects/player/groove.gd @@ -0,0 +1,10 @@ +class_name Groove +extends CharacterBody2D + + +@export var max_length: float +@export var player: Player + + +func _physics_process(delta: float) -> void: + pass diff --git a/objects/player/groove.gd.uid b/objects/player/groove.gd.uid new file mode 100644 index 0000000..16bd3a9 --- /dev/null +++ b/objects/player/groove.gd.uid @@ -0,0 +1 @@ +uid://bbgvbxyesmfkg diff --git a/objects/player/player.gd b/objects/player/player.gd new file mode 100644 index 0000000..e228032 --- /dev/null +++ b/objects/player/player.gd @@ -0,0 +1,25 @@ +class_name Player +extends CharacterBody2D + + +@export var walk_speed: float + +@export_group("Internal References") +@export var _animations: AnimationPlayer + + +var is_stunned := false + + +func _physics_process(delta: float) -> void: + if is_stunned: + pass + else: + var input_dir = Input.get_vector(&"move_left", &"move_right", &"move_up", &"move_down") + velocity = input_dir * walk_speed + if input_dir.is_zero_approx(): + _animations.play(&"idle") + else: + _animations.play(&"walk") + + move_and_slide() diff --git a/objects/player/player.gd.uid b/objects/player/player.gd.uid new file mode 100644 index 0000000..1dfae8a --- /dev/null +++ b/objects/player/player.gd.uid @@ -0,0 +1 @@ +uid://by3eww6d7boay diff --git a/objects/player/player.tscn b/objects/player/player.tscn new file mode 100644 index 0000000..d619110 --- /dev/null +++ b/objects/player/player.tscn @@ -0,0 +1,99 @@ +[gd_scene load_steps=11 format=3 uid="uid://djpowg53xsgux"] + +[ext_resource type="Script" uid="uid://by3eww6d7boay" path="res://objects/player/player.gd" id="1_cqmt1"] +[ext_resource type="Texture2D" uid="uid://b0myjj8ggu2gt" path="res://assets/graphics/splint.png" id="2_g7ett"] +[ext_resource type="Script" uid="uid://bbgvbxyesmfkg" path="res://objects/player/groove.gd" id="3_jnjyq"] +[ext_resource type="Texture2D" uid="uid://dgclvsxcplj81" path="res://assets/graphics/groove.png" id="3_ssrue"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_cqmt1"] +radius = 12.0 + +[sub_resource type="Animation" id="Animation_g7ett"] +resource_name = "walk" +length = 0.3 +loop_mode = 1 +step = 0.05 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite2D:flip_h") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.15), +"transitions": PackedFloat32Array(1, 1), +"update": 1, +"values": [true, false] +} + +[sub_resource type="Animation" id="Animation_ssrue"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite2D:flip_h") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} + +[sub_resource type="Animation" id="Animation_jnjyq"] +resource_name = "idle" +length = 0.001 +step = 0.25 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite2D:flip_h") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_gnkmh"] +_data = { +&"RESET": SubResource("Animation_ssrue"), +&"idle": SubResource("Animation_jnjyq"), +&"walk": SubResource("Animation_g7ett") +} + +[sub_resource type="CircleShape2D" id="CircleShape2D_ssrue"] + +[node name="Player" type="CharacterBody2D" node_paths=PackedStringArray("_animations")] +motion_mode = 1 +script = ExtResource("1_cqmt1") +walk_speed = 100.0 +_animations = NodePath("AnimationPlayer") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_cqmt1") + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = ExtResource("2_g7ett") + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +&"": SubResource("AnimationLibrary_gnkmh") +} + +[node name="Node" type="Node" parent="."] + +[node name="Groove" type="CharacterBody2D" parent="Node" node_paths=PackedStringArray("player")] +position = Vector2(64, 0) +script = ExtResource("3_jnjyq") +max_length = 64.0 +player = NodePath("../..") + +[node name="Sprite2D" type="Sprite2D" parent="Node/Groove"] +texture = ExtResource("3_ssrue") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Node/Groove"] +shape = SubResource("CircleShape2D_ssrue") diff --git a/project.godot b/project.godot index f079670..8fe6848 100644 --- a/project.godot +++ b/project.godot @@ -10,7 +10,7 @@ config_version=5 [application] -config/name="Luna Lunatic" +config/name="Splint N' Groove" run/main_scene="uid://bnjujh22nqr4a" config/features=PackedStringArray("4.5", "GL Compatibility") config/icon="res://icon.svg" @@ -21,17 +21,46 @@ Display="*res://autoloads/display.tscn" [display] -window/size/viewport_width=256 -window/size/viewport_height=192 +window/size/viewport_width=320 +window/size/viewport_height=240 [file_customization] folder_colors={ "res://assets/": "yellow", -"res://autoloads/": "orange" +"res://autoloads/": "orange", +"res://objects/": "blue" } +[input] + +move_left={ +"deadzone": 0.2, +"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":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +move_right={ +"deadzone": 0.2, +"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":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +move_up={ +"deadzone": 0.2, +"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":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +move_down={ +"deadzone": 0.2, +"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":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} + +[physics] + +2d/default_gravity=0.0 + [rendering] +textures/canvas_textures/default_texture_filter=0 renderer/rendering_method="gl_compatibility" renderer/rendering_method.mobile="gl_compatibility" diff --git a/test_scene.tscn b/test_scene.tscn index 1d59249..0d532c9 100644 --- a/test_scene.tscn +++ b/test_scene.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=2 format=3 uid="uid://bnjujh22nqr4a"] +[gd_scene load_steps=3 format=3 uid="uid://bnjujh22nqr4a"] [ext_resource type="Texture2D" uid="uid://diymfwm64gae8" path="res://icon.svg" id="1_uhqqe"] +[ext_resource type="PackedScene" uid="uid://djpowg53xsgux" path="res://objects/player/player.tscn" id="2_ia1lp"] [node name="TestScene" type="Node2D"] @@ -11,3 +12,7 @@ texture = ExtResource("1_uhqqe") [node name="Icon2" type="Sprite2D" parent="."] position = Vector2(11, 9) texture = ExtResource("1_uhqqe") + +[node name="Player" parent="." instance=ExtResource("2_ia1lp")] +position = Vector2(115, 93) +walk_speed = 100.0