diff --git a/Examples/tutorial-oyvtzwujcy0/.editorconfig b/Examples/tutorial-oyvtzwujcy0/.editorconfig new file mode 100644 index 0000000..f28239b --- /dev/null +++ b/Examples/tutorial-oyvtzwujcy0/.editorconfig @@ -0,0 +1,4 @@ +root = true + +[*] +charset = utf-8 diff --git a/Examples/tutorial-oyvtzwujcy0/.gitattributes b/Examples/tutorial-oyvtzwujcy0/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/Examples/tutorial-oyvtzwujcy0/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/Examples/tutorial-oyvtzwujcy0/.gitignore b/Examples/tutorial-oyvtzwujcy0/.gitignore new file mode 100644 index 0000000..0af181c --- /dev/null +++ b/Examples/tutorial-oyvtzwujcy0/.gitignore @@ -0,0 +1,3 @@ +# Godot 4+ specific ignores +.godot/ +/android/ diff --git a/Examples/tutorial-oyvtzwujcy0/Entities/Character/character.gd b/Examples/tutorial-oyvtzwujcy0/Entities/Character/character.gd new file mode 100644 index 0000000..22fcecc --- /dev/null +++ b/Examples/tutorial-oyvtzwujcy0/Entities/Character/character.gd @@ -0,0 +1,25 @@ +class_name Character extends CharacterBody2D + +@export var speed := 135.0 + +# Xf2RduncoNU +func _physics_process(_delta: float) -> void: + var new_direction = Vector2.ZERO + if Input.is_action_pressed("left"): + new_direction.x -= 1.0 + if Input.is_action_pressed("right"): + new_direction.x += 1.0 + if Input.is_action_pressed("up"): + new_direction.y -= 1.0 + if Input.is_action_pressed("down"): + new_direction.y += 1.0 + new_direction = new_direction.normalized() + velocity = new_direction * speed + + if velocity == Vector2.ZERO: + $AnimationTree.get("parameters/playback").travel("idle") + return + $AnimationTree.set("parameters/walk/blend_position", new_direction) + $AnimationTree.set("parameters/idle/blend_position", new_direction) + $AnimationTree.get("parameters/playback").travel("walk") + move_and_slide() diff --git a/Examples/tutorial-oyvtzwujcy0/Entities/Character/character.gd.uid b/Examples/tutorial-oyvtzwujcy0/Entities/Character/character.gd.uid new file mode 100644 index 0000000..c27edbb --- /dev/null +++ b/Examples/tutorial-oyvtzwujcy0/Entities/Character/character.gd.uid @@ -0,0 +1 @@ +uid://csqcsepu2r0ts diff --git a/Examples/tutorial-oyvtzwujcy0/Entities/Character/character.tscn b/Examples/tutorial-oyvtzwujcy0/Entities/Character/character.tscn new file mode 100644 index 0000000..27945c0 --- /dev/null +++ b/Examples/tutorial-oyvtzwujcy0/Entities/Character/character.tscn @@ -0,0 +1,123 @@ +[gd_scene load_steps=15 format=3 uid="uid://dbhiwig4potyb"] + +[ext_resource type="Script" uid="uid://csqcsepu2r0ts" path="res://Entities/Character/character.gd" id="1_a1h5o"] +[ext_resource type="Texture2D" uid="uid://dasxw18q3mppl" path="res://icon.svg" id="1_bmc7m"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_bmc7m"] +size = Vector2(14.8999, 28.4489) + +[sub_resource type="Animation" id="Animation_a1h5o"] +resource_name = "new_animation" +length = 2.00005 +loop_mode = 1 +step = 0.5 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Icon:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0.01, 0.303333, 0.59, 0.86, 1.15, 1.44, 1.74), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1), +"update": 1, +"values": [2, 1, 3, 4, 5, 6, 7] +} + +[sub_resource type="Animation" id="Animation_xasj2"] +length = 0.5 +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Icon:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0.01), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [5] +} + +[sub_resource type="Animation" id="Animation_6vsl0"] +resource_name = "idle" +length = 0.333337 +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Icon:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [0] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_xasj2"] +_data = { +&"RESET": SubResource("Animation_xasj2"), +&"idle": SubResource("Animation_6vsl0"), +&"new_animation": SubResource("Animation_a1h5o") +} + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_a1h5o"] +animation = &"idle" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_xasj2"] +animation = &"new_animation" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_6vsl0"] +animation = &"new_animation" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_k05qf"] +animation = &"idle" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_4th1x"] +animation = &"idle" + +[sub_resource type="AnimationNodeBlendSpace2D" id="AnimationNodeBlendSpace2D_roimm"] +blend_point_0/node = SubResource("AnimationNodeAnimation_xasj2") +blend_point_0/pos = Vector2(-1, 0) +blend_point_1/node = SubResource("AnimationNodeAnimation_6vsl0") +blend_point_1/pos = Vector2(0, -0.9) +blend_point_2/node = SubResource("AnimationNodeAnimation_k05qf") +blend_point_2/pos = Vector2(0, 1) +blend_point_3/node = SubResource("AnimationNodeAnimation_4th1x") +blend_point_3/pos = Vector2(1, 0) +blend_mode = 1 + +[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_roimm"] +states/idle/node = SubResource("AnimationNodeAnimation_a1h5o") +states/idle/position = Vector2(490, 105) +states/walk/node = SubResource("AnimationNodeBlendSpace2D_roimm") +states/walk/position = Vector2(490, 199) + +[node name="Node2D" type="CharacterBody2D"] +scale = Vector2(1.00672, 0.989311) +script = ExtResource("1_a1h5o") + +[node name="Icon" type="Sprite2D" parent="."] +position = Vector2(0.566751, -15.3349) +texture = ExtResource("1_bmc7m") +hframes = 6 +vframes = 4 +frame = 5 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(0.496663, -14.0781) +scale = Vector2(0.999999, 1) +shape = SubResource("RectangleShape2D_bmc7m") + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +&"": SubResource("AnimationLibrary_xasj2") +} + +[node name="AnimationTree" type="AnimationTree" parent="."] +tree_root = SubResource("AnimationNodeStateMachine_roimm") +anim_player = NodePath("../AnimationPlayer") +parameters/walk/blend_position = Vector2(-0.819838, -0.497758) diff --git a/Examples/tutorial-oyvtzwujcy0/Entities/Objects/wall.tscn b/Examples/tutorial-oyvtzwujcy0/Entities/Objects/wall.tscn new file mode 100644 index 0000000..798f370 --- /dev/null +++ b/Examples/tutorial-oyvtzwujcy0/Entities/Objects/wall.tscn @@ -0,0 +1,17 @@ +[gd_scene load_steps=3 format=3 uid="uid://du7dcihv2m3ue"] + +[ext_resource type="Texture2D" uid="uid://dasxw18q3mppl" path="res://icon.svg" id="1_sl5yh"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_qnvor"] +size = Vector2(10, 129) + +[node name="Wall" type="StaticBody2D"] + +[node name="Icon" type="Sprite2D" parent="."] +position = Vector2(-1.90735e-06, -65) +scale = Vector2(0.078125, 1) +texture = ExtResource("1_sl5yh") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(0, -64.5) +shape = SubResource("RectangleShape2D_qnvor") diff --git a/Examples/tutorial-oyvtzwujcy0/Scenes/playground.tscn b/Examples/tutorial-oyvtzwujcy0/Scenes/playground.tscn new file mode 100644 index 0000000..d577c13 --- /dev/null +++ b/Examples/tutorial-oyvtzwujcy0/Scenes/playground.tscn @@ -0,0 +1,15 @@ +[gd_scene load_steps=3 format=3 uid="uid://bodk3sbrdedn2"] + +[ext_resource type="PackedScene" uid="uid://dbhiwig4potyb" path="res://Entities/Character/character.tscn" id="1_uof5o"] +[ext_resource type="PackedScene" uid="uid://du7dcihv2m3ue" path="res://Entities/Objects/wall.tscn" id="2_6xle2"] + +[node name="Playground" type="Node2D"] + +[node name="character" parent="." instance=ExtResource("1_uof5o")] + +[node name="wall" parent="." instance=ExtResource("2_6xle2")] +position = Vector2(245, 108) +scale = Vector2(3.35596, 3.35596) + +[node name="Camera2D" type="Camera2D" parent="."] +position = Vector2(0, -125) diff --git a/Examples/tutorial-oyvtzwujcy0/icon.svg b/Examples/tutorial-oyvtzwujcy0/icon.svg new file mode 100644 index 0000000..9d8b7fa --- /dev/null +++ b/Examples/tutorial-oyvtzwujcy0/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Examples/tutorial-oyvtzwujcy0/icon.svg.import b/Examples/tutorial-oyvtzwujcy0/icon.svg.import new file mode 100644 index 0000000..d0ce7b1 --- /dev/null +++ b/Examples/tutorial-oyvtzwujcy0/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dasxw18q3mppl" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +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/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 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/Examples/tutorial-oyvtzwujcy0/project.godot b/Examples/tutorial-oyvtzwujcy0/project.godot new file mode 100644 index 0000000..866278f --- /dev/null +++ b/Examples/tutorial-oyvtzwujcy0/project.godot @@ -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="tutorial-oyvTZWUjCy0" +run/main_scene="uid://bodk3sbrdedn2" +config/features=PackedStringArray("4.4", "GL Compatibility") +config/icon="res://icon.svg" + +[input] + +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":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null) +] +} +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":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null) +] +} +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":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null) +] +} +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":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null) +] +} + +[rendering] + +renderer/rendering_method="gl_compatibility" +renderer/rendering_method.mobile="gl_compatibility"