Compare commits
No commits in common. "main" and "playerdeath" have entirely different histories.
main
...
playerdeat
Binary file not shown.
Before Width: | Height: | Size: 2.2 KiB |
@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://dqa6ro66e3j1d"
|
|
||||||
path="res://.godot/imported/foreground.png-dbbd7dc92b4c96ae99e46b292c2d728f.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://assets/graphics/environment/foreground.png"
|
|
||||||
dest_files=["res://.godot/imported/foreground.png-dbbd7dc92b4c96ae99e46b292c2d728f.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
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB |
@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://chroktky8p0g1"
|
|
||||||
path="res://.godot/imported/Player Hurt 48x48.png-a720e51cb19103e76b22ab6c1b81302d.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://assets/graphics/player/hurt/Player Hurt 48x48.png"
|
|
||||||
dest_files=["res://.godot/imported/Player Hurt 48x48.png-a720e51cb19103e76b22ab6c1b81302d.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
|
|
Binary file not shown.
Before Width: | Height: | Size: 3.2 KiB |
@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://c0oo6kno61i0b"
|
|
||||||
path="res://.godot/imported/Player Punch 64x64.png-d36156dc820906936bd540ab6e3cc9ce.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://assets/graphics/player/punch/Player Punch 64x64.png"
|
|
||||||
dest_files=["res://.godot/imported/Player Punch 64x64.png-d36156dc820906936bd540ab6e3cc9ce.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
|
|
@ -20,5 +20,4 @@ rotation = 3.14794
|
|||||||
scale = Vector2(0.09375, 0.09375)
|
scale = Vector2(0.09375, 0.09375)
|
||||||
texture = ExtResource("2_veygi")
|
texture = ExtResource("2_veygi")
|
||||||
|
|
||||||
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
|
|
||||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=17 format=4 uid="uid://diss5ty7548p3"]
|
[gd_scene load_steps=15 format=4 uid="uid://diss5ty7548p3"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://cjdayl6k7xt2s" path="res://assets/graphics/environment/background/forestbackground.png" id="1_7cw2b"]
|
[ext_resource type="Texture2D" uid="uid://cjdayl6k7xt2s" path="res://assets/graphics/environment/background/forestbackground.png" id="1_7cw2b"]
|
||||||
[ext_resource type="PackedScene" uid="uid://0j0320rcnxo7" path="res://scenes/crate.tscn" id="1_8ekmb"]
|
[ext_resource type="PackedScene" uid="uid://0j0320rcnxo7" path="res://scenes/crate.tscn" id="1_8ekmb"]
|
||||||
@ -10,8 +10,6 @@
|
|||||||
[ext_resource type="PackedScene" uid="uid://csewven6s5npw" path="res://scenes/trigger.tscn" id="3_t3xge"]
|
[ext_resource type="PackedScene" uid="uid://csewven6s5npw" path="res://scenes/trigger.tscn" id="3_t3xge"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dkqrujmfd1dt4" path="res://scenes/coin.tscn" id="3_xdwxn"]
|
[ext_resource type="PackedScene" uid="uid://dkqrujmfd1dt4" path="res://scenes/coin.tscn" id="3_xdwxn"]
|
||||||
[ext_resource type="PackedScene" uid="uid://chg3b7bwi8e5v" path="res://scenes/badguy.tscn" id="10_wtwdm"]
|
[ext_resource type="PackedScene" uid="uid://chg3b7bwi8e5v" path="res://scenes/badguy.tscn" id="10_wtwdm"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dw0mifscsrgaw" path="res://scenes/ui.tscn" id="11_41b0s"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://dqa6ro66e3j1d" path="res://assets/graphics/environment/foreground.png" id="12_1m160"]
|
|
||||||
|
|
||||||
[sub_resource type="TileMapPattern" id="TileMapPattern_pcobp"]
|
[sub_resource type="TileMapPattern" id="TileMapPattern_pcobp"]
|
||||||
tile_data = PackedInt32Array(0, 0, 4, 1, 65536, 4, 2, 65536, 4, 3, 131072, 4)
|
tile_data = PackedInt32Array(0, 0, 4, 1, 65536, 4, 2, 65536, 4, 3, 131072, 4)
|
||||||
@ -421,11 +419,11 @@ script = ExtResource("1_mpwqj")
|
|||||||
[node name="Timer" type="Timer" parent="SceneManager"]
|
[node name="Timer" type="Timer" parent="SceneManager"]
|
||||||
|
|
||||||
[node name="TileMapLayer" type="TileMapLayer" parent="."]
|
[node name="TileMapLayer" type="TileMapLayer" parent="."]
|
||||||
tile_map_data = PackedByteArray("AAACAAUAAAAPAAQAAAADAAUAAAABAAQAAAAEAAUAAAABAAQAAAAFAAUAAAABAAQAAAAHAAQAAAAAAAIAAAAIAAQAAAABAAIAAAAJAAQAAAACAAIAAAAJAAMAAAACAAAAAAAIAAMAAAABAAAAAAAHAAMAAAAAAAAAAAAIAAAAAAAEAAQAAAALAAIAAAAAAAQAAAAMAAIAAAAQAAQAAAAMAAEAAAAPAAMAAAANAAEAAAACAAQAAAAMAAUAAAAAAAQAAAANAAUAAAABAAQAAAAOAAUAAAABAAQAAAAPAAUAAAACAAQAAAAGAAUAAAACAAQAAAAQAAMAAAAAAAQAAAARAAMAAAABAAQAAAASAAMAAAACAAQAAAAUAAMAAAAEAAIAAAAUAAIAAAAPAAMAAAAVAAIAAAAMAAQAAAAWAAIAAAACAAIAAAAWAAEAAAACAAAAAAAVAAEAAAAPAAMAAAAUAAYAAAAAAAQAAAAVAAYAAAABAAQAAAAWAAYAAAACAAQAAAACAAQAAAAEAAAAAAAQAAAAAAAAAAQAAAARAAAAAAACAAQAAAAJAAcAAAAAAAQAAAAKAAcAAAABAAQAAAALAAcAAAABAAQAAAAMAAcAAAABAAQAAAANAAcAAAACAAQAAAAZAAQAAAAPAAQAAAAaAAQAAAABAAQAAAAbAAQAAAAQAAQAAAAbAAMAAAAEAAEAAAAbAAIAAAAQAAMAAAAaAAIAAAABAAQAAAAZAAIAAAAPAAMAAAAZAAMAAAAEAAEAAAAfAAEAAAAAAAQAAAAgAAEAAAABAAQAAAAhAAEAAAABAAQAAAAiAAEAAAABAAQAAAAjAAEAAAACAAQAAAAcAAYAAAAAAAQAAAAdAAYAAAABAAQAAAAeAAYAAAABAAQAAAAfAAYAAAAQAAQAAAAfAAUAAAAEAAEAAAAfAAQAAAAPAAMAAAAgAAQAAAABAAQAAAAhAAQAAAABAAQAAAAiAAQAAAACAAQAAAA=")
|
tile_map_data = PackedByteArray("AAACAAUAAAAPAAQAAAADAAUAAAABAAQAAAAEAAUAAAABAAQAAAAFAAUAAAABAAQAAAAHAAQAAAAAAAIAAAAIAAQAAAABAAIAAAAJAAQAAAACAAIAAAAJAAMAAAACAAAAAAAIAAMAAAABAAAAAAAHAAMAAAAAAAAAAAAIAAAAAAAEAAQAAAALAAIAAAAAAAQAAAAMAAIAAAAQAAQAAAAMAAEAAAAPAAMAAAANAAEAAAACAAQAAAAMAAUAAAAAAAQAAAANAAUAAAABAAQAAAAOAAUAAAABAAQAAAAPAAUAAAACAAQAAAAGAAUAAAACAAQAAAAQAAMAAAAAAAQAAAARAAMAAAABAAQAAAASAAMAAAACAAQAAAAUAAMAAAAEAAIAAAAUAAIAAAAPAAMAAAAVAAIAAAAMAAQAAAAWAAIAAAACAAIAAAAWAAEAAAACAAAAAAAVAAEAAAAPAAMAAAAUAAYAAAAAAAQAAAAVAAYAAAABAAQAAAAWAAYAAAACAAQAAAACAAQAAAAEAAAAAAA=")
|
||||||
tile_set = SubResource("TileSet_cs2mx")
|
tile_set = SubResource("TileSet_cs2mx")
|
||||||
|
|
||||||
[node name="Floor" type="StaticBody2D" parent="."]
|
[node name="Floor" type="StaticBody2D" parent="."]
|
||||||
position = Vector2(94, 160)
|
position = Vector2(94, 183)
|
||||||
metadata/_edit_group_ = true
|
metadata/_edit_group_ = true
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Floor"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Floor"]
|
||||||
@ -458,15 +456,6 @@ metadata/_edit_group_ = true
|
|||||||
[node name="Coin" parent="coins" instance=ExtResource("3_xdwxn")]
|
[node name="Coin" parent="coins" instance=ExtResource("3_xdwxn")]
|
||||||
position = Vector2(206, 151)
|
position = Vector2(206, 151)
|
||||||
|
|
||||||
[node name="Coin4" parent="coins" instance=ExtResource("3_xdwxn")]
|
|
||||||
position = Vector2(396, 155)
|
|
||||||
|
|
||||||
[node name="Coin5" parent="coins" instance=ExtResource("3_xdwxn")]
|
|
||||||
position = Vector2(588, 91)
|
|
||||||
|
|
||||||
[node name="Coin6" parent="coins" instance=ExtResource("3_xdwxn")]
|
|
||||||
position = Vector2(556, -5)
|
|
||||||
|
|
||||||
[node name="Coin2" parent="coins" instance=ExtResource("3_xdwxn")]
|
[node name="Coin2" parent="coins" instance=ExtResource("3_xdwxn")]
|
||||||
position = Vector2(263, 89)
|
position = Vector2(263, 89)
|
||||||
|
|
||||||
@ -478,32 +467,7 @@ position = Vector2(368, 57)
|
|||||||
[node name="slime" parent="enemies" instance=ExtResource("10_wtwdm")]
|
[node name="slime" parent="enemies" instance=ExtResource("10_wtwdm")]
|
||||||
position = Vector2(282, 84)
|
position = Vector2(282, 84)
|
||||||
|
|
||||||
[node name="slime3" parent="enemies" instance=ExtResource("10_wtwdm")]
|
|
||||||
position = Vector2(414, 20)
|
|
||||||
|
|
||||||
[node name="slime4" parent="enemies" instance=ExtResource("10_wtwdm")]
|
|
||||||
position = Vector2(455, 148)
|
|
||||||
|
|
||||||
[node name="slime5" parent="enemies" instance=ExtResource("10_wtwdm")]
|
|
||||||
position = Vector2(357, 212)
|
|
||||||
|
|
||||||
[node name="slime2" parent="enemies" instance=ExtResource("10_wtwdm")]
|
[node name="slime2" parent="enemies" instance=ExtResource("10_wtwdm")]
|
||||||
position = Vector2(106, 149)
|
position = Vector2(106, 149)
|
||||||
|
|
||||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
|
||||||
|
|
||||||
[node name="Control" parent="CanvasLayer" instance=ExtResource("11_41b0s")]
|
|
||||||
offset_left = 10.0
|
|
||||||
offset_top = 8.0
|
|
||||||
offset_right = -6.0
|
|
||||||
metadata/_edit_lock_ = true
|
|
||||||
|
|
||||||
[node name="Parallax2D" type="Parallax2D" parent="."]
|
|
||||||
scroll_scale = Vector2(2, 2)
|
|
||||||
repeat_size = Vector2(320, 0)
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="Parallax2D"]
|
|
||||||
position = Vector2(160, 130)
|
|
||||||
texture = ExtResource("12_1m160")
|
|
||||||
|
|
||||||
[connection signal="timeout" from="SceneManager/Timer" to="SceneManager" method="resetWorld"]
|
[connection signal="timeout" from="SceneManager/Timer" to="SceneManager" method="resetWorld"]
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
[gd_scene load_steps=49 format=3 uid="uid://dbgc24hrbtvxm"]
|
[gd_scene load_steps=39 format=3 uid="uid://dbgc24hrbtvxm"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/player.gd" id="1_5qpif"]
|
[ext_resource type="Script" path="res://scripts/player.gd" id="1_5qpif"]
|
||||||
[ext_resource type="Texture2D" uid="uid://d6d3re6epsh4" path="res://assets/graphics/player/death/Player Death 64x64.png" id="2_t1yra"]
|
[ext_resource type="Texture2D" uid="uid://d6d3re6epsh4" path="res://assets/graphics/player/death/Player Death 64x64.png" id="2_t1yra"]
|
||||||
[ext_resource type="Texture2D" uid="uid://pdvgf3y1lquv" path="res://assets/graphics/player/idle/Player Idle 48x48.png" id="2_vcmr0"]
|
[ext_resource type="Texture2D" uid="uid://pdvgf3y1lquv" path="res://assets/graphics/player/idle/Player Idle 48x48.png" id="2_vcmr0"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cvh48exhs1ir1" path="res://assets/graphics/player/run/player run 48x48.png" id="3_a03rx"]
|
[ext_resource type="Texture2D" uid="uid://cvh48exhs1ir1" path="res://assets/graphics/player/run/player run 48x48.png" id="3_a03rx"]
|
||||||
[ext_resource type="Texture2D" uid="uid://d0kfe5ms2vjbr" path="res://assets/graphics/player/jump/player jump 48x48.png" id="3_mvdmt"]
|
[ext_resource type="Texture2D" uid="uid://d0kfe5ms2vjbr" path="res://assets/graphics/player/jump/player jump 48x48.png" id="3_mvdmt"]
|
||||||
[ext_resource type="Texture2D" uid="uid://chroktky8p0g1" path="res://assets/graphics/player/hurt/Player Hurt 48x48.png" id="3_td76e"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://c0oo6kno61i0b" path="res://assets/graphics/player/punch/Player Punch 64x64.png" id="6_cp1mx"]
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_uru55"]
|
[sub_resource type="AtlasTexture" id="AtlasTexture_uru55"]
|
||||||
atlas = ExtResource("2_t1yra")
|
atlas = ExtResource("2_t1yra")
|
||||||
@ -48,22 +46,6 @@ region = Rect2(384, 0, 48, 48)
|
|||||||
atlas = ExtResource("2_t1yra")
|
atlas = ExtResource("2_t1yra")
|
||||||
region = Rect2(432, 0, 48, 48)
|
region = Rect2(432, 0, 48, 48)
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_tm0rm"]
|
|
||||||
atlas = ExtResource("3_td76e")
|
|
||||||
region = Rect2(0, 0, 48, 48)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_yv45b"]
|
|
||||||
atlas = ExtResource("3_td76e")
|
|
||||||
region = Rect2(48, 0, 48, 48)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qcxh5"]
|
|
||||||
atlas = ExtResource("3_td76e")
|
|
||||||
region = Rect2(96, 0, 48, 48)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_32phs"]
|
|
||||||
atlas = ExtResource("3_td76e")
|
|
||||||
region = Rect2(144, 0, 48, 48)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_etdvv"]
|
[sub_resource type="AtlasTexture" id="AtlasTexture_etdvv"]
|
||||||
atlas = ExtResource("2_vcmr0")
|
atlas = ExtResource("2_vcmr0")
|
||||||
region = Rect2(0, 0, 48, 48)
|
region = Rect2(0, 0, 48, 48)
|
||||||
@ -116,22 +98,6 @@ region = Rect2(48, 0, 48, 48)
|
|||||||
atlas = ExtResource("3_mvdmt")
|
atlas = ExtResource("3_mvdmt")
|
||||||
region = Rect2(96, 0, 48, 48)
|
region = Rect2(96, 0, 48, 48)
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_m3mm6"]
|
|
||||||
atlas = ExtResource("6_cp1mx")
|
|
||||||
region = Rect2(128, 0, 64, 64)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_651rh"]
|
|
||||||
atlas = ExtResource("6_cp1mx")
|
|
||||||
region = Rect2(192, 0, 64, 64)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_pwqvs"]
|
|
||||||
atlas = ExtResource("6_cp1mx")
|
|
||||||
region = Rect2(256, 0, 64, 64)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1vc4x"]
|
|
||||||
atlas = ExtResource("6_cp1mx")
|
|
||||||
region = Rect2(320, 0, 64, 64)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qxesk"]
|
[sub_resource type="AtlasTexture" id="AtlasTexture_qxesk"]
|
||||||
atlas = ExtResource("3_a03rx")
|
atlas = ExtResource("3_a03rx")
|
||||||
region = Rect2(0, 0, 48, 48)
|
region = Rect2(0, 0, 48, 48)
|
||||||
@ -203,23 +169,6 @@ animations = [{
|
|||||||
}, {
|
}, {
|
||||||
"frames": [{
|
"frames": [{
|
||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
"texture": SubResource("AtlasTexture_tm0rm")
|
|
||||||
}, {
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_yv45b")
|
|
||||||
}, {
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_qcxh5")
|
|
||||||
}, {
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_32phs")
|
|
||||||
}],
|
|
||||||
"loop": false,
|
|
||||||
"name": &"hurt",
|
|
||||||
"speed": 12.0
|
|
||||||
}, {
|
|
||||||
"frames": [{
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_etdvv")
|
"texture": SubResource("AtlasTexture_etdvv")
|
||||||
}, {
|
}, {
|
||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
@ -269,23 +218,6 @@ animations = [{
|
|||||||
}, {
|
}, {
|
||||||
"frames": [{
|
"frames": [{
|
||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
"texture": SubResource("AtlasTexture_m3mm6")
|
|
||||||
}, {
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_651rh")
|
|
||||||
}, {
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_pwqvs")
|
|
||||||
}, {
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_1vc4x")
|
|
||||||
}],
|
|
||||||
"loop": false,
|
|
||||||
"name": &"punch",
|
|
||||||
"speed": 12.0
|
|
||||||
}, {
|
|
||||||
"frames": [{
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_qxesk")
|
"texture": SubResource("AtlasTexture_qxesk")
|
||||||
}, {
|
}, {
|
||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
@ -318,12 +250,13 @@ animations = [{
|
|||||||
|
|
||||||
[node name="CharacterBody2D" type="CharacterBody2D"]
|
[node name="CharacterBody2D" type="CharacterBody2D"]
|
||||||
script = ExtResource("1_5qpif")
|
script = ExtResource("1_5qpif")
|
||||||
|
metadata/_edit_group_ = true
|
||||||
|
|
||||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
position = Vector2(0, -7)
|
position = Vector2(0, -7)
|
||||||
sprite_frames = SubResource("SpriteFrames_wlxdo")
|
sprite_frames = SubResource("SpriteFrames_wlxdo")
|
||||||
animation = &"idle"
|
animation = &"death"
|
||||||
autoplay = "idle"
|
autoplay = "idle"
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
@ -331,17 +264,13 @@ shape = SubResource("CircleShape2D_mcosy")
|
|||||||
debug_color = Color(0.826895, 0.282133, 0.703752, 0.42)
|
debug_color = Color(0.826895, 0.282133, 0.703752, 0.42)
|
||||||
|
|
||||||
[node name="RightRay" type="RayCast2D" parent="."]
|
[node name="RightRay" type="RayCast2D" parent="."]
|
||||||
target_position = Vector2(19, 0)
|
target_position = Vector2(16, 0)
|
||||||
collide_with_areas = true
|
|
||||||
|
|
||||||
[node name="LeftRay" type="RayCast2D" parent="."]
|
[node name="LeftRay" type="RayCast2D" parent="."]
|
||||||
target_position = Vector2(-19, 0)
|
target_position = Vector2(-17, 0)
|
||||||
collide_with_areas = true
|
|
||||||
|
|
||||||
[node name="MarkerRight" type="Node2D" parent="."]
|
[node name="MarkerRight" type="Node2D" parent="."]
|
||||||
position = Vector2(22, 0)
|
position = Vector2(12, -5)
|
||||||
|
|
||||||
[node name="MarkerLeft" type="Node2D" parent="."]
|
[node name="MarkerLeft" type="Node2D" parent="."]
|
||||||
position = Vector2(-21, 0)
|
position = Vector2(-15, -5)
|
||||||
|
|
||||||
[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animation_finished"]
|
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
[gd_scene load_steps=2 format=3 uid="uid://dw0mifscsrgaw"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/ui.gd" id="1_ndnyg"]
|
|
||||||
|
|
||||||
[node name="Control" type="Control"]
|
|
||||||
layout_mode = 3
|
|
||||||
anchors_preset = 15
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 2
|
|
||||||
script = ExtResource("1_ndnyg")
|
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
|
||||||
layout_mode = 1
|
|
||||||
anchors_preset = 10
|
|
||||||
anchor_right = 1.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
|
|
||||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
|
|
||||||
[node name="Health" type="Label" parent="VBoxContainer/HBoxContainer/MarginContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Health : 100"
|
|
||||||
|
|
||||||
[node name="MarginContainer2" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
|
|
||||||
[node name="Coins" type="Label" parent="VBoxContainer/HBoxContainer/MarginContainer2"]
|
|
||||||
layout_mode = 2
|
|
||||||
text = "Coins : 0"
|
|
||||||
horizontal_alignment = 2
|
|
@ -15,10 +15,4 @@ func _physics_process(delta: float) -> void:
|
|||||||
position += transform.x * speed * delta
|
position += transform.x * speed * delta
|
||||||
|
|
||||||
func _on_body_entered(body: Node2D) -> void:
|
func _on_body_entered(body: Node2D) -> void:
|
||||||
if body is Enemy:
|
print("I done hit somethin")
|
||||||
print("blow away enemy")
|
|
||||||
|
|
||||||
func _on_area_entered(area: Area2D) -> void:
|
|
||||||
if area is Enemy:
|
|
||||||
print("blow this enemy away")
|
|
||||||
hit.emit(self, area)
|
|
||||||
|
@ -4,8 +4,6 @@ var coinsCollected:int = 0
|
|||||||
var player:Resource
|
var player:Resource
|
||||||
|
|
||||||
signal playerDeath
|
signal playerDeath
|
||||||
signal coinsUpdate(amt)
|
|
||||||
signal playerHealth(currentHealth)
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
print("Game controller is ready")
|
print("Game controller is ready")
|
||||||
@ -15,7 +13,6 @@ func _ready() -> void:
|
|||||||
func coinCollected():
|
func coinCollected():
|
||||||
coinsCollected +=1
|
coinsCollected +=1
|
||||||
print("Game Controller Coin Collected : "+str(coinsCollected))
|
print("Game Controller Coin Collected : "+str(coinsCollected))
|
||||||
coinsUpdate.emit(coinsCollected)
|
|
||||||
|
|
||||||
func resetPlayer():
|
func resetPlayer():
|
||||||
player.health = player.max_health
|
player.health = player.max_health
|
||||||
@ -24,7 +21,6 @@ func playerDamage():
|
|||||||
#one can not kill what is dead....
|
#one can not kill what is dead....
|
||||||
if player.health >0:
|
if player.health >0:
|
||||||
player.health -= 20
|
player.health -= 20
|
||||||
playerHealth.emit(player.health)
|
|
||||||
#is the player dead?
|
#is the player dead?
|
||||||
if player.health <= 0:
|
if player.health <= 0:
|
||||||
#kill him
|
#kill him
|
||||||
|
@ -7,15 +7,10 @@ const PUSH_FORCE = 700
|
|||||||
|
|
||||||
var faceLeft = false
|
var faceLeft = false
|
||||||
var living = true
|
var living = true
|
||||||
var animPlaying="jump"
|
|
||||||
signal playerDead
|
|
||||||
|
|
||||||
# can i push right or left
|
# can i push right or left
|
||||||
var pushLeftEnabled = false
|
var pushLeftEnabled = false
|
||||||
var pushRightEnabled = false
|
var pushRightEnabled = false
|
||||||
var punchLeftEnabled = false
|
|
||||||
var punchRightEnabled = false
|
|
||||||
|
|
||||||
@onready var right_ray: RayCast2D = $RightRay
|
@onready var right_ray: RayCast2D = $RightRay
|
||||||
@onready var left_ray: RayCast2D = $LeftRay
|
@onready var left_ray: RayCast2D = $LeftRay
|
||||||
@onready var marker_right: Node2D = $MarkerRight
|
@onready var marker_right: Node2D = $MarkerRight
|
||||||
@ -23,24 +18,18 @@ var punchRightEnabled = false
|
|||||||
@onready var playerSprite: AnimatedSprite2D = $AnimatedSprite2D
|
@onready var playerSprite: AnimatedSprite2D = $AnimatedSprite2D
|
||||||
|
|
||||||
var pushTarget
|
var pushTarget
|
||||||
var punchTarget:Enemy
|
|
||||||
|
|
||||||
var bullet = preload("res://scenes/bullet.tscn")
|
var bullet = preload("res://scenes/bullet.tscn")
|
||||||
|
|
||||||
func killPlayer():
|
func killPlayer():
|
||||||
|
print("kill the player")
|
||||||
if living:
|
if living:
|
||||||
living = false
|
living = false
|
||||||
#play death animation
|
#play death animation
|
||||||
animPlaying="death"
|
playerSprite.play("death")
|
||||||
playerSprite.play(animPlaying)
|
|
||||||
func hurtPlayer(currentHealth):
|
|
||||||
|
|
||||||
animPlaying="hurt"
|
|
||||||
playerSprite.play(animPlaying)
|
|
||||||
|
|
||||||
func _physics_process(delta: float) -> void:
|
func _physics_process(delta: float) -> void:
|
||||||
if living and not animPlaying=="hurt":
|
if living:
|
||||||
# Add the gravity.
|
# Add the gravity.
|
||||||
if not is_on_floor():
|
if not is_on_floor():
|
||||||
velocity += get_gravity() * delta
|
velocity += get_gravity() * delta
|
||||||
@ -48,23 +37,14 @@ func _physics_process(delta: float) -> void:
|
|||||||
# Handle jump.
|
# Handle jump.
|
||||||
if Input.is_action_just_pressed("ui_accept") and is_on_floor():
|
if Input.is_action_just_pressed("ui_accept") and is_on_floor():
|
||||||
velocity.y = JUMP_VELOCITY
|
velocity.y = JUMP_VELOCITY
|
||||||
if Input.is_action_just_pressed("Shove"):
|
|
||||||
animPlaying="punch"
|
if Input.is_action_just_pressed("Shove") && pushLeftEnabled && faceLeft:
|
||||||
playerSprite.play(animPlaying)
|
pushTarget.apply_central_impulse(Vector2(-1,0) * PUSH_FORCE * 1.5)
|
||||||
if punchLeftEnabled && faceLeft:
|
pushLeftEnabled = false
|
||||||
punchTarget.queue_free()
|
|
||||||
punchLeftEnabled = false
|
|
||||||
if punchRightEnabled && not faceLeft:
|
|
||||||
punchTarget.queue_free()
|
|
||||||
punchRightEnabled = false
|
|
||||||
|
|
||||||
if pushLeftEnabled && faceLeft:
|
if Input.is_action_just_pressed("Shove") && pushRightEnabled && not faceLeft:
|
||||||
pushTarget.apply_central_impulse(Vector2(-1,0) * PUSH_FORCE * 1.5)
|
pushTarget.apply_central_impulse(Vector2(1,0) * PUSH_FORCE * 1.5)
|
||||||
pushLeftEnabled = false
|
pushRightEnabled=false
|
||||||
|
|
||||||
if pushRightEnabled && not faceLeft:
|
|
||||||
pushTarget.apply_central_impulse(Vector2(1,0) * PUSH_FORCE * 1.5)
|
|
||||||
pushRightEnabled=false
|
|
||||||
|
|
||||||
if Input.is_action_just_pressed("shoot"):
|
if Input.is_action_just_pressed("shoot"):
|
||||||
if faceLeft:
|
if faceLeft:
|
||||||
@ -91,11 +71,10 @@ func _physics_process(delta: float) -> void:
|
|||||||
velocity.x = move_toward(velocity.x, 0, SPEED)
|
velocity.x = move_toward(velocity.x, 0, SPEED)
|
||||||
|
|
||||||
if is_on_floor():
|
if is_on_floor():
|
||||||
if not animPlaying == "punch":
|
if direction == 0:
|
||||||
if direction == 0:
|
playerSprite.play("idle")
|
||||||
playerSprite.play("idle")
|
else:
|
||||||
else:
|
playerSprite.play("run")
|
||||||
playerSprite.play("run")
|
|
||||||
else:
|
else:
|
||||||
playerSprite.play("jump")
|
playerSprite.play("jump")
|
||||||
|
|
||||||
@ -111,14 +90,9 @@ func _physics_process(delta: float) -> void:
|
|||||||
if collider.is_in_group("pushables"):
|
if collider.is_in_group("pushables"):
|
||||||
pushLeftEnabled = true
|
pushLeftEnabled = true
|
||||||
pushTarget = collider
|
pushTarget = collider
|
||||||
if collider is Enemy:
|
|
||||||
|
|
||||||
punchTarget = collider
|
|
||||||
punchLeftEnabled = true
|
|
||||||
else:
|
else:
|
||||||
#do something else
|
#do something else
|
||||||
pushLeftEnabled = false
|
pushLeftEnabled = false
|
||||||
punchLeftEnabled = false
|
|
||||||
|
|
||||||
if right_ray.is_colliding():
|
if right_ray.is_colliding():
|
||||||
var collider = right_ray.get_collider()
|
var collider = right_ray.get_collider()
|
||||||
@ -126,21 +100,5 @@ func _physics_process(delta: float) -> void:
|
|||||||
if collider.is_in_group("pushables"):
|
if collider.is_in_group("pushables"):
|
||||||
pushRightEnabled = true
|
pushRightEnabled = true
|
||||||
pushTarget = collider
|
pushTarget = collider
|
||||||
if collider is Enemy:
|
|
||||||
|
|
||||||
punchTarget = collider
|
|
||||||
punchRightEnabled = true
|
|
||||||
else:
|
else:
|
||||||
pushRightEnabled = false
|
pushRightEnabled = false
|
||||||
punchRightEnabled = false
|
|
||||||
|
|
||||||
|
|
||||||
func _on_animation_finished() -> void:
|
|
||||||
|
|
||||||
if animPlaying=="hurt":
|
|
||||||
animPlaying="idle"
|
|
||||||
if animPlaying=="death":
|
|
||||||
#send a signal
|
|
||||||
playerDead.emit()
|
|
||||||
if animPlaying=="punch":
|
|
||||||
animPlaying="idle"
|
|
||||||
|
@ -9,7 +9,6 @@ var cratePool:Array = []
|
|||||||
@onready var enemies: Node = $"../enemies"
|
@onready var enemies: Node = $"../enemies"
|
||||||
@onready var player: CharacterBody2D = $"../CharacterBody2D"
|
@onready var player: CharacterBody2D = $"../CharacterBody2D"
|
||||||
@onready var timer: Timer = $Timer
|
@onready var timer: Timer = $Timer
|
||||||
@onready var ui: Control = $"../CanvasLayer/Control"
|
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
@ -29,11 +28,6 @@ func _ready() -> void:
|
|||||||
n.playerDamage.connect(GameController.playerDamage)
|
n.playerDamage.connect(GameController.playerDamage)
|
||||||
#GameController signals
|
#GameController signals
|
||||||
GameController.playerDeath.connect(killPlayer)
|
GameController.playerDeath.connect(killPlayer)
|
||||||
GameController.coinsUpdate.connect(ui.coinsUpdate)
|
|
||||||
GameController.playerHealth.connect(ui.healthUpdate)
|
|
||||||
GameController.playerHealth.connect(player.hurtPlayer)
|
|
||||||
#Player signals
|
|
||||||
player.playerDead.connect(playerDead)
|
|
||||||
|
|
||||||
func boxTrap():
|
func boxTrap():
|
||||||
print("Trigger a box trap!")
|
print("Trigger a box trap!")
|
||||||
@ -51,7 +45,6 @@ func bulletFactory():
|
|||||||
myBullet = bullet.instantiate()
|
myBullet = bullet.instantiate()
|
||||||
owner.add_child(myBullet)
|
owner.add_child(myBullet)
|
||||||
#or....recycles bullets
|
#or....recycles bullets
|
||||||
myBullet.visible = true
|
|
||||||
return myBullet
|
return myBullet
|
||||||
|
|
||||||
func placeBullet(speed, markerpos):
|
func placeBullet(speed, markerpos):
|
||||||
@ -64,17 +57,6 @@ func placeBullet(speed, markerpos):
|
|||||||
# set the position of the bullet
|
# set the position of the bullet
|
||||||
myBullet.transform = markerpos
|
myBullet.transform = markerpos
|
||||||
# make the bullet visible by adding it
|
# make the bullet visible by adding it
|
||||||
myBullet.hit.connect(bulletHit)
|
|
||||||
|
|
||||||
func bulletHit(bullet, body):
|
|
||||||
print("bullet hit a target")
|
|
||||||
body.queue_free()
|
|
||||||
bullet.setSpeed(0)
|
|
||||||
bullet.visible = false
|
|
||||||
|
|
||||||
func spendBullet():
|
|
||||||
#place a spent bullet back in the pool
|
|
||||||
pass
|
|
||||||
|
|
||||||
func crateFactory():
|
func crateFactory():
|
||||||
var myCrate = crate.instantiate()
|
var myCrate = crate.instantiate()
|
||||||
@ -84,12 +66,11 @@ func crateFactory():
|
|||||||
func killPlayer():
|
func killPlayer():
|
||||||
# tell player to die - starts death animation
|
# tell player to die - starts death animation
|
||||||
player.killPlayer()
|
player.killPlayer()
|
||||||
|
if timer.is_stopped():
|
||||||
|
timer.start(4)
|
||||||
|
|
||||||
|
|
||||||
func resetWorld():
|
func resetWorld():
|
||||||
print("screne manager resetting world")
|
print("screne manager resetting world")
|
||||||
GameController.resetPlayer()
|
GameController.resetPlayer()
|
||||||
get_tree().reload_current_scene()
|
get_tree().reload_current_scene()
|
||||||
|
|
||||||
func playerDead():
|
|
||||||
if timer.is_stopped():
|
|
||||||
timer.start(1)
|
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
extends Control
|
|
||||||
@onready var health: Label = $VBoxContainer/HBoxContainer/MarginContainer/Health
|
|
||||||
@onready var coins: Label = $VBoxContainer/HBoxContainer/MarginContainer2/Coins
|
|
||||||
|
|
||||||
|
|
||||||
func healthUpdate(amt):
|
|
||||||
health.text = "Health : "+str(amt)
|
|
||||||
|
|
||||||
func coinsUpdate(amt):
|
|
||||||
coins.text = "Coins : "+str(amt)
|
|
Loading…
Reference in New Issue
Block a user