player animations, variable triggers, working bullets
This commit is contained in:
parent
5dcc0e729b
commit
b52ead2557
BIN
febfabgame/Assets/graphics/objects/crate.png
Normal file
BIN
febfabgame/Assets/graphics/objects/crate.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
34
febfabgame/Assets/graphics/objects/crate.png.import
Normal file
34
febfabgame/Assets/graphics/objects/crate.png.import
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://dbdeeja34rpcm"
|
||||||
|
path="res://.godot/imported/crate.png-b305173a2c67970ad0d8a144d4e63ff0.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Assets/graphics/objects/crate.png"
|
||||||
|
dest_files=["res://.godot/imported/crate.png-b305173a2c67970ad0d8a144d4e63ff0.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
|
BIN
febfabgame/Assets/graphics/player/idle/Player Idle 48x48.png
Normal file
BIN
febfabgame/Assets/graphics/player/idle/Player Idle 48x48.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://jnn6hcmfgyfo"
|
||||||
|
path="res://.godot/imported/Player Idle 48x48.png-89778dc220bc3b5e442a99d89a1e9928.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Assets/graphics/player/idle/Player Idle 48x48.png"
|
||||||
|
dest_files=["res://.godot/imported/Player Idle 48x48.png-89778dc220bc3b5e442a99d89a1e9928.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
|
BIN
febfabgame/Assets/graphics/player/jump/player jump 48x48.png
Normal file
BIN
febfabgame/Assets/graphics/player/jump/player jump 48x48.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1021 B |
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://bv1oc2iwohejk"
|
||||||
|
path="res://.godot/imported/player jump 48x48.png-cb96bf53d7104a8fe475749788ee547c.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Assets/graphics/player/jump/player jump 48x48.png"
|
||||||
|
dest_files=["res://.godot/imported/player jump 48x48.png-cb96bf53d7104a8fe475749788ee547c.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
|
BIN
febfabgame/Assets/graphics/player/run/player run 48x48.png
Normal file
BIN
febfabgame/Assets/graphics/player/run/player run 48x48.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://ciaht230dnmu3"
|
||||||
|
path="res://.godot/imported/player run 48x48.png-9864f67f072e7f64b36c65e3e85745f1.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Assets/graphics/player/run/player run 48x48.png"
|
||||||
|
dest_files=["res://.godot/imported/player run 48x48.png-9864f67f072e7f64b36c65e3e85745f1.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
|
BIN
febfabgame/Assets/graphics/projectiles/pixel_bullet.png
Normal file
BIN
febfabgame/Assets/graphics/projectiles/pixel_bullet.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://n3642h5jwslv"
|
||||||
|
path="res://.godot/imported/pixel_bullet.png-ed71f7728f29fcc66cd3972db4fb4d47.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Assets/graphics/projectiles/pixel_bullet.png"
|
||||||
|
dest_files=["res://.godot/imported/pixel_bullet.png-ed71f7728f29fcc66cd3972db4fb4d47.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,6 +1,7 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://cy7x36mdb5oxu"]
|
[gd_scene load_steps=4 format=3 uid="uid://cy7x36mdb5oxu"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://Scripts/bullet.gd" id="1_74gno"]
|
[ext_resource type="Script" path="res://Scripts/bullet.gd" id="1_74gno"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://n3642h5jwslv" path="res://Assets/graphics/projectiles/pixel_bullet.png" id="2_abfvl"]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_vnal2"]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_vnal2"]
|
||||||
size = Vector2(20, 4)
|
size = Vector2(20, 4)
|
||||||
@ -12,4 +13,9 @@ script = ExtResource("1_74gno")
|
|||||||
shape = SubResource("RectangleShape2D_vnal2")
|
shape = SubResource("RectangleShape2D_vnal2")
|
||||||
debug_color = Color(0.857955, 0.291109, 0.565473, 0.42)
|
debug_color = Color(0.857955, 0.291109, 0.565473, 0.42)
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
|
position = Vector2(-5, 2)
|
||||||
|
scale = Vector2(-0.14505, 0.0734948)
|
||||||
|
texture = ExtResource("2_abfvl")
|
||||||
|
|
||||||
[connection signal="body_shape_entered" from="." to="." method="_on_body_shape_entered"]
|
[connection signal="body_shape_entered" from="." to="." method="_on_body_shape_entered"]
|
||||||
|
20
febfabgame/Scenes/crate.tscn
Normal file
20
febfabgame/Scenes/crate.tscn
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
[gd_scene load_steps=3 format=3 uid="uid://bad28kns14sve"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dbdeeja34rpcm" path="res://Assets/graphics/objects/crate.png" id="1_jxgyj"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_57esh"]
|
||||||
|
size = Vector2(52, 56)
|
||||||
|
|
||||||
|
[node name="Crate1" type="RigidBody2D"]
|
||||||
|
position = Vector2(-2, -2)
|
||||||
|
metadata/_edit_group_ = true
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
shape = SubResource("RectangleShape2D_57esh")
|
||||||
|
debug_color = Color(0.812962, 0.406946, 0.115236, 0.42)
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
|
texture_filter = 1
|
||||||
|
position = Vector2(0, 4)
|
||||||
|
scale = Vector2(0.186279, 0.198245)
|
||||||
|
texture = ExtResource("1_jxgyj")
|
@ -1,21 +1,22 @@
|
|||||||
[gd_scene load_steps=10 format=3 uid="uid://cpuc12n61qg6b"]
|
[gd_scene load_steps=12 format=3 uid="uid://cpuc12n61qg6b"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://Scripts/trigger.gd" id="1_a0h8u"]
|
|
||||||
[ext_resource type="Script" path="res://Scripts/gamecontroller.gd" id="1_amnm6"]
|
[ext_resource type="Script" path="res://Scripts/gamecontroller.gd" id="1_amnm6"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://d0ve3ds64sk3p" path="res://Scenes/trigger.tscn" id="2_k6dhr"]
|
||||||
[ext_resource type="PackedScene" uid="uid://b0snboj7mbad5" path="res://Scenes/player.tscn" id="3_3yq6m"]
|
[ext_resource type="PackedScene" uid="uid://b0snboj7mbad5" path="res://Scenes/player.tscn" id="3_3yq6m"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bad28kns14sve" path="res://Scenes/crate.tscn" id="3_gnicf"]
|
||||||
|
[ext_resource type="Script" path="res://Scripts/crate.gd" id="4_5gakl"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cy7x36mdb5oxu" path="res://Scenes/bullet.tscn" id="4_bk63h"]
|
[ext_resource type="PackedScene" uid="uid://cy7x36mdb5oxu" path="res://Scenes/bullet.tscn" id="4_bk63h"]
|
||||||
[ext_resource type="Script" path="res://Scripts/scene_manager.gd" id="5_4nsas"]
|
[ext_resource type="Script" path="res://Scripts/scene_manager.gd" id="5_4nsas"]
|
||||||
|
|
||||||
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_qkap3"]
|
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_qkap3"]
|
||||||
|
|
||||||
[sub_resource type="CircleShape2D" id="CircleShape2D_skxer"]
|
|
||||||
radius = 48.0
|
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_yfjal"]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_yfjal"]
|
||||||
size = Vector2(65, 20)
|
size = Vector2(65, 20)
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_57esh"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_fgkk4"]
|
||||||
size = Vector2(52, 56)
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ilkes"]
|
||||||
|
size = Vector2(20, 134)
|
||||||
|
|
||||||
[node name="FebFabGame" type="Node2D"]
|
[node name="FebFabGame" type="Node2D"]
|
||||||
script = ExtResource("1_amnm6")
|
script = ExtResource("1_amnm6")
|
||||||
@ -27,15 +28,6 @@ metadata/_edit_group_ = true
|
|||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Floor"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Floor"]
|
||||||
shape = SubResource("WorldBoundaryShape2D_qkap3")
|
shape = SubResource("WorldBoundaryShape2D_qkap3")
|
||||||
|
|
||||||
[node name="Trigger" type="Area2D" parent="."]
|
|
||||||
position = Vector2(727, 529)
|
|
||||||
script = ExtResource("1_a0h8u")
|
|
||||||
metadata/_edit_group_ = true
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Trigger"]
|
|
||||||
shape = SubResource("CircleShape2D_skxer")
|
|
||||||
debug_color = Color(0.50428, 0.445656, 0.95237, 0.42)
|
|
||||||
|
|
||||||
[node name="Level" type="Node2D" parent="."]
|
[node name="Level" type="Node2D" parent="."]
|
||||||
|
|
||||||
[node name="Brick" type="StaticBody2D" parent="Level"]
|
[node name="Brick" type="StaticBody2D" parent="Level"]
|
||||||
@ -65,44 +57,23 @@ shape = SubResource("RectangleShape2D_yfjal")
|
|||||||
|
|
||||||
[node name="Crates" type="Node2D" parent="."]
|
[node name="Crates" type="Node2D" parent="."]
|
||||||
|
|
||||||
[node name="Crate1" type="RigidBody2D" parent="Crates"]
|
[node name="Crate1" parent="Crates" instance=ExtResource("3_gnicf")]
|
||||||
position = Vector2(642, 251)
|
position = Vector2(604, 239)
|
||||||
rotation = -0.585206
|
rotation = -0.26268
|
||||||
metadata/_edit_group_ = true
|
script = ExtResource("4_5gakl")
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Crates/Crate1"]
|
[node name="Crate2" parent="Crates" instance=ExtResource("3_gnicf")]
|
||||||
shape = SubResource("RectangleShape2D_57esh")
|
position = Vector2(340, 130)
|
||||||
debug_color = Color(0.812962, 0.406946, 0.115236, 0.42)
|
rotation = 0.262166
|
||||||
|
script = ExtResource("4_5gakl")
|
||||||
|
|
||||||
[node name="Crate4" type="RigidBody2D" parent="Crates"]
|
[node name="Crate3" parent="Crates" instance=ExtResource("3_gnicf")]
|
||||||
position = Vector2(353, 97)
|
position = Vector2(849, 118)
|
||||||
rotation = 1.62165
|
rotation = -0.248451
|
||||||
metadata/_edit_group_ = true
|
script = ExtResource("4_5gakl")
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Crates/Crate4"]
|
|
||||||
shape = SubResource("RectangleShape2D_57esh")
|
|
||||||
debug_color = Color(0.812962, 0.406946, 0.115236, 0.42)
|
|
||||||
|
|
||||||
[node name="Crate2" type="RigidBody2D" parent="Crates"]
|
|
||||||
position = Vector2(664, 155)
|
|
||||||
rotation = 0.531432
|
|
||||||
metadata/_edit_group_ = true
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Crates/Crate2"]
|
|
||||||
shape = SubResource("RectangleShape2D_57esh")
|
|
||||||
debug_color = Color(0.812962, 0.406946, 0.115236, 0.42)
|
|
||||||
|
|
||||||
[node name="Crate3" type="RigidBody2D" parent="Crates"]
|
|
||||||
position = Vector2(843, 88)
|
|
||||||
rotation = 0.531432
|
|
||||||
metadata/_edit_group_ = true
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Crates/Crate3"]
|
|
||||||
shape = SubResource("RectangleShape2D_57esh")
|
|
||||||
debug_color = Color(0.812962, 0.406946, 0.115236, 0.42)
|
|
||||||
|
|
||||||
[node name="CharacterBody2D" parent="." instance=ExtResource("3_3yq6m")]
|
[node name="CharacterBody2D" parent="." instance=ExtResource("3_3yq6m")]
|
||||||
position = Vector2(440, 243)
|
position = Vector2(158, 94)
|
||||||
|
|
||||||
[node name="Area2D" parent="." instance=ExtResource("4_bk63h")]
|
[node name="Area2D" parent="." instance=ExtResource("4_bk63h")]
|
||||||
position = Vector2(236, 307)
|
position = Vector2(236, 307)
|
||||||
@ -111,5 +82,20 @@ position = Vector2(236, 307)
|
|||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
script = ExtResource("5_4nsas")
|
script = ExtResource("5_4nsas")
|
||||||
|
|
||||||
[connection signal="areaTrigger" from="Trigger" to="." method="_on_trigger_area_trigger"]
|
[node name="triggers" type="Node2D" parent="."]
|
||||||
[connection signal="body_entered" from="Trigger" to="Trigger" method="_on_body_entered"]
|
|
||||||
|
[node name="Trigger" parent="triggers" instance=ExtResource("2_k6dhr")]
|
||||||
|
effect = "destroy"
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="triggers/Trigger"]
|
||||||
|
shape = SubResource("CircleShape2D_fgkk4")
|
||||||
|
debug_color = Color(0.62821, 0.394472, 0.903221, 0.42)
|
||||||
|
|
||||||
|
[node name="powerup" parent="triggers" instance=ExtResource("2_k6dhr")]
|
||||||
|
position = Vector2(949, 469)
|
||||||
|
effect = "powerup"
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="triggers/powerup"]
|
||||||
|
position = Vector2(4, -1)
|
||||||
|
shape = SubResource("RectangleShape2D_ilkes")
|
||||||
|
debug_color = Color(0.304464, 0.623664, 0.204875, 0.42)
|
||||||
|
@ -1,9 +1,177 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://b0snboj7mbad5"]
|
[gd_scene load_steps=28 format=3 uid="uid://b0snboj7mbad5"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://Scripts/Player.gd" id="1_mjl5w"]
|
[ext_resource type="Script" path="res://Scripts/Player.gd" id="1_mjl5w"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://jnn6hcmfgyfo" path="res://Assets/graphics/player/idle/Player Idle 48x48.png" id="2_20p21"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://ciaht230dnmu3" path="res://Assets/graphics/player/run/player run 48x48.png" id="3_ergv2"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bv1oc2iwohejk" path="res://Assets/graphics/player/jump/player jump 48x48.png" id="3_riawr"]
|
||||||
|
|
||||||
[sub_resource type="CircleShape2D" id="CircleShape2D_xiumq"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_xiumq"]
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_u237n"]
|
||||||
|
atlas = ExtResource("2_20p21")
|
||||||
|
region = Rect2(0, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_mwuqw"]
|
||||||
|
atlas = ExtResource("2_20p21")
|
||||||
|
region = Rect2(48, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_gtkhb"]
|
||||||
|
atlas = ExtResource("2_20p21")
|
||||||
|
region = Rect2(96, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_vtevr"]
|
||||||
|
atlas = ExtResource("2_20p21")
|
||||||
|
region = Rect2(144, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_jrohu"]
|
||||||
|
atlas = ExtResource("2_20p21")
|
||||||
|
region = Rect2(192, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_rgamt"]
|
||||||
|
atlas = ExtResource("2_20p21")
|
||||||
|
region = Rect2(240, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_puq2s"]
|
||||||
|
atlas = ExtResource("2_20p21")
|
||||||
|
region = Rect2(288, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_ppcu1"]
|
||||||
|
atlas = ExtResource("2_20p21")
|
||||||
|
region = Rect2(336, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_0p4g1"]
|
||||||
|
atlas = ExtResource("2_20p21")
|
||||||
|
region = Rect2(384, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_dg258"]
|
||||||
|
atlas = ExtResource("2_20p21")
|
||||||
|
region = Rect2(432, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_ehgkh"]
|
||||||
|
atlas = ExtResource("3_riawr")
|
||||||
|
region = Rect2(0, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_w5jq5"]
|
||||||
|
atlas = ExtResource("3_riawr")
|
||||||
|
region = Rect2(48, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_d44wy"]
|
||||||
|
atlas = ExtResource("3_riawr")
|
||||||
|
region = Rect2(96, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_yr6yg"]
|
||||||
|
atlas = ExtResource("3_ergv2")
|
||||||
|
region = Rect2(0, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_tefua"]
|
||||||
|
atlas = ExtResource("3_ergv2")
|
||||||
|
region = Rect2(48, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_f0env"]
|
||||||
|
atlas = ExtResource("3_ergv2")
|
||||||
|
region = Rect2(96, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_uigva"]
|
||||||
|
atlas = ExtResource("3_ergv2")
|
||||||
|
region = Rect2(144, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_kiw7g"]
|
||||||
|
atlas = ExtResource("3_ergv2")
|
||||||
|
region = Rect2(192, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_5wcjn"]
|
||||||
|
atlas = ExtResource("3_ergv2")
|
||||||
|
region = Rect2(240, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_htmkr"]
|
||||||
|
atlas = ExtResource("3_ergv2")
|
||||||
|
region = Rect2(288, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_dyj62"]
|
||||||
|
atlas = ExtResource("3_ergv2")
|
||||||
|
region = Rect2(336, 0, 48, 48)
|
||||||
|
|
||||||
|
[sub_resource type="SpriteFrames" id="SpriteFrames_tbufb"]
|
||||||
|
animations = [{
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_u237n")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_mwuqw")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_gtkhb")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_vtevr")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_jrohu")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_rgamt")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_puq2s")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_ppcu1")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_0p4g1")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_dg258")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"idle",
|
||||||
|
"speed": 12.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_ehgkh")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_w5jq5")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_d44wy")
|
||||||
|
}],
|
||||||
|
"loop": false,
|
||||||
|
"name": &"jump",
|
||||||
|
"speed": 9.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_yr6yg")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_tefua")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_f0env")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_uigva")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_kiw7g")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_5wcjn")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_htmkr")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_dyj62")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"run",
|
||||||
|
"speed": 12.0
|
||||||
|
}]
|
||||||
|
|
||||||
[node name="CharacterBody2D" type="CharacterBody2D"]
|
[node name="CharacterBody2D" type="CharacterBody2D"]
|
||||||
script = ExtResource("1_mjl5w")
|
script = ExtResource("1_mjl5w")
|
||||||
metadata/_edit_group_ = true
|
metadata/_edit_group_ = true
|
||||||
@ -23,3 +191,13 @@ position = Vector2(24, -26)
|
|||||||
|
|
||||||
[node name="leftTarget" type="Node2D" parent="."]
|
[node name="leftTarget" type="Node2D" parent="."]
|
||||||
position = Vector2(-25, -26)
|
position = Vector2(-25, -26)
|
||||||
|
|
||||||
|
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||||
|
texture_filter = 1
|
||||||
|
position = Vector2(2, -11)
|
||||||
|
scale = Vector2(1.54734, 1.26736)
|
||||||
|
sprite_frames = SubResource("SpriteFrames_tbufb")
|
||||||
|
animation = &"jump"
|
||||||
|
autoplay = "jump"
|
||||||
|
|
||||||
|
[node name="Camera2D" type="Camera2D" parent="."]
|
||||||
|
10
febfabgame/Scenes/trigger.tscn
Normal file
10
febfabgame/Scenes/trigger.tscn
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://d0ve3ds64sk3p"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://Scripts/trigger.gd" id="1_0ht8v"]
|
||||||
|
|
||||||
|
[node name="Trigger" type="Area2D"]
|
||||||
|
position = Vector2(727, 529)
|
||||||
|
script = ExtResource("1_0ht8v")
|
||||||
|
metadata/_edit_group_ = true
|
||||||
|
|
||||||
|
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
@ -1,4 +1,5 @@
|
|||||||
extends CharacterBody2D
|
class_name Player extends CharacterBody2D
|
||||||
|
@onready var playerGraphic: AnimatedSprite2D = $AnimatedSprite2D
|
||||||
|
|
||||||
|
|
||||||
const SPEED = 200.0
|
const SPEED = 200.0
|
||||||
@ -9,6 +10,7 @@ var faceLeft = false
|
|||||||
var pushRightEnabled = false
|
var pushRightEnabled = false
|
||||||
var pushLeftEnabled = false
|
var pushLeftEnabled = false
|
||||||
var pushTarget
|
var pushTarget
|
||||||
|
var isJumping = false
|
||||||
|
|
||||||
@onready var right_cast: RayCast2D = $rightCast
|
@onready var right_cast: RayCast2D = $rightCast
|
||||||
@onready var left_cast: RayCast2D = $leftCast
|
@onready var left_cast: RayCast2D = $leftCast
|
||||||
@ -21,10 +23,16 @@ func _physics_process(delta: float) -> void:
|
|||||||
# 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:
|
||||||
|
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():
|
||||||
velocity.y = JUMP_VELOCITY
|
velocity.y = JUMP_VELOCITY
|
||||||
|
isJumping = true
|
||||||
|
playerGraphic.play("jump")
|
||||||
|
|
||||||
# Get the input direction and handle the movement/deceleration.
|
# Get the input direction and handle the movement/deceleration.
|
||||||
# As good practice, you should replace UI actions with custom gameplay actions.
|
# As good practice, you should replace UI actions with custom gameplay actions.
|
||||||
@ -47,11 +55,19 @@ func _physics_process(delta: float) -> void:
|
|||||||
velocity.x = direction * SPEED
|
velocity.x = direction * SPEED
|
||||||
else:
|
else:
|
||||||
velocity.x = move_toward(velocity.x, 0, SPEED)
|
velocity.x = move_toward(velocity.x, 0, SPEED)
|
||||||
|
if direction:
|
||||||
|
if not isJumping:
|
||||||
|
playerGraphic.play("run")
|
||||||
|
if direction ==0:
|
||||||
|
if not isJumping:
|
||||||
|
playerGraphic.play("idle")
|
||||||
|
|
||||||
if direction <0:
|
if direction <0:
|
||||||
faceLeft = true
|
faceLeft = true
|
||||||
|
playerGraphic.flip_h = true
|
||||||
if direction >0:
|
if direction >0:
|
||||||
faceLeft = false
|
faceLeft = false
|
||||||
|
playerGraphic.flip_h = false
|
||||||
|
|
||||||
|
|
||||||
move_and_slide()
|
move_and_slide()
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
class_name Bullet extends Area2D
|
class_name Bullet extends Area2D
|
||||||
|
@onready var bulletGraphic: Sprite2D = $Sprite2D
|
||||||
|
|
||||||
var speed = 750
|
var speed = 750
|
||||||
|
|
||||||
@ -6,6 +7,10 @@ signal hit(bullet, body)
|
|||||||
|
|
||||||
func setSpeed(value):
|
func setSpeed(value):
|
||||||
speed = value
|
speed = value
|
||||||
|
if speed <0:
|
||||||
|
bulletGraphic.flip_h = true
|
||||||
|
if speed >0:
|
||||||
|
bulletGraphic.flip_h = false
|
||||||
|
|
||||||
#animation
|
#animation
|
||||||
func _physics_process(delta: float) -> void:
|
func _physics_process(delta: float) -> void:
|
||||||
@ -14,4 +19,5 @@ func _physics_process(delta: float) -> void:
|
|||||||
|
|
||||||
func _on_body_shape_entered(body_rid: RID, body: Node2D, body_shape_index: int, local_shape_index: int) -> void:
|
func _on_body_shape_entered(body_rid: RID, body: Node2D, body_shape_index: int, local_shape_index: int) -> void:
|
||||||
print("bullet collision")
|
print("bullet collision")
|
||||||
|
if not body is Player:
|
||||||
hit.emit(self, body)
|
hit.emit(self, body)
|
||||||
|
1
febfabgame/Scripts/crate.gd
Normal file
1
febfabgame/Scripts/crate.gd
Normal file
@ -0,0 +1 @@
|
|||||||
|
class_name Crate extends RigidBody2D
|
@ -1,4 +1,4 @@
|
|||||||
extends Node2D
|
class_name GameController extends Node2D
|
||||||
|
|
||||||
# Game Data
|
# Game Data
|
||||||
var totalCrates = 4
|
var totalCrates = 4
|
||||||
@ -9,17 +9,35 @@ var cratesDestroyed = 0
|
|||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
pass # Replace with function body.
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
func _on_trigger_area_trigger(body) -> void:
|
func _on_trigger_area_trigger(effect, body) -> void:
|
||||||
print("game controller knows about crate destruction")
|
print("Do effect "+effect)
|
||||||
|
match effect:
|
||||||
|
"destroy":
|
||||||
|
#write code to destroy
|
||||||
|
if body is Crate:
|
||||||
|
%SceneManager.destroy(body)
|
||||||
cratesDestroyed +=1
|
cratesDestroyed +=1
|
||||||
totalCrates -=1
|
"powerup":
|
||||||
#kill em
|
#write code to powerup
|
||||||
body.queue_free()
|
if body is Player:
|
||||||
if totalCrates <=0:
|
print("POWERRRRRR UP")
|
||||||
print("win")
|
#Player.SPEED = 700
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
func bulletHit(body):
|
||||||
|
print("game controller knows bullet hit")
|
||||||
|
if body is Crate:
|
||||||
|
print("you've hit a crate")
|
||||||
|
cratesDestroyed +=1
|
||||||
|
%SceneManager.destroy(body)
|
||||||
|
print("crates Remaining :: "+str(totalCrates - cratesDestroyed))
|
||||||
|
|
||||||
|
func numberOfCrates(value):
|
||||||
|
totalCrates = value
|
||||||
|
print("Game Controller know scrates "+str(totalCrates))
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
extends Node
|
extends Node
|
||||||
|
@onready var gameController: GameController = $".."
|
||||||
|
@onready var crates: Node2D = $"../Crates"
|
||||||
|
@onready var triggers: Node2D = $"../triggers"
|
||||||
|
|
||||||
var bulletsFiredTotal = 0
|
var bulletsFiredTotal = 0
|
||||||
var bulletsMadeTotal = 0
|
var bulletsMadeTotal = 0
|
||||||
@ -19,6 +22,7 @@ func bulletFactory():
|
|||||||
|
|
||||||
bulletArray.push_front(mybullet)
|
bulletArray.push_front(mybullet)
|
||||||
return mybullet
|
return mybullet
|
||||||
|
|
||||||
# order desk for bullets
|
# order desk for bullets
|
||||||
func makeBullet(position, speed):
|
func makeBullet(position, speed):
|
||||||
print("make a bullet")
|
print("make a bullet")
|
||||||
@ -26,11 +30,30 @@ func makeBullet(position, speed):
|
|||||||
owner.add_child(newBullet)
|
owner.add_child(newBullet)
|
||||||
newBullet.setSpeed(speed)
|
newBullet.setSpeed(speed)
|
||||||
newBullet.transform = position
|
newBullet.transform = position
|
||||||
|
|
||||||
func bulletHit(bullet, body):
|
func bulletHit(bullet, body):
|
||||||
print("tell the game controller a bullet hit smthn")
|
print("tell the game controller a bullet hit smthn")
|
||||||
|
gameController.bulletHit(body)
|
||||||
|
bullet.setSpeed(0)
|
||||||
|
bullet.position = Vector2(-100,-100)
|
||||||
|
|
||||||
|
func destroy(body):
|
||||||
|
body.queue_free()
|
||||||
|
|
||||||
|
func buildLevel():
|
||||||
|
#how many crates?
|
||||||
|
var totalCrates = 0
|
||||||
|
for obj in crates.get_children():
|
||||||
|
if obj is Crate:
|
||||||
|
totalCrates +=1
|
||||||
|
gameController.numberOfCrates(totalCrates)
|
||||||
|
|
||||||
|
#wire up the triggers
|
||||||
|
for obj in triggers.get_children():
|
||||||
|
if obj is Trigger:
|
||||||
|
#wire up to GC
|
||||||
|
obj.areaTrigger.connect(gameController._on_trigger_area_trigger)
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
buildLevel()
|
||||||
|
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
extends Area2D
|
class_name Trigger extends Area2D
|
||||||
|
@export var effect="alert"
|
||||||
|
|
||||||
signal areaTrigger(Object)
|
signal areaTrigger(effect, Object)
|
||||||
# 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:
|
||||||
print("Trigger is Active")
|
print("Trigger is Active")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
pass
|
pass
|
||||||
@ -13,4 +15,4 @@ func _process(delta: float) -> void:
|
|||||||
|
|
||||||
func _on_body_entered(body: Node2D) -> void:
|
func _on_body_entered(body: Node2D) -> void:
|
||||||
print("body collision in trigger")
|
print("body collision in trigger")
|
||||||
areaTrigger.emit(body)
|
areaTrigger.emit(effect, body)
|
||||||
|
@ -15,6 +15,14 @@ run/main_scene="res://Scenes/feb_fab_game.tscn"
|
|||||||
config/features=PackedStringArray("4.3", "Forward Plus")
|
config/features=PackedStringArray("4.3", "Forward Plus")
|
||||||
config/icon="res://icon.svg"
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
[display]
|
||||||
|
|
||||||
|
window/size/viewport_width=428
|
||||||
|
window/size/viewport_height=240
|
||||||
|
window/size/window_width_override=960
|
||||||
|
window/size/window_height_override=540
|
||||||
|
window/stretch/mode="viewport"
|
||||||
|
|
||||||
[file_customization]
|
[file_customization]
|
||||||
|
|
||||||
folder_colors={
|
folder_colors={
|
||||||
|
Loading…
Reference in New Issue
Block a user