we add simple enemy ai and added gamemanager
This commit is contained in:
1 parent
8ce6a444b7
commit
9a70b862ec
19 files changed
+540
-8
No files matched your search
@@ -0,0 +1,113 @@
|
||||
[gd_scene load_steps=17 format=3 uid="uid://cjv23ykm5q7rf"]
|
||||
|
||||
[ext_resource type="Script" path="res://Sripts/coin.gd" id="1_keqhv"]
|
||||
[ext_resource type="Texture2D" uid="uid://wpp0ajwperl6" path="res://Assets/Graphics/Pickups/coin.png" id="1_tuil2"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_r7c6j"]
|
||||
atlas = ExtResource("1_tuil2")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vnnmv"]
|
||||
atlas = ExtResource("1_tuil2")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_s2g0s"]
|
||||
atlas = ExtResource("1_tuil2")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_cs01d"]
|
||||
atlas = ExtResource("1_tuil2")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gsf1o"]
|
||||
atlas = ExtResource("1_tuil2")
|
||||
region = Rect2(64, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gkdsi"]
|
||||
atlas = ExtResource("1_tuil2")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_uxpdn"]
|
||||
atlas = ExtResource("1_tuil2")
|
||||
region = Rect2(96, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_lmo50"]
|
||||
atlas = ExtResource("1_tuil2")
|
||||
region = Rect2(112, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1s51c"]
|
||||
atlas = ExtResource("1_tuil2")
|
||||
region = Rect2(128, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_7iqrr"]
|
||||
atlas = ExtResource("1_tuil2")
|
||||
region = Rect2(144, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_7wyft"]
|
||||
atlas = ExtResource("1_tuil2")
|
||||
region = Rect2(160, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_58t0w"]
|
||||
atlas = ExtResource("1_tuil2")
|
||||
region = Rect2(176, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_6vaah"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_r7c6j")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_vnnmv")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_s2g0s")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_cs01d")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_gsf1o")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_gkdsi")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_uxpdn")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_lmo50")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_1s51c")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_7iqrr")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_7wyft")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_58t0w")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"Idle",
|
||||
"speed": 12.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_reynp"]
|
||||
radius = 6.08276
|
||||
|
||||
[node name="Coin" type="Area2D"]
|
||||
script = ExtResource("1_keqhv")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
sprite_frames = SubResource("SpriteFrames_6vaah")
|
||||
animation = &"Idle"
|
||||
autoplay = "Idle"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_reynp")
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=11 format=4 uid="uid://bnrrbkgwh35jy"]
|
||||
[gd_scene load_steps=13 format=4 uid="uid://bnrrbkgwh35jy"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cfqqqoobv1fit" path="res://Assets/Graphics/Environment/Background/forestbackground.png" id="1_02hc3"]
|
||||
[ext_resource type="PackedScene" uid="uid://bq1tvv23y61by" path="res://Scenes/Crate.tscn" id="1_8ldta"]
|
||||
@@ -7,6 +7,8 @@
|
||||
[ext_resource type="Texture2D" uid="uid://b80n7lhw6e1mh" path="res://Assets/Graphics/Environment/Terrain (32x32).png" id="2_hfhl3"]
|
||||
[ext_resource type="PackedScene" uid="uid://crvsom7i1waff" path="res://Scenes/Player.tscn" id="2_vxspj"]
|
||||
[ext_resource type="PackedScene" uid="uid://cb1km20mpc3ag" path="res://Scenes/Trigger.tscn" id="3_sr8fi"]
|
||||
[ext_resource type="PackedScene" uid="uid://cjv23ykm5q7rf" path="res://Scenes/Coin.tscn" id="8_6qk41"]
|
||||
[ext_resource type="PackedScene" uid="uid://dy8nl43lpcmka" path="res://Scenes/Slime.tscn" id="9_tn371"]
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_kvyqi"]
|
||||
texture = ExtResource("2_hfhl3")
|
||||
@@ -379,6 +381,7 @@ sources/0 = SubResource("TileSetAtlasSource_kvyqi")
|
||||
[node name="World" type="Node2D"]
|
||||
|
||||
[node name="Background" type="Parallax2D" parent="."]
|
||||
texture_filter = 1
|
||||
repeat_size = Vector2(320, 0)
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
@@ -388,6 +391,7 @@ texture = ExtResource("1_02hc3")
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
[node name="Sprite2D2" type="Sprite2D" parent="Background"]
|
||||
texture_filter = 1
|
||||
position = Vector2(160, 90)
|
||||
texture = ExtResource("2_cpwg1")
|
||||
metadata/_edit_group_ = true
|
||||
@@ -396,8 +400,10 @@ metadata/_edit_group_ = true
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("1_j03ar")
|
||||
|
||||
[node name="Timer" type="Timer" parent="SceneManager"]
|
||||
|
||||
[node name="TileMapLayer" type="TileMapLayer" parent="."]
|
||||
tile_map_data = PackedByteArray("AAD4/wQAAAAHAAEAAAD5/wQAAAAGAAAAAAD6/wQAAAAGAAEAAAD8/wQAAAABAAAAAAD9/wQAAAANAAMAAAD+/wQAAAAQAAMAAADy/wUAAAAAAAQAAADz/wUAAAABAAQAAAD0/wUAAAABAAQAAAD1/wUAAAAKAAQAAAD2/wUAAAAJAAQAAAD3/wUAAAABAAIAAAD4/wUAAAABAAIAAAD5/wUAAAABAAIAAAD6/wUAAAABAAIAAAD7/wUAAAAJAAQAAAD8/wUAAAABAAIAAAD9/wUAAAABAAIAAAD+/wUAAAAMAAQAAAD//wUAAAABAAQAAAAAAAUAAAABAAQAAAABAAUAAAABAAQAAAACAAUAAAABAAQAAAADAAUAAAABAAQAAAAEAAUAAAABAAQAAAAGAAUAAAABAAQAAAAFAAUAAAABAAQAAAAHAAUAAAABAAQAAAAIAAUAAAABAAQAAAANAAUAAAABAAQAAAAMAAUAAAABAAQAAAALAAUAAAABAAQAAAAKAAUAAAABAAQAAAAJAAUAAAABA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AAAAQAAQAAAASAAQAAAACAAAAAAAQAAUAAAAAAAIAAAARAAUAAAABAAIAAAASAAUAAAACAAIAAAAPAAQAAAAPAAMAAAAQAAQAAAANAAMAAAARAAQAAAAJAAMAAAA=")
|
||||
tile_set = SubResource("TileSet_ge2ih")
|
||||
|
||||
[node name="BottomWorld" type="StaticBody2D" parent="."]
|
||||
@@ -431,3 +437,27 @@ metadata/_edit_group_ = true
|
||||
[node name="BoxTrapTarget" type="Node2D" parent="."]
|
||||
position = Vector2(321, -49)
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
[node name="coins" type="Node" parent="."]
|
||||
|
||||
[node name="coin" parent="coins" instance=ExtResource("8_6qk41")]
|
||||
position = Vector2(217, 101)
|
||||
|
||||
[node name="coin2" parent="coins" instance=ExtResource("8_6qk41")]
|
||||
position = Vector2(231, 87)
|
||||
|
||||
[node name="coin3" parent="coins" instance=ExtResource("8_6qk41")]
|
||||
position = Vector2(248, 74)
|
||||
|
||||
[node name="coin4" parent="coins" instance=ExtResource("8_6qk41")]
|
||||
position = Vector2(265, 70)
|
||||
|
||||
[node name="Enemies" type="Node" parent="."]
|
||||
|
||||
[node name="Slime" parent="Enemies" instance=ExtResource("9_tn371")]
|
||||
position = Vector2(499, 115)
|
||||
|
||||
[node name="Slime2" parent="Enemies" instance=ExtResource("9_tn371")]
|
||||
position = Vector2(59, 146)
|
||||
|
||||
[connection signal="timeout" from="SceneManager/Timer" to="SceneManager" method="resetworld"]
|
||||
@@ -1,10 +1,51 @@
|
||||
[gd_scene load_steps=28 format=3 uid="uid://crvsom7i1waff"]
|
||||
[gd_scene load_steps=39 format=3 uid="uid://crvsom7i1waff"]
|
||||
|
||||
[ext_resource type="Script" path="res://Sripts/player.gd" id="1_jdiv6"]
|
||||
[ext_resource type="Texture2D" uid="uid://6qj1h70yjivd" path="res://Assets/Graphics/Player/Death/Player Death 64x64.png" id="2_4fy80"]
|
||||
[ext_resource type="Texture2D" uid="uid://csjeohonmkkov" path="res://Assets/Graphics/Player/Idle/Player Idle 48x48.png" id="2_ow1rs"]
|
||||
[ext_resource type="Texture2D" uid="uid://4b3eimvxs4xa" path="res://Assets/Graphics/Player/Jump/player jump 48x48.png" id="3_d7uya"]
|
||||
[ext_resource type="Texture2D" uid="uid://7jk3tlc1nyw2" path="res://Assets/Graphics/Player/Run/player run 48x48.png" id="3_kgjol"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_h2ctk"]
|
||||
atlas = ExtResource("2_4fy80")
|
||||
region = Rect2(0, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_33q0u"]
|
||||
atlas = ExtResource("2_4fy80")
|
||||
region = Rect2(48, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0y4j2"]
|
||||
atlas = ExtResource("2_4fy80")
|
||||
region = Rect2(96, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2thpi"]
|
||||
atlas = ExtResource("2_4fy80")
|
||||
region = Rect2(144, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_rlvdk"]
|
||||
atlas = ExtResource("2_4fy80")
|
||||
region = Rect2(192, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_fulye"]
|
||||
atlas = ExtResource("2_4fy80")
|
||||
region = Rect2(240, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5bk41"]
|
||||
atlas = ExtResource("2_4fy80")
|
||||
region = Rect2(288, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_7im3l"]
|
||||
atlas = ExtResource("2_4fy80")
|
||||
region = Rect2(336, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kpvqi"]
|
||||
atlas = ExtResource("2_4fy80")
|
||||
region = Rect2(384, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_55tgt"]
|
||||
atlas = ExtResource("2_4fy80")
|
||||
region = Rect2(432, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ogmew"]
|
||||
atlas = ExtResource("2_ow1rs")
|
||||
region = Rect2(0, 0, 48, 48)
|
||||
@@ -93,6 +134,41 @@ region = Rect2(336, 0, 48, 48)
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_h2ctk")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_33q0u")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_0y4j2")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_2thpi")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_rlvdk")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_fulye")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_5bk41")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_7im3l")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_kpvqi")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_55tgt")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"Death",
|
||||
"speed": 7.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ogmew")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
@@ -124,7 +200,7 @@ animations = [{
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"Idle",
|
||||
"speed": 15.0
|
||||
"speed": 12.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
@@ -167,7 +243,7 @@ animations = [{
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"Run",
|
||||
"speed": 15.0
|
||||
"speed": 12.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_t5iiu"]
|
||||
@@ -179,9 +255,9 @@ script = ExtResource("1_jdiv6")
|
||||
texture_filter = 1
|
||||
position = Vector2(0, -6)
|
||||
sprite_frames = SubResource("SpriteFrames_f8fvt")
|
||||
animation = &"Jump"
|
||||
animation = &"Death"
|
||||
autoplay = "Idle"
|
||||
frame = 1
|
||||
frame = 9
|
||||
frame_progress = 1.0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://dy8nl43lpcmka"]
|
||||
|
||||
[ext_resource type="Script" path="res://Sripts/slime.gd" id="1_2xgu3"]
|
||||
[ext_resource type="Texture2D" uid="uid://lpbq4n22w1ig" path="res://Assets/Graphics/Enemies/slime_green.png" id="1_6sd47"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_feiyc"]
|
||||
atlas = ExtResource("1_6sd47")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_jvyy4"]
|
||||
atlas = ExtResource("1_6sd47")
|
||||
region = Rect2(24, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_g8dot"]
|
||||
atlas = ExtResource("1_6sd47")
|
||||
region = Rect2(48, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dc6ki"]
|
||||
atlas = ExtResource("1_6sd47")
|
||||
region = Rect2(72, 24, 24, 24)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_kycl6"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_feiyc")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_jvyy4")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_g8dot")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_dc6ki")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 12.0
|
||||
}]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ujgd7"]
|
||||
size = Vector2(15, 12.5)
|
||||
|
||||
[node name="Slime" type="Area2D"]
|
||||
script = ExtResource("1_2xgu3")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
position = Vector2(0, -2)
|
||||
scale = Vector2(1.2, 1.2)
|
||||
sprite_frames = SubResource("SpriteFrames_kycl6")
|
||||
animation = &"idle"
|
||||
autoplay = "idle"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, 5.5)
|
||||
scale = Vector2(1.2, 1.2)
|
||||
shape = SubResource("RectangleShape2D_ujgd7")
|
||||
|
||||
[node name="CastRight" type="RayCast2D" parent="."]
|
||||
target_position = Vector2(15, 0)
|
||||
|
||||
[node name="CastLeft" type="RayCast2D" parent="."]
|
||||
target_position = Vector2(-15, 0)
|
||||
|
||||
[node name="CastFloorRight" type="RayCast2D" parent="."]
|
||||
position = Vector2(9, 0)
|
||||
target_position = Vector2(0, 17)
|
||||
|
||||
[node name="CastFloorLeft" type="RayCast2D" parent="."]
|
||||
position = Vector2(-9, 0)
|
||||
target_position = Vector2(0, 17)
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
Reference in new issue
Block a user