commit bc871c28499004536752abb09fd2d4f16e737877 Author: Joseph Ferano Date: Wed Sep 27 23:09:16 2023 +0700 First commit with character impot and some animations setup diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -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 index 0000000..0088890 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Godot 4+ specific ignores +.godot/ +/Assets/ diff --git a/Project/Code/Character.gd b/Project/Code/Character.gd new file mode 100644 index 0000000..1fd11a4 --- /dev/null +++ b/Project/Code/Character.gd @@ -0,0 +1,18 @@ +extends CharacterBody2D + +var gravity = 15 + +func _physics_process(delta): + if !is_on_floor(): + velocity.y += 15 + move_and_slide() + $AnimationPlayer.play('Idle') + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass diff --git a/Project/Code/Game.gd b/Project/Code/Game.gd new file mode 100644 index 0000000..e69de29 diff --git a/Project/Import/Sprites/Character Idle 48x48.png b/Project/Import/Sprites/Character Idle 48x48.png new file mode 100644 index 0000000..4cf0c43 Binary files /dev/null and b/Project/Import/Sprites/Character Idle 48x48.png differ diff --git a/Project/Import/Sprites/Character Idle 48x48.png.import b/Project/Import/Sprites/Character Idle 48x48.png.import new file mode 100644 index 0000000..a381c73 --- /dev/null +++ b/Project/Import/Sprites/Character Idle 48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://wfwjlevruveu" +path="res://.godot/imported/Character Idle 48x48.png-e818cccd56fabd6e74335d7aef0128fe.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Import/Sprites/Character Idle 48x48.png" +dest_files=["res://.godot/imported/Character Idle 48x48.png-e818cccd56fabd6e74335d7aef0128fe.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 diff --git a/Project/Import/Sprites/PlayerWalk 48x48.png b/Project/Import/Sprites/PlayerWalk 48x48.png new file mode 100644 index 0000000..653bd2f Binary files /dev/null and b/Project/Import/Sprites/PlayerWalk 48x48.png differ diff --git a/Project/Import/Sprites/PlayerWalk 48x48.png.import b/Project/Import/Sprites/PlayerWalk 48x48.png.import new file mode 100644 index 0000000..8d37d3a --- /dev/null +++ b/Project/Import/Sprites/PlayerWalk 48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bge22c82umdui" +path="res://.godot/imported/PlayerWalk 48x48.png-515d03200db301480a3b6aca65977d00.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Import/Sprites/PlayerWalk 48x48.png" +dest_files=["res://.godot/imported/PlayerWalk 48x48.png-515d03200db301480a3b6aca65977d00.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 diff --git a/Project/Import/Sprites/player jump 48x48.png b/Project/Import/Sprites/player jump 48x48.png new file mode 100644 index 0000000..dff105c Binary files /dev/null and b/Project/Import/Sprites/player jump 48x48.png differ diff --git a/Project/Import/Sprites/player jump 48x48.png.import b/Project/Import/Sprites/player jump 48x48.png.import new file mode 100644 index 0000000..11295ff --- /dev/null +++ b/Project/Import/Sprites/player jump 48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://8ikuchoh7pyd" +path="res://.godot/imported/player jump 48x48.png-1218737f8d751189d0a06e13109edf43.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Import/Sprites/player jump 48x48.png" +dest_files=["res://.godot/imported/player jump 48x48.png-1218737f8d751189d0a06e13109edf43.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 diff --git a/Project/Import/Sprites/player land 48x48.png b/Project/Import/Sprites/player land 48x48.png new file mode 100644 index 0000000..2c24d6f Binary files /dev/null and b/Project/Import/Sprites/player land 48x48.png differ diff --git a/Project/Import/Sprites/player land 48x48.png.import b/Project/Import/Sprites/player land 48x48.png.import new file mode 100644 index 0000000..8e9e024 --- /dev/null +++ b/Project/Import/Sprites/player land 48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://diiqvgeqnmn1c" +path="res://.godot/imported/player land 48x48.png-b9344e7cbe5a23cec3451034ac61dde1.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Import/Sprites/player land 48x48.png" +dest_files=["res://.godot/imported/player land 48x48.png-b9344e7cbe5a23cec3451034ac61dde1.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 diff --git a/Project/Import/Sprites/run cycle 48x48.png b/Project/Import/Sprites/run cycle 48x48.png new file mode 100644 index 0000000..615b222 Binary files /dev/null and b/Project/Import/Sprites/run cycle 48x48.png differ diff --git a/Project/Import/Sprites/run cycle 48x48.png.import b/Project/Import/Sprites/run cycle 48x48.png.import new file mode 100644 index 0000000..621e688 --- /dev/null +++ b/Project/Import/Sprites/run cycle 48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://y8syonuki304" +path="res://.godot/imported/run cycle 48x48.png-fedde8f98f006f99b378846f35798af7.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Import/Sprites/run cycle 48x48.png" +dest_files=["res://.godot/imported/run cycle 48x48.png-fedde8f98f006f99b378846f35798af7.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 diff --git a/Project/Scenes/Main.tscn b/Project/Scenes/Main.tscn new file mode 100644 index 0000000..82ae48e --- /dev/null +++ b/Project/Scenes/Main.tscn @@ -0,0 +1,24 @@ +[gd_scene load_steps=4 format=3 uid="uid://dr8vg4b1eh6i"] + +[ext_resource type="PackedScene" uid="uid://dv08bvquqpc8d" path="res://Scenes/Player.tscn" id="1_ibeo8"] + +[sub_resource type="QuadMesh" id="QuadMesh_n5vip"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_s46ls"] +size = Vector2(300, 20) + +[node name="Node2D" type="Node2D"] + +[node name="Player" parent="." instance=ExtResource("1_ibeo8")] +position = Vector2(80, 82) + +[node name="StaticBody2D" type="StaticBody2D" parent="."] +position = Vector2(198, 184) + +[node name="MeshInstance2D" type="MeshInstance2D" parent="StaticBody2D"] +modulate = Color(0.168627, 0.678431, 0.701961, 1) +scale = Vector2(300, 20) +mesh = SubResource("QuadMesh_n5vip") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"] +shape = SubResource("RectangleShape2D_s46ls") diff --git a/Project/Scenes/Player.tscn b/Project/Scenes/Player.tscn new file mode 100644 index 0000000..b1f3ea9 --- /dev/null +++ b/Project/Scenes/Player.tscn @@ -0,0 +1,237 @@ +[gd_scene load_steps=13 format=3 uid="uid://dv08bvquqpc8d"] + +[ext_resource type="Texture2D" uid="uid://wfwjlevruveu" path="res://Import/Sprites/Character Idle 48x48.png" id="1_7u4sn"] +[ext_resource type="Texture2D" uid="uid://bge22c82umdui" path="res://Import/Sprites/PlayerWalk 48x48.png" id="1_h6xei"] +[ext_resource type="Script" path="res://Code/Character.gd" id="1_v1ece"] +[ext_resource type="Texture2D" uid="uid://8ikuchoh7pyd" path="res://Import/Sprites/player jump 48x48.png" id="3_ye2je"] +[ext_resource type="Texture2D" uid="uid://y8syonuki304" path="res://Import/Sprites/run cycle 48x48.png" id="4_2cq86"] + +[sub_resource type="Animation" id="Animation_vrt4p"] +resource_name = "Idle" +length = 1.3 +step = 0.05 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:texture") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [ExtResource("1_7u4sn")] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath(".:hframes") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [10] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath(".:frame") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 1, +"values": [0, 1, 2, 3, 4, 5, 5, 6, 7] +} + +[sub_resource type="Animation" id="Animation_1l7dh"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [0] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath(".:texture") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [ExtResource("1_h6xei")] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath(".:hframes") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [10] +} + +[sub_resource type="Animation" id="Animation_dl063"] +resource_name = "Walk" +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:texture") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [ExtResource("1_h6xei")] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath(".:hframes") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [8] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath(".:frame") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1), +"update": 1, +"values": [0, 1, 2, 3, 4, 5, 6] +} + +[sub_resource type="Animation" id="Animation_2yfkp"] +resource_name = "Jump" +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:texture") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [ExtResource("3_ye2je")] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath(".:hframes") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [3] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath(".:frame") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0, 0.1, 0.2), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 1, +"values": [0, 1, 2] +} + +[sub_resource type="Animation" id="Animation_oejr4"] +resource_name = "Run" +length = 0.75 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:texture") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [ExtResource("4_2cq86")] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath(".:hframes") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [8] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath(".:frame") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1), +"update": 1, +"values": [0, 1, 2, 3, 4, 5, 6, 7] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_6srtp"] +_data = { +"Idle": SubResource("Animation_vrt4p"), +"Land": SubResource("Animation_2yfkp"), +"RESET": SubResource("Animation_1l7dh"), +"Run": SubResource("Animation_oejr4"), +"Walk": SubResource("Animation_dl063") +} + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_wc2sw"] +size = Vector2(16, 29) + +[node name="Player" type="CharacterBody2D"] +script = ExtResource("1_v1ece") + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +root_node = NodePath("../Sprites") +autoplay = "Idle" +libraries = { +"": SubResource("AnimationLibrary_6srtp") +} + +[node name="Sprites" type="Sprite2D" parent="."] +texture_filter = 1 +position = Vector2(0, -16) +texture = ExtResource("1_h6xei") +hframes = 10 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(0, -14.5) +shape = SubResource("RectangleShape2D_wc2sw") diff --git a/Project/project.godot b/Project/project.godot new file mode 100644 index 0000000..b15442f --- /dev/null +++ b/Project/project.godot @@ -0,0 +1,22 @@ +; 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="tenchu" +run/main_scene="res://Scenes/Main.tscn" +config/features=PackedStringArray("4.1", "Forward Plus") +config/icon="res://icon.svg" + +[display] + +window/size/viewport_width=500 +window/size/viewport_height=300 +window/stretch/scale=2.0 diff --git a/README.org b/README.org new file mode 100644 index 0000000..e69de29