diff --git a/animal/logic/animal.gd b/animal/logic/animal.gd new file mode 100644 index 0000000..1395e02 --- /dev/null +++ b/animal/logic/animal.gd @@ -0,0 +1,9 @@ +extends CharacterBody2D + +@export_category("Select animal") +@export_enum("boris", "cow", "eagle", "goat", "pig", "wolf") +var animal_type: String = "eagle" + + +func _process(delta): + $AnimatedSprite2D.play(animal_type) diff --git a/animal/logic/animal.tscn b/animal/logic/animal.tscn new file mode 100644 index 0000000..1c86861 --- /dev/null +++ b/animal/logic/animal.tscn @@ -0,0 +1,181 @@ +[gd_scene load_steps=25 format=3 uid="uid://c1qhe5nhhlm4o"] + +[ext_resource type="Texture2D" uid="uid://cuts2whx8udow" path="res://assets/animals/animals3.png" id="1_2etul"] +[ext_resource type="Script" path="res://animal/logic/animal.gd" id="1_vk5pl"] +[ext_resource type="Texture2D" uid="uid://dqfj3ncvy2tsb" path="res://assets/animals/birds2.png" id="2_f3rib"] +[ext_resource type="Texture2D" uid="uid://guix6uchwx5g" path="res://assets/animals/animals1.png" id="3_7sdht"] + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_pkgbs"] +radius = 12.625 +height = 40.0 + +[sub_resource type="AtlasTexture" id="AtlasTexture_wgd33"] +atlas = ExtResource("1_2etul") +region = Rect2(252, 0, 42, 36) + +[sub_resource type="AtlasTexture" id="AtlasTexture_dfruc"] +atlas = ExtResource("1_2etul") +region = Rect2(294, 0, 42, 36) + +[sub_resource type="AtlasTexture" id="AtlasTexture_6snq7"] +atlas = ExtResource("1_2etul") +region = Rect2(336, 0, 42, 36) + +[sub_resource type="AtlasTexture" id="AtlasTexture_wvfvy"] +atlas = ExtResource("1_2etul") +region = Rect2(84, 0, 42, 36) + +[sub_resource type="AtlasTexture" id="AtlasTexture_wx2s2"] +atlas = ExtResource("1_2etul") +region = Rect2(0, 0, 42, 36) + +[sub_resource type="AtlasTexture" id="AtlasTexture_utirk"] +atlas = ExtResource("1_2etul") +region = Rect2(42, 0, 42, 36) + +[sub_resource type="AtlasTexture" id="AtlasTexture_q7sln"] +atlas = ExtResource("2_f3rib") +region = Rect2(0, 36, 42, 36) + +[sub_resource type="AtlasTexture" id="AtlasTexture_gxi8u"] +atlas = ExtResource("2_f3rib") +region = Rect2(42, 36, 42, 36) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pq870"] +atlas = ExtResource("2_f3rib") +region = Rect2(84, 36, 42, 36) + +[sub_resource type="AtlasTexture" id="AtlasTexture_enegv"] +atlas = ExtResource("1_2etul") +region = Rect2(252, 144, 42, 36) + +[sub_resource type="AtlasTexture" id="AtlasTexture_rma82"] +atlas = ExtResource("1_2etul") +region = Rect2(294, 144, 42, 36) + +[sub_resource type="AtlasTexture" id="AtlasTexture_dx4ep"] +atlas = ExtResource("1_2etul") +region = Rect2(336, 144, 42, 36) + +[sub_resource type="AtlasTexture" id="AtlasTexture_kw0t3"] +atlas = ExtResource("1_2etul") +region = Rect2(0, 144, 42, 36) + +[sub_resource type="AtlasTexture" id="AtlasTexture_2iegb"] +atlas = ExtResource("1_2etul") +region = Rect2(42, 144, 42, 36) + +[sub_resource type="AtlasTexture" id="AtlasTexture_odqsp"] +atlas = ExtResource("1_2etul") +region = Rect2(84, 144, 42, 36) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4kh3h"] +atlas = ExtResource("3_7sdht") +region = Rect2(78, 0, 26, 36) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pwx0o"] +atlas = ExtResource("3_7sdht") +region = Rect2(104, 0, 26, 36) + +[sub_resource type="AtlasTexture" id="AtlasTexture_voqku"] +atlas = ExtResource("3_7sdht") +region = Rect2(130, 0, 26, 36) + +[sub_resource type="SpriteFrames" id="SpriteFrames_rxtr0"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_wgd33") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_dfruc") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_6snq7") +}], +"loop": true, +"name": &"boris", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_wvfvy") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_wx2s2") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_utirk") +}], +"loop": true, +"name": &"cow", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_q7sln") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_gxi8u") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_pq870") +}], +"loop": true, +"name": &"eagle", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_enegv") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_rma82") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_dx4ep") +}], +"loop": true, +"name": &"goat", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_kw0t3") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_2iegb") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_odqsp") +}], +"loop": true, +"name": &"pig", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_4kh3h") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_pwx0o") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_voqku") +}], +"loop": true, +"name": &"wolf", +"speed": 5.0 +}] + +[node name="Animal" type="CharacterBody2D"] +script = ExtResource("1_vk5pl") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(0, -2) +shape = SubResource("CapsuleShape2D_pkgbs") +debug_color = Color(0, 0.6, 0.701961, 0.419608) + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +sprite_frames = SubResource("SpriteFrames_rxtr0") +animation = &"eagle" diff --git a/assets/animals/animals1.png b/assets/animals/animals1.png new file mode 100644 index 0000000..b7cf575 Binary files /dev/null and b/assets/animals/animals1.png differ diff --git a/assets/animals/animals1.png.import b/assets/animals/animals1.png.import new file mode 100644 index 0000000..41a5307 --- /dev/null +++ b/assets/animals/animals1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://guix6uchwx5g" +path="res://.godot/imported/animals1.png-3611653d17519d57ce6469421893a31f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/animals/animals1.png" +dest_files=["res://.godot/imported/animals1.png-3611653d17519d57ce6469421893a31f.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/assets/animals/animals3.png b/assets/animals/animals3.png new file mode 100644 index 0000000..478a3b1 Binary files /dev/null and b/assets/animals/animals3.png differ diff --git a/assets/animals/animals3.png.import b/assets/animals/animals3.png.import new file mode 100644 index 0000000..4e62afc --- /dev/null +++ b/assets/animals/animals3.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cuts2whx8udow" +path="res://.godot/imported/animals3.png-8460b18897b00ce3cac3ebb77bea37cc.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/animals/animals3.png" +dest_files=["res://.godot/imported/animals3.png-8460b18897b00ce3cac3ebb77bea37cc.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/assets/animals/birds2.png b/assets/animals/birds2.png new file mode 100644 index 0000000..8160595 Binary files /dev/null and b/assets/animals/birds2.png differ diff --git a/assets/animals/birds2.png.import b/assets/animals/birds2.png.import new file mode 100644 index 0000000..884caff --- /dev/null +++ b/assets/animals/birds2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dqfj3ncvy2tsb" +path="res://.godot/imported/birds2.png-847ec399081de5d9eea6e37da19d50cb.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/animals/birds2.png" +dest_files=["res://.godot/imported/birds2.png-847ec399081de5d9eea6e37da19d50cb.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/assets/player/noah/idle/Idle.png b/assets/player/noah/idle/Idle.png new file mode 100644 index 0000000..9c872bb Binary files /dev/null and b/assets/player/noah/idle/Idle.png differ diff --git a/assets/player/noah/idle/Idle.png.import b/assets/player/noah/idle/Idle.png.import new file mode 100644 index 0000000..c631b9d --- /dev/null +++ b/assets/player/noah/idle/Idle.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dc5no7c7cefce" +path="res://.godot/imported/Idle.png-9224dda04ecff8de0bd57e3949ff7e4e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/player/noah/idle/Idle.png" +dest_files=["res://.godot/imported/Idle.png-9224dda04ecff8de0bd57e3949ff7e4e.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/main_game.gd b/main_game.gd index 1159299..1b25c5a 100644 --- a/main_game.gd +++ b/main_game.gd @@ -11,4 +11,3 @@ var score # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta): pass - diff --git a/main_game.tscn b/main_game.tscn index 631f952..37472db 100644 --- a/main_game.tscn +++ b/main_game.tscn @@ -5353,8 +5353,7 @@ volume_db = 5.0 [node name="Player" parent="." instance=ExtResource("5_jwt35")] position = Vector2(-1, 0) -[node name="Player@PlayerCamera" type="Camera2D" parent="Player"] +[node name="PlayerCamera" type="Camera2D" parent="Player"] position = Vector2(8, -7) -zoom = Vector2(3, 3) +zoom = Vector2(2.75, 2.75) position_smoothing_enabled = true -position_smoothing_speed = 12.0 diff --git a/player/player.gd b/player/player.gd index a93a9e9..06c6602 100644 --- a/player/player.gd +++ b/player/player.gd @@ -1,8 +1,9 @@ extends CharacterBody2D var speed = 100 # speed in pixels/sec -var direction = 0 +func _ready(): + $AnimatedSprite2D.play("idle") func get_input(): velocity = Vector2.ZERO @@ -39,4 +40,4 @@ func _process(delta): $AnimatedSprite2D.flip_v = false else: - $AnimatedSprite2D.stop() + $AnimatedSprite2D.play("idle") diff --git a/player/player.tscn b/player/player.tscn index 10c1a39..7f19fa7 100644 --- a/player/player.tscn +++ b/player/player.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=16 format=3 uid="uid://cq6vgoux4o34p"] +[gd_scene load_steps=19 format=3 uid="uid://cq6vgoux4o34p"] [ext_resource type="Script" path="res://player/player.gd" id="1_q81pp"] [ext_resource type="Texture2D" uid="uid://njafh0twmv1k" path="res://assets/player/noah/0.png" id="2_tmpf4"] @@ -13,10 +13,19 @@ [ext_resource type="Texture2D" uid="uid://byqkjk2d2trbo" path="res://assets/player/noah/back/2.png" id="8_nn0k3"] [ext_resource type="Texture2D" uid="uid://xu4yecfqcl0b" path="res://assets/player/noah/back/3.png" id="9_0sa6n"] [ext_resource type="Texture2D" uid="uid://bwoi5g0gdis1b" path="res://assets/player/noah/side/left/3.png" id="9_76ylr"] +[ext_resource type="Texture2D" uid="uid://dc5no7c7cefce" path="res://assets/player/noah/idle/Idle.png" id="10_6xgtw"] [sub_resource type="CircleShape2D" id="CircleShape2D_qdxc8"] radius = 41.8205 +[sub_resource type="AtlasTexture" id="AtlasTexture_w356c"] +atlas = ExtResource("10_6xgtw") +region = Rect2(0, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_7xiny"] +atlas = ExtResource("10_6xgtw") +region = Rect2(16, 0, 16, 16) + [sub_resource type="SpriteFrames" id="SpriteFrames_w7ef6"] animations = [{ "frames": [{ @@ -55,6 +64,17 @@ animations = [{ }, { "frames": [{ "duration": 1.0, +"texture": SubResource("AtlasTexture_w356c") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_7xiny") +}], +"loop": true, +"name": &"idle", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, "texture": ExtResource("6_rmhah") }, { "duration": 1.0, @@ -88,4 +108,5 @@ debug_color = Color(0.996078, 0, 0.184314, 0.419608) [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] position = Vector2(8, -8) sprite_frames = SubResource("SpriteFrames_w7ef6") -animation = &"front" +animation = &"idle" +frame_progress = 0.42748