Compare commits
No commits in common. "d08cfff85050de5be0afe87abaca949b609824a2" and "f6ad5142bf31f55c5d1ba9f6a5369dde2cc93f3e" have entirely different histories.
d08cfff850
...
f6ad5142bf
Binary file not shown.
Before Width: | Height: | Size: 1.5 KiB |
@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://c1l8de3i0kljl"
|
|
||||||
path="res://.godot/imported/Player Death 64x64.png-0c6ff54e7d9aad74b66dce47376541f8.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://assets/graphics/player/death/Player Death 64x64.png"
|
|
||||||
dest_files=["res://.godot/imported/Player Death 64x64.png-0c6ff54e7d9aad74b66dce47376541f8.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://d0osk3f111068"
|
|
||||||
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
|
|
@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=15 format=4 uid="uid://dhgts0kodsujx"]
|
[gd_scene load_steps=14 format=4 uid="uid://dhgts0kodsujx"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://djkjmi7bo58uv" path="res://scenes/crate.tscn" id="1_6shkr"]
|
[ext_resource type="PackedScene" uid="uid://djkjmi7bo58uv" path="res://scenes/crate.tscn" id="1_6shkr"]
|
||||||
[ext_resource type="Script" path="res://scripts/sceneManager.gd" id="1_ooich"]
|
[ext_resource type="Script" path="res://scripts/sceneManager.gd" id="1_ooich"]
|
||||||
@ -10,7 +10,6 @@
|
|||||||
[ext_resource type="Texture2D" uid="uid://dktvd8atklmau" path="res://assets/graphics/terrains/Terrain (32x32).png" id="6_jpfcs"]
|
[ext_resource type="Texture2D" uid="uid://dktvd8atklmau" path="res://assets/graphics/terrains/Terrain (32x32).png" id="6_jpfcs"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cey0ymp1n0iqe" path="res://scenes/coin.tscn" id="8_cgxc5"]
|
[ext_resource type="PackedScene" uid="uid://cey0ymp1n0iqe" path="res://scenes/coin.tscn" id="8_cgxc5"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bk0pk4m1ln716" path="res://scenes/badguy.tscn" id="9_da82o"]
|
[ext_resource type="PackedScene" uid="uid://bk0pk4m1ln716" path="res://scenes/badguy.tscn" id="9_da82o"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dna0q0tmmxs0g" path="res://scenes/ui.tscn" id="11_i83dw"]
|
|
||||||
|
|
||||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_v72u6"]
|
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_v72u6"]
|
||||||
texture = ExtResource("6_jpfcs")
|
texture = ExtResource("6_jpfcs")
|
||||||
@ -384,10 +383,6 @@ radius = 62.0
|
|||||||
|
|
||||||
[node name="Game" type="Node2D"]
|
[node name="Game" type="Node2D"]
|
||||||
|
|
||||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
|
||||||
|
|
||||||
[node name="ui" parent="CanvasLayer" instance=ExtResource("11_i83dw")]
|
|
||||||
|
|
||||||
[node name="background" type="Parallax2D" parent="."]
|
[node name="background" type="Parallax2D" parent="."]
|
||||||
scroll_offset = Vector2(626, 298)
|
scroll_offset = Vector2(626, 298)
|
||||||
repeat_size = Vector2(320, 0)
|
repeat_size = Vector2(320, 0)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=16 format=4 uid="uid://dxvvtcldbhsac"]
|
[gd_scene load_steps=14 format=4 uid="uid://dxvvtcldbhsac"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://dordo7deet5y0" path="res://assets/graphics/terrains/backgrounds/forestbackground.png" id="1_fca7k"]
|
[ext_resource type="Texture2D" uid="uid://dordo7deet5y0" path="res://assets/graphics/terrains/backgrounds/forestbackground.png" id="1_fca7k"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cukevm4avtgnp" path="res://assets/graphics/terrains/backgrounds/sky.png" id="2_7a0hu"]
|
[ext_resource type="Texture2D" uid="uid://cukevm4avtgnp" path="res://assets/graphics/terrains/backgrounds/sky.png" id="2_7a0hu"]
|
||||||
@ -9,8 +9,6 @@
|
|||||||
[ext_resource type="Script" path="res://scripts/trigger.gd" id="7_vcera"]
|
[ext_resource type="Script" path="res://scripts/trigger.gd" id="7_vcera"]
|
||||||
[ext_resource type="PackedScene" uid="uid://djkjmi7bo58uv" path="res://scenes/crate.tscn" id="8_q5n2b"]
|
[ext_resource type="PackedScene" uid="uid://djkjmi7bo58uv" path="res://scenes/crate.tscn" id="8_q5n2b"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cey0ymp1n0iqe" path="res://scenes/coin.tscn" id="9_iql8u"]
|
[ext_resource type="PackedScene" uid="uid://cey0ymp1n0iqe" path="res://scenes/coin.tscn" id="9_iql8u"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bk0pk4m1ln716" path="res://scenes/badguy.tscn" id="10_w2bl5"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://dna0q0tmmxs0g" path="res://scenes/ui.tscn" id="11_6mr7q"]
|
|
||||||
|
|
||||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_v72u6"]
|
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_v72u6"]
|
||||||
texture = ExtResource("5_qoo1j")
|
texture = ExtResource("5_qoo1j")
|
||||||
@ -387,10 +385,6 @@ radius = 62.0
|
|||||||
|
|
||||||
[node name="Game" type="Node2D"]
|
[node name="Game" type="Node2D"]
|
||||||
|
|
||||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
|
||||||
|
|
||||||
[node name="ui" parent="CanvasLayer" instance=ExtResource("11_6mr7q")]
|
|
||||||
|
|
||||||
[node name="background" type="Parallax2D" parent="."]
|
[node name="background" type="Parallax2D" parent="."]
|
||||||
scroll_offset = Vector2(626, 298)
|
scroll_offset = Vector2(626, 298)
|
||||||
repeat_size = Vector2(320, 0)
|
repeat_size = Vector2(320, 0)
|
||||||
@ -462,24 +456,21 @@ rotation = -0.0982481
|
|||||||
[node name="RigidBody2D" parent="crates" instance=ExtResource("8_q5n2b")]
|
[node name="RigidBody2D" parent="crates" instance=ExtResource("8_q5n2b")]
|
||||||
position = Vector2(501, 265)
|
position = Vector2(501, 265)
|
||||||
|
|
||||||
[node name="enemies" type="Node2D" parent="."]
|
|
||||||
|
|
||||||
[node name="Area2D" parent="enemies" instance=ExtResource("10_w2bl5")]
|
|
||||||
position = Vector2(79, 415)
|
|
||||||
|
|
||||||
[node name="Area2D2" parent="enemies" instance=ExtResource("10_w2bl5")]
|
|
||||||
position = Vector2(215, 415)
|
|
||||||
|
|
||||||
[node name="coins" type="Node2D" parent="."]
|
[node name="coins" type="Node2D" parent="."]
|
||||||
|
|
||||||
[node name="Area2D" parent="coins" instance=ExtResource("9_iql8u")]
|
[node name="Area2D" parent="coins" instance=ExtResource("9_iql8u")]
|
||||||
position = Vector2(72, 107)
|
position = Vector2(72, 107)
|
||||||
|
script = null
|
||||||
|
|
||||||
[node name="Area2D2" parent="coins" instance=ExtResource("9_iql8u")]
|
[node name="Area2D2" parent="coins" instance=ExtResource("9_iql8u")]
|
||||||
position = Vector2(-178, 75)
|
position = Vector2(-42, 11)
|
||||||
|
script = null
|
||||||
|
|
||||||
[node name="Area2D3" parent="coins" instance=ExtResource("9_iql8u")]
|
[node name="Area2D3" parent="coins" instance=ExtResource("9_iql8u")]
|
||||||
position = Vector2(315, 204)
|
position = Vector2(-55, 295)
|
||||||
|
|
||||||
|
[node name="Area2D4" parent="coins" instance=ExtResource("9_iql8u")]
|
||||||
|
position = Vector2(321, 198)
|
||||||
|
|
||||||
[connection signal="areaTrigger" from="Area2D" to="." method="_on_trigger"]
|
[connection signal="areaTrigger" from="Area2D" to="." method="_on_trigger"]
|
||||||
[connection signal="body_entered" from="Area2D" to="Area2D" method="_on_body_entered"]
|
[connection signal="body_entered" from="Area2D" to="Area2D" method="_on_body_entered"]
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
[gd_scene load_steps=44 format=3 uid="uid://b2hyqfqh02ep6"]
|
[gd_scene load_steps=28 format=3 uid="uid://b2hyqfqh02ep6"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/charController.gd" id="1_4o8do"]
|
[ext_resource type="Script" path="res://scripts/charController.gd" id="1_4o8do"]
|
||||||
[ext_resource type="Texture2D" uid="uid://c1l8de3i0kljl" path="res://assets/graphics/player/death/Player Death 64x64.png" id="2_alp3v"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://bfhqvl875is6f" path="res://assets/graphics/player/idle/Player Idle 48x48.png" id="2_yfuca"]
|
[ext_resource type="Texture2D" uid="uid://bfhqvl875is6f" path="res://assets/graphics/player/idle/Player Idle 48x48.png" id="2_yfuca"]
|
||||||
[ext_resource type="Texture2D" uid="uid://d0osk3f111068" path="res://assets/graphics/player/hurt/Player Hurt 48x48.png" id="3_5pi5t"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://c2s48joyna11q" path="res://assets/graphics/player/jump/player jump 48x48.png" id="3_p8gbr"]
|
[ext_resource type="Texture2D" uid="uid://c2s48joyna11q" path="res://assets/graphics/player/jump/player jump 48x48.png" id="3_p8gbr"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bvat1vqwtua2p" path="res://assets/graphics/player/run/player run 48x48.png" id="3_y36hw"]
|
[ext_resource type="Texture2D" uid="uid://bvat1vqwtua2p" path="res://assets/graphics/player/run/player run 48x48.png" id="3_y36hw"]
|
||||||
|
|
||||||
@ -11,62 +9,6 @@
|
|||||||
radius = 9.93
|
radius = 9.93
|
||||||
height = 35.0
|
height = 35.0
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_iomdd"]
|
|
||||||
atlas = ExtResource("2_alp3v")
|
|
||||||
region = Rect2(0, 0, 48, 48)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qlc64"]
|
|
||||||
atlas = ExtResource("2_alp3v")
|
|
||||||
region = Rect2(48, 0, 48, 48)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_r8feb"]
|
|
||||||
atlas = ExtResource("2_alp3v")
|
|
||||||
region = Rect2(96, 0, 48, 48)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_pchcp"]
|
|
||||||
atlas = ExtResource("2_alp3v")
|
|
||||||
region = Rect2(144, 0, 48, 48)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ekkmw"]
|
|
||||||
atlas = ExtResource("2_alp3v")
|
|
||||||
region = Rect2(192, 0, 48, 48)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_aenr4"]
|
|
||||||
atlas = ExtResource("2_alp3v")
|
|
||||||
region = Rect2(240, 0, 48, 48)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_c2bld"]
|
|
||||||
atlas = ExtResource("2_alp3v")
|
|
||||||
region = Rect2(288, 0, 48, 48)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_556cp"]
|
|
||||||
atlas = ExtResource("2_alp3v")
|
|
||||||
region = Rect2(336, 0, 48, 48)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hf6j1"]
|
|
||||||
atlas = ExtResource("2_alp3v")
|
|
||||||
region = Rect2(384, 0, 48, 48)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_pvct1"]
|
|
||||||
atlas = ExtResource("2_alp3v")
|
|
||||||
region = Rect2(432, 0, 48, 48)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0ae2b"]
|
|
||||||
atlas = ExtResource("3_5pi5t")
|
|
||||||
region = Rect2(0, 0, 48, 48)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0i34p"]
|
|
||||||
atlas = ExtResource("3_5pi5t")
|
|
||||||
region = Rect2(48, 0, 48, 48)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_k17h1"]
|
|
||||||
atlas = ExtResource("3_5pi5t")
|
|
||||||
region = Rect2(96, 0, 48, 48)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1nyuv"]
|
|
||||||
atlas = ExtResource("3_5pi5t")
|
|
||||||
region = Rect2(144, 0, 48, 48)
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_cdvw1"]
|
[sub_resource type="AtlasTexture" id="AtlasTexture_cdvw1"]
|
||||||
atlas = ExtResource("2_yfuca")
|
atlas = ExtResource("2_yfuca")
|
||||||
region = Rect2(0, 0, 48, 48)
|
region = Rect2(0, 0, 48, 48)
|
||||||
@ -155,58 +97,6 @@ region = Rect2(336, 0, 48, 48)
|
|||||||
animations = [{
|
animations = [{
|
||||||
"frames": [{
|
"frames": [{
|
||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
"texture": SubResource("AtlasTexture_iomdd")
|
|
||||||
}, {
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_qlc64")
|
|
||||||
}, {
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_r8feb")
|
|
||||||
}, {
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_pchcp")
|
|
||||||
}, {
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_ekkmw")
|
|
||||||
}, {
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_aenr4")
|
|
||||||
}, {
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_c2bld")
|
|
||||||
}, {
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_556cp")
|
|
||||||
}, {
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_hf6j1")
|
|
||||||
}, {
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_pvct1")
|
|
||||||
}],
|
|
||||||
"loop": false,
|
|
||||||
"name": &"playerDeath",
|
|
||||||
"speed": 6.0
|
|
||||||
}, {
|
|
||||||
"frames": [{
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_0ae2b")
|
|
||||||
}, {
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_0i34p")
|
|
||||||
}, {
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_k17h1")
|
|
||||||
}, {
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_1nyuv")
|
|
||||||
}],
|
|
||||||
"loop": false,
|
|
||||||
"name": &"playerHurt",
|
|
||||||
"speed": 12.0
|
|
||||||
}, {
|
|
||||||
"frames": [{
|
|
||||||
"duration": 1.0,
|
|
||||||
"texture": SubResource("AtlasTexture_cdvw1")
|
"texture": SubResource("AtlasTexture_cdvw1")
|
||||||
}, {
|
}, {
|
||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
@ -313,9 +203,5 @@ texture_filter = 1
|
|||||||
position = Vector2(-1, -3)
|
position = Vector2(-1, -3)
|
||||||
scale = Vector2(1.29167, 1.29167)
|
scale = Vector2(1.29167, 1.29167)
|
||||||
sprite_frames = SubResource("SpriteFrames_52pno")
|
sprite_frames = SubResource("SpriteFrames_52pno")
|
||||||
animation = &"playerDeath"
|
animation = &"playerIdle"
|
||||||
autoplay = "playerIdle"
|
autoplay = "playerIdle"
|
||||||
frame = 9
|
|
||||||
frame_progress = 1.0
|
|
||||||
|
|
||||||
[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animated_finished"]
|
|
||||||
|
@ -1,75 +0,0 @@
|
|||||||
[gd_scene load_steps=5 format=3 uid="uid://dna0q0tmmxs0g"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/ui.gd" id="1_1b5vo"]
|
|
||||||
|
|
||||||
[sub_resource type="LabelSettings" id="LabelSettings_bb10x"]
|
|
||||||
font_size = 12
|
|
||||||
font_color = Color(0.776471, 0.027451, 0.113725, 1)
|
|
||||||
outline_size = 1
|
|
||||||
outline_color = Color(0.0768358, 0.0768358, 0.0768358, 1)
|
|
||||||
shadow_size = 3
|
|
||||||
shadow_color = Color(0.121569, 0.121569, 0.121569, 0.670588)
|
|
||||||
|
|
||||||
[sub_resource type="LabelSettings" id="LabelSettings_rb7h3"]
|
|
||||||
font_size = 12
|
|
||||||
outline_size = 1
|
|
||||||
outline_color = Color(0.0768358, 0.0768358, 0.0768358, 1)
|
|
||||||
shadow_size = 3
|
|
||||||
shadow_color = Color(0.121569, 0.121569, 0.121569, 0.670588)
|
|
||||||
|
|
||||||
[sub_resource type="LabelSettings" id="LabelSettings_fsj7b"]
|
|
||||||
font_size = 12
|
|
||||||
font_color = Color(0.99068, 0.855439, 0.297628, 1)
|
|
||||||
outline_size = 1
|
|
||||||
outline_color = Color(0.0768358, 0.0768358, 0.0768358, 1)
|
|
||||||
shadow_size = 3
|
|
||||||
shadow_color = Color(0.121569, 0.121569, 0.121569, 0.670588)
|
|
||||||
|
|
||||||
[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_1b5vo")
|
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
|
||||||
layout_mode = 1
|
|
||||||
anchors_preset = 10
|
|
||||||
anchor_right = 1.0
|
|
||||||
offset_bottom = 23.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
metadata/_edit_use_anchors_ = true
|
|
||||||
|
|
||||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
|
||||||
texture_filter = 1
|
|
||||||
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"]
|
|
||||||
texture_filter = 1
|
|
||||||
layout_mode = 2
|
|
||||||
label_settings = SubResource("LabelSettings_bb10x")
|
|
||||||
|
|
||||||
[node name="MarginContainer3" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
|
|
||||||
[node name="timer" type="Label" parent="VBoxContainer/HBoxContainer/MarginContainer3"]
|
|
||||||
layout_mode = 2
|
|
||||||
label_settings = SubResource("LabelSettings_rb7h3")
|
|
||||||
horizontal_alignment = 1
|
|
||||||
|
|
||||||
[node name="MarginContainer2" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
|
|
||||||
[node name="coins" type="Label" parent="VBoxContainer/HBoxContainer/MarginContainer2"]
|
|
||||||
texture_filter = 1
|
|
||||||
layout_mode = 2
|
|
||||||
label_settings = SubResource("LabelSettings_fsj7b")
|
|
||||||
horizontal_alignment = 2
|
|
@ -21,108 +21,80 @@ var bullet = preload("res://scenes/bullet.tscn")
|
|||||||
|
|
||||||
var isJumping = false
|
var isJumping = false
|
||||||
|
|
||||||
var living = true
|
|
||||||
var animPlaying = "playerIdle"
|
|
||||||
|
|
||||||
signal deathAnimDone
|
|
||||||
|
|
||||||
func hurtPlayer(_amt):
|
|
||||||
if living:
|
|
||||||
animPlaying = "playerHurt"
|
|
||||||
animation.play(animPlaying)
|
|
||||||
|
|
||||||
func killPlayer():
|
|
||||||
if living:
|
|
||||||
living = false
|
|
||||||
print("Oh no")
|
|
||||||
animPlaying = "playerDeath"
|
|
||||||
animation.play(animPlaying)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _physics_process(delta: float) -> void:
|
func _physics_process(delta: float) -> void:
|
||||||
if living and not animPlaying == "playerHurt":
|
# Add the gravity.
|
||||||
# Add the gravity.
|
if not is_on_floor():
|
||||||
if not is_on_floor():
|
velocity += get_gravity() * delta
|
||||||
velocity += get_gravity() * delta
|
else:
|
||||||
else:
|
isJumping = false
|
||||||
isJumping = false
|
|
||||||
|
|
||||||
# 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():
|
||||||
isJumping = true
|
isJumping = true
|
||||||
velocity.y = JUMP_VELOCITY
|
velocity.y = JUMP_VELOCITY
|
||||||
|
|
||||||
|
if pushTarget:
|
||||||
|
if Input.is_action_just_pressed("Shove") && pushLeftEnabled && faceLeft:
|
||||||
|
print("shove left")
|
||||||
|
pushTarget.apply_central_impulse(Vector2(-1,0) * PUSH_FORCE * 10)
|
||||||
|
pushLeftEnabled = false
|
||||||
|
|
||||||
if pushTarget:
|
if Input.is_action_just_pressed("Shove") && pushRightEnabled && not faceLeft:
|
||||||
if Input.is_action_just_pressed("Shove") && pushLeftEnabled && faceLeft:
|
print("shove right")
|
||||||
print("shove left")
|
pushTarget.apply_central_impulse(Vector2(1,0) * PUSH_FORCE * 15)
|
||||||
pushTarget.apply_central_impulse(Vector2(-1,0) * PUSH_FORCE * 10)
|
pushRightEnabled = false
|
||||||
|
|
||||||
|
if Input.is_action_just_pressed("Shoot"):
|
||||||
|
if faceLeft:
|
||||||
|
var _myBullet = %SceneManager.makeBullet(marker_left.global_transform, -700)
|
||||||
|
else:
|
||||||
|
var _myBullet = %SceneManager.makeBullet(marker_right.global_transform, 700)
|
||||||
|
|
||||||
|
# Get the input direction and handle the movement/deceleration.
|
||||||
|
# As good practice, you should replace UI actions with custom gameplay actions.
|
||||||
|
var direction := Input.get_axis("ui_left", "ui_right")
|
||||||
|
|
||||||
|
|
||||||
|
if direction:
|
||||||
|
if direction < 0:
|
||||||
|
faceLeft = true
|
||||||
|
if direction > 0:
|
||||||
|
faceLeft = false
|
||||||
|
|
||||||
|
animation.flip_h = faceLeft
|
||||||
|
if not isJumping:
|
||||||
|
animation.play("playerRun")
|
||||||
|
else:
|
||||||
|
animation.play("playerJump")
|
||||||
|
velocity.x = direction * SPEED
|
||||||
|
else:
|
||||||
|
if not isJumping:
|
||||||
|
animation.play("playerIdle")
|
||||||
|
else:
|
||||||
|
animation.play("playerJump")
|
||||||
|
velocity.x = move_toward(velocity.x, 0, SPEED)
|
||||||
|
|
||||||
|
move_and_slide()
|
||||||
|
for i in (get_slide_collision_count()):
|
||||||
|
var c = get_slide_collision(i)
|
||||||
|
if c.get_collider() is RigidBody2D:
|
||||||
|
c.get_collider().apply_central_impulse(-c.get_normal()*BUMP_FORCE)
|
||||||
|
|
||||||
|
pushTarget = false
|
||||||
|
if left_ray.is_colliding():
|
||||||
|
var collider = left_ray.get_collider()
|
||||||
|
if collider is Node:
|
||||||
|
if collider.is_in_group("pushables"):
|
||||||
|
pushLeftEnabled = true
|
||||||
|
pushTarget = collider
|
||||||
|
else:
|
||||||
pushLeftEnabled = false
|
pushLeftEnabled = false
|
||||||
|
|
||||||
if Input.is_action_just_pressed("Shove") && pushRightEnabled && not faceLeft:
|
if right_ray.is_colliding():
|
||||||
print("shove right")
|
var collider = right_ray.get_collider()
|
||||||
pushTarget.apply_central_impulse(Vector2(1,0) * PUSH_FORCE * 15)
|
if collider is Node:
|
||||||
|
if collider.is_in_group("pushables"):
|
||||||
|
pushRightEnabled = true
|
||||||
|
pushTarget = collider
|
||||||
|
else:
|
||||||
pushRightEnabled = false
|
pushRightEnabled = false
|
||||||
|
|
||||||
if Input.is_action_just_pressed("Shoot"):
|
|
||||||
if faceLeft:
|
|
||||||
var _myBullet = %SceneManager.makeBullet(marker_left.global_transform, -700)
|
|
||||||
else:
|
|
||||||
var _myBullet = %SceneManager.makeBullet(marker_right.global_transform, 700)
|
|
||||||
|
|
||||||
# Get the input direction and handle the movement/deceleration.
|
|
||||||
# As good practice, you should replace UI actions with custom gameplay actions.
|
|
||||||
var direction := Input.get_axis("ui_left", "ui_right")
|
|
||||||
|
|
||||||
|
|
||||||
if direction:
|
|
||||||
if direction < 0:
|
|
||||||
faceLeft = true
|
|
||||||
if direction > 0:
|
|
||||||
faceLeft = false
|
|
||||||
|
|
||||||
animation.flip_h = faceLeft
|
|
||||||
if not isJumping:
|
|
||||||
animation.play("playerRun")
|
|
||||||
else:
|
|
||||||
animation.play("playerJump")
|
|
||||||
velocity.x = direction * SPEED
|
|
||||||
else:
|
|
||||||
if not isJumping:
|
|
||||||
animation.play("playerIdle")
|
|
||||||
else:
|
|
||||||
animation.play("playerJump")
|
|
||||||
velocity.x = move_toward(velocity.x, 0, SPEED)
|
|
||||||
|
|
||||||
move_and_slide()
|
|
||||||
for i in (get_slide_collision_count()):
|
|
||||||
var c = get_slide_collision(i)
|
|
||||||
if c.get_collider() is RigidBody2D:
|
|
||||||
c.get_collider().apply_central_impulse(-c.get_normal()*BUMP_FORCE)
|
|
||||||
|
|
||||||
pushTarget = false
|
|
||||||
if left_ray.is_colliding():
|
|
||||||
var collider = left_ray.get_collider()
|
|
||||||
if collider is Node:
|
|
||||||
if collider.is_in_group("pushables"):
|
|
||||||
pushLeftEnabled = true
|
|
||||||
pushTarget = collider
|
|
||||||
else:
|
|
||||||
pushLeftEnabled = false
|
|
||||||
|
|
||||||
if right_ray.is_colliding():
|
|
||||||
var collider = right_ray.get_collider()
|
|
||||||
if collider is Node:
|
|
||||||
if collider.is_in_group("pushables"):
|
|
||||||
pushRightEnabled = true
|
|
||||||
pushTarget = collider
|
|
||||||
else:
|
|
||||||
pushRightEnabled = false
|
|
||||||
|
|
||||||
|
|
||||||
func _on_animated_finished() -> void:
|
|
||||||
if animPlaying == "playerHurt":
|
|
||||||
animPlaying = "playerIdle"
|
|
||||||
if animPlaying == "playerDeath":
|
|
||||||
# emit death signal
|
|
||||||
deathAnimDone.emit()
|
|
||||||
|
@ -12,17 +12,12 @@ var player:Resource
|
|||||||
|
|
||||||
# level info
|
# level info
|
||||||
var levels = ["res://scenes/game.tscn", "res://scenes/level2.tscn"]
|
var levels = ["res://scenes/game.tscn", "res://scenes/level2.tscn"]
|
||||||
var timers = [90, 90]
|
var timers = [30, 30]
|
||||||
var currentLevel = 0
|
var currentLevel = 0
|
||||||
|
|
||||||
#Gamecontroller signals
|
#Gamecontroller signals
|
||||||
signal destroyBox(body)
|
signal destroyBox(body)
|
||||||
signal levelComplete(leveltoLoad)
|
signal levelComplete(leveltoLoad)
|
||||||
signal playerHurt(amt, max)
|
|
||||||
signal playerDeath()
|
|
||||||
|
|
||||||
signal tick(timeRemaining)
|
|
||||||
signal coinsUpdate(collected, remaining)
|
|
||||||
|
|
||||||
# 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:
|
||||||
@ -34,46 +29,28 @@ func _ready() -> void:
|
|||||||
timer.one_shot = false
|
timer.one_shot = false
|
||||||
timer.connect("timeout", secondCounter)
|
timer.connect("timeout", secondCounter)
|
||||||
timer.start()
|
timer.start()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func reset():
|
func reset():
|
||||||
secondCount = timers[currentLevel]
|
secondCount = timers[currentLevel]
|
||||||
player.health = player.starting_health
|
|
||||||
playerHurt.emit.call_deferred(player.health, player.max_health)
|
|
||||||
tick.emit.call_deferred(secondCount)
|
|
||||||
totalCoinsCollected = 0
|
|
||||||
coinsUpdate.emit.call_deferred(totalCoinsCollected, totalCoins)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func secondCounter():
|
func secondCounter():
|
||||||
print("time left: ", secondCount)
|
print("time left: ", secondCount)
|
||||||
secondCount -=1
|
secondCount -=1
|
||||||
tick.emit(secondCount)
|
|
||||||
if secondCount <= 0:
|
if secondCount <= 0:
|
||||||
print("TIME IS UP")
|
print("TIME IS UP")
|
||||||
levelComplete.emit(levels[currentLevel])
|
levelComplete.emit(levels[currentLevel])
|
||||||
|
|
||||||
|
|
||||||
func playerDamaged():
|
func playerDamaged():
|
||||||
print("GC knows player took damage")
|
print("GC knows player took damage")
|
||||||
player.health = max(player.health-20, 0)
|
player.health = max(player.health-10, 0)
|
||||||
print("Player Health: "+str(player.health))
|
print("Player Health: "+str(player.health))
|
||||||
playerHurt.emit(player.health, player.max_health)
|
|
||||||
|
|
||||||
if player.health <= 0:
|
|
||||||
playerDeath.emit()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func coinCollected():
|
func coinCollected():
|
||||||
totalCoinsCollected += 1
|
totalCoinsCollected += 1
|
||||||
print("DING! Coins collected: "+ str(totalCoinsCollected) )
|
print("DING! Coins collected: "+ str(totalCoinsCollected) )
|
||||||
coinsUpdate.emit(totalCoinsCollected, totalCoins)
|
|
||||||
|
|
||||||
|
|
||||||
func bulletHit(body):
|
func bulletHit(body):
|
||||||
print("Game controller knows bullet hit something")
|
print("Game controller knows bullet hit something")
|
||||||
if body.is_in_group("destructables"):
|
if body.is_in_group("destructables"):
|
||||||
@ -89,21 +66,14 @@ func bulletHit(body):
|
|||||||
levelComplete.emit(levels[currentLevel])
|
levelComplete.emit(levels[currentLevel])
|
||||||
else:
|
else:
|
||||||
print("Crates Remaining: "+str(totalCrates) )
|
print("Crates Remaining: "+str(totalCrates) )
|
||||||
|
|
||||||
|
|
||||||
# Coming from scenemanager
|
# Coming from scenemanager
|
||||||
func countCrates(value):
|
func countCrates(value):
|
||||||
totalCrates = value
|
totalCrates = value
|
||||||
|
|
||||||
|
|
||||||
func countCoins(value):
|
func countCoins(value):
|
||||||
totalCoins = value
|
totalCoins = value
|
||||||
|
|
||||||
|
|
||||||
func countBadGuys(value):
|
func countBadGuys(value):
|
||||||
totalBadGuys = value
|
totalBadGuys = value
|
||||||
|
|
||||||
|
|
||||||
func playerDead():
|
|
||||||
print("GC knows player is dead")
|
|
||||||
levelComplete.emit(levels[currentLevel])
|
|
||||||
|
@ -5,9 +5,6 @@ extends Node
|
|||||||
@onready var coins: Node2D = $"../coins"
|
@onready var coins: Node2D = $"../coins"
|
||||||
@onready var enemies: Node2D = $"../enemies"
|
@onready var enemies: Node2D = $"../enemies"
|
||||||
|
|
||||||
@onready var player: CharacterBody2D = $"../CharacterBody2D"
|
|
||||||
@onready var ui: Control = $"../CanvasLayer/ui"
|
|
||||||
|
|
||||||
var theBullet = preload("res://scenes/bullet.tscn")
|
var theBullet = preload("res://scenes/bullet.tscn")
|
||||||
var bulletArray:Array = []
|
var bulletArray:Array = []
|
||||||
|
|
||||||
@ -36,20 +33,8 @@ func _ready() -> void:
|
|||||||
GameController.countBadGuys(totalEnemies)
|
GameController.countBadGuys(totalEnemies)
|
||||||
|
|
||||||
GameController.countCrates(totalCrates)
|
GameController.countCrates(totalCrates)
|
||||||
|
|
||||||
# Player interactions
|
|
||||||
GameController.playerHurt.connect(player.hurtPlayer)
|
|
||||||
GameController.playerDeath.connect(player.killPlayer)
|
|
||||||
# Subscribe to signals
|
# Subscribe to signals
|
||||||
GameController.levelComplete.connect(changeLevel)
|
GameController.levelComplete.connect(changeLevel)
|
||||||
player.deathAnimDone.connect(GameController.playerDead)
|
|
||||||
|
|
||||||
GameController.tick.connect(ui.timerUpdate)
|
|
||||||
GameController.playerHurt.connect(ui.healthUpdate, ConnectFlags.CONNECT_DEFERRED)
|
|
||||||
GameController.coinsUpdate.connect(ui.coinsUpdate)
|
|
||||||
|
|
||||||
GameController.reset()
|
|
||||||
|
|
||||||
|
|
||||||
func changeLevel(level):
|
func changeLevel(level):
|
||||||
print("New level")
|
print("New level")
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
extends Control
|
|
||||||
|
|
||||||
@onready var timer: Label = $VBoxContainer/HBoxContainer/MarginContainer3/timer
|
|
||||||
@onready var health: Label = $VBoxContainer/HBoxContainer/MarginContainer/health
|
|
||||||
@onready var coins: Label = $VBoxContainer/HBoxContainer/MarginContainer2/coins
|
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
|
||||||
func _ready() -> void:
|
|
||||||
pass
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
||||||
func _process(delta: float) -> void:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
func timerUpdate(timeRemaining):
|
|
||||||
if timeRemaining <= 0:
|
|
||||||
timer.text = "OUT OF TIME"
|
|
||||||
else:
|
|
||||||
timer.text = "🕔: "+str(timeRemaining)
|
|
||||||
|
|
||||||
|
|
||||||
func healthUpdate(healthRemaining, healthMax):
|
|
||||||
if healthRemaining <= 0:
|
|
||||||
health.text = " 💀 💀 💀 💀 "
|
|
||||||
else:
|
|
||||||
health.text = (" ❤️: "+str(healthRemaining)+"/"+str(healthMax))
|
|
||||||
|
|
||||||
|
|
||||||
func coinsUpdate(collected, remaining):
|
|
||||||
coins.text = ("🪙: "+str(collected)+"/"+str(remaining)+" ")
|
|
Loading…
Reference in New Issue
Block a user