week 5 updates player death bad guy coin
BIN
graphics/Pickups/coin.png
Normal file
After Width: | Height: | Size: 500 B |
34
graphics/Pickups/coin.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://y2iyy6fajlpf"
|
||||
path="res://.godot/imported/coin.png-9d294b634c056a1b95059ab6d3526774.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://graphics/Pickups/coin.png"
|
||||
dest_files=["res://.godot/imported/coin.png-9d294b634c056a1b95059ab6d3526774.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
graphics/Player Death/Player Death 64x64.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
34
graphics/Player Death/Player Death 64x64.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://da5ex8b8yeswn"
|
||||
path="res://.godot/imported/Player Death 64x64.png-264389d563a3f9dc55af6fd3aea47ce0.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://graphics/Player Death/Player Death 64x64.png"
|
||||
dest_files=["res://.godot/imported/Player Death 64x64.png-264389d563a3f9dc55af6fd3aea47ce0.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
graphics/Player Idle/Player Idle 48x48.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
34
graphics/Player Idle/Player Idle 48x48.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c0iiaebonyhh0"
|
||||
path="res://.godot/imported/Player Idle 48x48.png-9d0ebbdd3af528b7baa768536e9921f5.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://graphics/Player Idle/Player Idle 48x48.png"
|
||||
dest_files=["res://.godot/imported/Player Idle 48x48.png-9d0ebbdd3af528b7baa768536e9921f5.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
graphics/Player Jump/player jump 48x48.png
Normal file
After Width: | Height: | Size: 1021 B |
34
graphics/Player Jump/player jump 48x48.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://xgoqfqmvorcx"
|
||||
path="res://.godot/imported/player jump 48x48.png-30fb614b31de2bf3f0640a42978d0f0d.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://graphics/Player Jump/player jump 48x48.png"
|
||||
dest_files=["res://.godot/imported/player jump 48x48.png-30fb614b31de2bf3f0640a42978d0f0d.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
graphics/Player Land/player land 48x48.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
34
graphics/Player Land/player land 48x48.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bp4ir0imtf7np"
|
||||
path="res://.godot/imported/player land 48x48.png-ca78f72faa9424933c45e63da58f816f.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://graphics/Player Land/player land 48x48.png"
|
||||
dest_files=["res://.godot/imported/player land 48x48.png-ca78f72faa9424933c45e63da58f816f.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
graphics/Player Run/player run 48x48.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
34
graphics/Player Run/player run 48x48.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://vn23qn3f0dvc"
|
||||
path="res://.godot/imported/player run 48x48.png-663ce7f26bc17051795707eaf81496ab.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://graphics/Player Run/player run 48x48.png"
|
||||
dest_files=["res://.godot/imported/player run 48x48.png-663ce7f26bc17051795707eaf81496ab.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
graphics/Terrain (32x32).png
Normal file
After Width: | Height: | Size: 12 KiB |
34
graphics/Terrain (32x32).png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dwb83f7uoweuy"
|
||||
path="res://.godot/imported/Terrain (32x32).png-ad70ba78825a684cda25de60298b49f9.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://graphics/Terrain (32x32).png"
|
||||
dest_files=["res://.godot/imported/Terrain (32x32).png-ad70ba78825a684cda25de60298b49f9.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
graphics/background/Additional Sky.png
Normal file
After Width: | Height: | Size: 123 B |
34
graphics/background/Additional Sky.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cw50mfjp2np08"
|
||||
path="res://.godot/imported/Additional Sky.png-0c545090cde9f2fc7e943a672b099c59.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://graphics/background/Additional Sky.png"
|
||||
dest_files=["res://.godot/imported/Additional Sky.png-0c545090cde9f2fc7e943a672b099c59.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
graphics/background/Additional Water.png
Normal file
After Width: | Height: | Size: 122 B |
34
graphics/background/Additional Water.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://6olcj1w1svdg"
|
||||
path="res://.godot/imported/Additional Water.png-bf782f3705a1acaec1e3ab97da39a373.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://graphics/background/Additional Water.png"
|
||||
dest_files=["res://.godot/imported/Additional Water.png-bf782f3705a1acaec1e3ab97da39a373.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
graphics/background/BG Image.png
Normal file
After Width: | Height: | Size: 586 B |
34
graphics/background/BG Image.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dly4g7fvvtamm"
|
||||
path="res://.godot/imported/BG Image.png-a4c16c98f815c26fe14456abfb54be92.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://graphics/background/BG Image.png"
|
||||
dest_files=["res://.godot/imported/BG Image.png-a4c16c98f815c26fe14456abfb54be92.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
graphics/enemies/slime_green.png
Normal file
After Width: | Height: | Size: 908 B |
34
graphics/enemies/slime_green.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://g36kny3mvw6x"
|
||||
path="res://.godot/imported/slime_green.png-5465ec1b559c454faabc599e0b746844.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://graphics/enemies/slime_green.png"
|
||||
dest_files=["res://.godot/imported/slime_green.png-5465ec1b559c454faabc599e0b746844.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
graphics/enemies/slime_purple.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
34
graphics/enemies/slime_purple.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c8hsfbd7xivvq"
|
||||
path="res://.godot/imported/slime_purple.png-680c7cb80731795ced97a298ff076baf.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://graphics/enemies/slime_purple.png"
|
||||
dest_files=["res://.godot/imported/slime_purple.png-680c7cb80731795ced97a298ff076baf.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
graphics/items/cannister.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
34
graphics/items/cannister.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ddxm7hj323fta"
|
||||
path="res://.godot/imported/cannister.png-dd6ec018393de849194ddc30245abbc4.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://graphics/items/cannister.png"
|
||||
dest_files=["res://.godot/imported/cannister.png-dd6ec018393de849194ddc30245abbc4.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
|
@ -10,7 +10,7 @@ config_version=5
|
||||
|
||||
[application]
|
||||
|
||||
config/name="Fastboy_game"
|
||||
config/name="Week5-OriginalExample"
|
||||
run/main_scene="res://scenes/game.tscn"
|
||||
config/features=PackedStringArray("4.2", "Forward Plus")
|
||||
config/icon="res://icon.svg"
|
||||
|
72
scenes/badguy.tscn
Normal file
@ -0,0 +1,72 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://b1e3f1x6ma6xj"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c8hsfbd7xivvq" path="res://graphics/enemies/slime_purple.png" id="1_s6gia"]
|
||||
[ext_resource type="Script" path="res://scripts/badguy.gd" id="1_yw86w"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_crt5n"]
|
||||
atlas = ExtResource("1_s6gia")
|
||||
region = Rect2(0, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_c0cy8"]
|
||||
atlas = ExtResource("1_s6gia")
|
||||
region = Rect2(24, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_libug"]
|
||||
atlas = ExtResource("1_s6gia")
|
||||
region = Rect2(48, 24, 24, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_c677q"]
|
||||
atlas = ExtResource("1_s6gia")
|
||||
region = Rect2(72, 24, 24, 24)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_nefl5"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_crt5n")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_c0cy8")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_libug")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_c677q")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 12.0
|
||||
}]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4hxnd"]
|
||||
size = Vector2(16, 15)
|
||||
|
||||
[node name="Area2D" type="Area2D"]
|
||||
script = ExtResource("1_yw86w")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
sprite_frames = SubResource("SpriteFrames_nefl5")
|
||||
autoplay = "default"
|
||||
frame_progress = 0.296324
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, 4.5)
|
||||
shape = SubResource("RectangleShape2D_4hxnd")
|
||||
|
||||
[node name="RightCast" type="RayCast2D" parent="."]
|
||||
target_position = Vector2(14, 0)
|
||||
|
||||
[node name="LeftCast" type="RayCast2D" parent="."]
|
||||
target_position = Vector2(-14, 1)
|
||||
|
||||
[node name="RightFloorCast" type="RayCast2D" parent="."]
|
||||
position = Vector2(9, 5)
|
||||
target_position = Vector2(0, 13)
|
||||
|
||||
[node name="LeftFloorCast" type="RayCast2D" parent="."]
|
||||
position = Vector2(-9, 5)
|
||||
target_position = Vector2(0, 13)
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
@ -1,7 +1,6 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://c5bftwgkssaf2"]
|
||||
[gd_scene load_steps=3 format=3 uid="uid://c5bftwgkssaf2"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/bullet.gd" id="1_t2eet"]
|
||||
[ext_resource type="Texture2D" uid="uid://igucpibx1n1g" path="res://Graphics/bullet.png" id="2_6s1iq"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_1gtqp"]
|
||||
radius = 6.0
|
||||
@ -13,8 +12,4 @@ script = ExtResource("1_t2eet")
|
||||
shape = SubResource("CircleShape2D_1gtqp")
|
||||
debug_color = Color(0.721569, 0.337255, 0.854902, 0.419608)
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
scale = Vector2(0.189189, 0.189189)
|
||||
texture = ExtResource("2_6s1iq")
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
|
@ -1,172 +1,248 @@
|
||||
[gd_scene load_steps=28 format=3 uid="uid://go4yc8hfo1gq"]
|
||||
[gd_scene load_steps=39 format=3 uid="uid://go4yc8hfo1gq"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/CharacterBody2D.gd" id="1_x87yo"]
|
||||
[ext_resource type="Texture2D" uid="uid://rvqjq6nksgag" path="res://Graphics/Player Idle 48x48.png" id="2_2t4h1"]
|
||||
[ext_resource type="Texture2D" uid="uid://bdelbnqhy0kn2" path="res://Graphics/player run 48x48.png" id="3_0aqmh"]
|
||||
[ext_resource type="Texture2D" uid="uid://hsovsssoucoy" path="res://Graphics/player jump 48x48.png" id="3_j04d8"]
|
||||
[ext_resource type="Texture2D" uid="uid://c0iiaebonyhh0" path="res://graphics/Player Idle/Player Idle 48x48.png" id="2_hyqch"]
|
||||
[ext_resource type="Texture2D" uid="uid://da5ex8b8yeswn" path="res://graphics/Player Death/Player Death 64x64.png" id="2_jtwbt"]
|
||||
[ext_resource type="Texture2D" uid="uid://xgoqfqmvorcx" path="res://graphics/Player Jump/player jump 48x48.png" id="3_mp84c"]
|
||||
[ext_resource type="Texture2D" uid="uid://vn23qn3f0dvc" path="res://graphics/Player Run/player run 48x48.png" id="4_bok64"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_taqqu"]
|
||||
atlas = ExtResource("2_2t4h1")
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qm3ke"]
|
||||
atlas = ExtResource("2_jtwbt")
|
||||
region = Rect2(0, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_uwwnn"]
|
||||
atlas = ExtResource("2_2t4h1")
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_482sd"]
|
||||
atlas = ExtResource("2_jtwbt")
|
||||
region = Rect2(48, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_obxfn"]
|
||||
atlas = ExtResource("2_2t4h1")
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mewyd"]
|
||||
atlas = ExtResource("2_jtwbt")
|
||||
region = Rect2(96, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_27f1c"]
|
||||
atlas = ExtResource("2_2t4h1")
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_3fmye"]
|
||||
atlas = ExtResource("2_jtwbt")
|
||||
region = Rect2(144, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_m4w16"]
|
||||
atlas = ExtResource("2_2t4h1")
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_3to10"]
|
||||
atlas = ExtResource("2_jtwbt")
|
||||
region = Rect2(192, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_x118l"]
|
||||
atlas = ExtResource("2_2t4h1")
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_eax7s"]
|
||||
atlas = ExtResource("2_jtwbt")
|
||||
region = Rect2(240, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0sj8s"]
|
||||
atlas = ExtResource("2_2t4h1")
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_fte8r"]
|
||||
atlas = ExtResource("2_jtwbt")
|
||||
region = Rect2(288, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_q0kja"]
|
||||
atlas = ExtResource("2_2t4h1")
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_7raye"]
|
||||
atlas = ExtResource("2_jtwbt")
|
||||
region = Rect2(336, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_yyvuv"]
|
||||
atlas = ExtResource("2_2t4h1")
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_o0lsx"]
|
||||
atlas = ExtResource("2_jtwbt")
|
||||
region = Rect2(384, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_bpuxv"]
|
||||
atlas = ExtResource("2_2t4h1")
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_4s6yc"]
|
||||
atlas = ExtResource("2_jtwbt")
|
||||
region = Rect2(432, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_k4ctm"]
|
||||
atlas = ExtResource("3_j04d8")
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_htcu2"]
|
||||
atlas = ExtResource("2_hyqch")
|
||||
region = Rect2(0, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0x1fh"]
|
||||
atlas = ExtResource("3_j04d8")
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ontj7"]
|
||||
atlas = ExtResource("2_hyqch")
|
||||
region = Rect2(48, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_bffbs"]
|
||||
atlas = ExtResource("3_j04d8")
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gv7tn"]
|
||||
atlas = ExtResource("2_hyqch")
|
||||
region = Rect2(96, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_fd8ov"]
|
||||
atlas = ExtResource("3_0aqmh")
|
||||
region = Rect2(0, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_rhevl"]
|
||||
atlas = ExtResource("3_0aqmh")
|
||||
region = Rect2(48, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_d6e16"]
|
||||
atlas = ExtResource("3_0aqmh")
|
||||
region = Rect2(96, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_de1q6"]
|
||||
atlas = ExtResource("3_0aqmh")
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_f4ltu"]
|
||||
atlas = ExtResource("2_hyqch")
|
||||
region = Rect2(144, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_j4m8h"]
|
||||
atlas = ExtResource("3_0aqmh")
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_m44rj"]
|
||||
atlas = ExtResource("2_hyqch")
|
||||
region = Rect2(192, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_i3vl8"]
|
||||
atlas = ExtResource("3_0aqmh")
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mvrul"]
|
||||
atlas = ExtResource("2_hyqch")
|
||||
region = Rect2(240, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_yjjpf"]
|
||||
atlas = ExtResource("3_0aqmh")
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_cq1wt"]
|
||||
atlas = ExtResource("2_hyqch")
|
||||
region = Rect2(288, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_uvphg"]
|
||||
atlas = ExtResource("3_0aqmh")
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5mc5v"]
|
||||
atlas = ExtResource("2_hyqch")
|
||||
region = Rect2(336, 0, 48, 48)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_k63ce"]
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_yclfw"]
|
||||
atlas = ExtResource("2_hyqch")
|
||||
region = Rect2(384, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_rgyuc"]
|
||||
atlas = ExtResource("2_hyqch")
|
||||
region = Rect2(432, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_pbehb"]
|
||||
atlas = ExtResource("3_mp84c")
|
||||
region = Rect2(0, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_o4ud8"]
|
||||
atlas = ExtResource("3_mp84c")
|
||||
region = Rect2(48, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ivggc"]
|
||||
atlas = ExtResource("3_mp84c")
|
||||
region = Rect2(96, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_d6cbg"]
|
||||
atlas = ExtResource("4_bok64")
|
||||
region = Rect2(0, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_cyg7w"]
|
||||
atlas = ExtResource("4_bok64")
|
||||
region = Rect2(48, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_lejph"]
|
||||
atlas = ExtResource("4_bok64")
|
||||
region = Rect2(96, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_cu62b"]
|
||||
atlas = ExtResource("4_bok64")
|
||||
region = Rect2(144, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vio7d"]
|
||||
atlas = ExtResource("4_bok64")
|
||||
region = Rect2(192, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_t6raw"]
|
||||
atlas = ExtResource("4_bok64")
|
||||
region = Rect2(240, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_srqae"]
|
||||
atlas = ExtResource("4_bok64")
|
||||
region = Rect2(288, 0, 48, 48)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dfgfp"]
|
||||
atlas = ExtResource("4_bok64")
|
||||
region = Rect2(336, 0, 48, 48)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_a6t6h"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_taqqu")
|
||||
"texture": SubResource("AtlasTexture_qm3ke")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_uwwnn")
|
||||
"texture": SubResource("AtlasTexture_482sd")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_obxfn")
|
||||
"texture": SubResource("AtlasTexture_mewyd")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_27f1c")
|
||||
"texture": SubResource("AtlasTexture_3fmye")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_m4w16")
|
||||
"texture": SubResource("AtlasTexture_3to10")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_x118l")
|
||||
"texture": SubResource("AtlasTexture_eax7s")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_0sj8s")
|
||||
"texture": SubResource("AtlasTexture_fte8r")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_q0kja")
|
||||
"texture": SubResource("AtlasTexture_7raye")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_yyvuv")
|
||||
"texture": SubResource("AtlasTexture_o0lsx")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_bpuxv")
|
||||
"texture": SubResource("AtlasTexture_4s6yc")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"death",
|
||||
"speed": 12.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_htcu2")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ontj7")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_gv7tn")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_f4ltu")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_m44rj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_mvrul")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_cq1wt")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_5mc5v")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_yclfw")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_rgyuc")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"Idle",
|
||||
"name": &"idle",
|
||||
"speed": 15.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_k4ctm")
|
||||
"texture": SubResource("AtlasTexture_pbehb")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_0x1fh")
|
||||
"texture": SubResource("AtlasTexture_o4ud8")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_bffbs")
|
||||
"texture": SubResource("AtlasTexture_ivggc")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"Jump",
|
||||
"loop": false,
|
||||
"name": &"jump",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_fd8ov")
|
||||
"texture": SubResource("AtlasTexture_d6cbg")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_rhevl")
|
||||
"texture": SubResource("AtlasTexture_cyg7w")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_d6e16")
|
||||
"texture": SubResource("AtlasTexture_lejph")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_de1q6")
|
||||
"texture": SubResource("AtlasTexture_cu62b")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_j4m8h")
|
||||
"texture": SubResource("AtlasTexture_vio7d")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_i3vl8")
|
||||
"texture": SubResource("AtlasTexture_t6raw")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_yjjpf")
|
||||
"texture": SubResource("AtlasTexture_srqae")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_uvphg")
|
||||
"texture": SubResource("AtlasTexture_dfgfp")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"Run",
|
||||
"name": &"run",
|
||||
"speed": 15.0
|
||||
}]
|
||||
|
||||
@ -177,23 +253,25 @@ radius = 13.0384
|
||||
position = Vector2(-1, 0)
|
||||
script = ExtResource("1_x87yo")
|
||||
JUMP_VELOCITY = -500.0
|
||||
PUSH_FORCE = 200
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
sprite_frames = SubResource("SpriteFrames_k63ce")
|
||||
animation = &"Jump"
|
||||
autoplay = "Idle"
|
||||
frame_progress = 0.705333
|
||||
sprite_frames = SubResource("SpriteFrames_a6t6h")
|
||||
animation = &"run"
|
||||
autoplay = "idle"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, 3)
|
||||
shape = SubResource("CircleShape2D_ubfw4")
|
||||
|
||||
[node name="RightRay" type="RayCast2D" parent="."]
|
||||
target_position = Vector2(25, 0)
|
||||
position = Vector2(0, 3)
|
||||
target_position = Vector2(29, 0)
|
||||
|
||||
[node name="LeftRay" type="RayCast2D" parent="."]
|
||||
target_position = Vector2(-25, 0)
|
||||
position = Vector2(0, 3)
|
||||
target_position = Vector2(-29, 0)
|
||||
|
||||
[node name="MarkerRight" type="Node2D" parent="."]
|
||||
position = Vector2(16, -6)
|
||||
|
113
scenes/coin.tscn
Normal file
@ -0,0 +1,113 @@
|
||||
[gd_scene load_steps=17 format=3 uid="uid://jndg1i4d5yjx"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/coin.gd" id="1_68g3g"]
|
||||
[ext_resource type="Texture2D" uid="uid://y2iyy6fajlpf" path="res://graphics/Pickups/coin.png" id="1_b1x6x"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dayob"]
|
||||
atlas = ExtResource("1_b1x6x")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_x6trl"]
|
||||
atlas = ExtResource("1_b1x6x")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_chhsm"]
|
||||
atlas = ExtResource("1_b1x6x")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_oljes"]
|
||||
atlas = ExtResource("1_b1x6x")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_j1fax"]
|
||||
atlas = ExtResource("1_b1x6x")
|
||||
region = Rect2(64, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0slap"]
|
||||
atlas = ExtResource("1_b1x6x")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_7qmwq"]
|
||||
atlas = ExtResource("1_b1x6x")
|
||||
region = Rect2(96, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_txsyq"]
|
||||
atlas = ExtResource("1_b1x6x")
|
||||
region = Rect2(112, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vq2e6"]
|
||||
atlas = ExtResource("1_b1x6x")
|
||||
region = Rect2(128, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1371s"]
|
||||
atlas = ExtResource("1_b1x6x")
|
||||
region = Rect2(144, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_fkqkx"]
|
||||
atlas = ExtResource("1_b1x6x")
|
||||
region = Rect2(160, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_7itsh"]
|
||||
atlas = ExtResource("1_b1x6x")
|
||||
region = Rect2(176, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_24veq"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_dayob")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_x6trl")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_chhsm")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_oljes")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_j1fax")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_0slap")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_7qmwq")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_txsyq")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_vq2e6")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_1371s")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_fkqkx")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_7itsh")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 12.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_w36p2"]
|
||||
radius = 5.0
|
||||
|
||||
[node name="Area2D" type="Area2D"]
|
||||
script = ExtResource("1_68g3g")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
sprite_frames = SubResource("SpriteFrames_24veq")
|
||||
autoplay = "default"
|
||||
frame_progress = 0.488827
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_w36p2")
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
@ -1,16 +1,18 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cwfm01fpdmr1k"]
|
||||
[gd_scene load_steps=3 format=3 uid="uid://ukuu7p7vhlq"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ihg1aef42mnn" path="res://Graphics/Box.png" id="1_3bn6y"]
|
||||
[ext_resource type="Texture2D" uid="uid://ddxm7hj323fta" path="res://graphics/items/cannister.png" id="1_oikxn"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4vo4d"]
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_iuom5"]
|
||||
size = Vector2(16, 16)
|
||||
|
||||
[node name="RigidBody2D" type="RigidBody2D" groups=["boxes"]]
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
scale = Vector2(0.583333, 0.583333)
|
||||
texture = ExtResource("1_3bn6y")
|
||||
texture_filter = 1
|
||||
position = Vector2(0, -3)
|
||||
scale = Vector2(0.625, 0.625)
|
||||
texture = ExtResource("1_oikxn")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("RectangleShape2D_4vo4d")
|
||||
shape = SubResource("RectangleShape2D_iuom5")
|
||||
debug_color = Color(0.815686, 0.4, 0.207843, 0.419608)
|
||||
|
163
scenes/game.tscn
@ -1,14 +1,19 @@
|
||||
[gd_scene load_steps=14 format=3 uid="uid://y083suj12rld"]
|
||||
[gd_scene load_steps=19 format=3 uid="uid://y083suj12rld"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/gamecontroller.gd" id="1_77wyw"]
|
||||
[ext_resource type="PackedScene" uid="uid://go4yc8hfo1gq" path="res://scenes/character.tscn" id="2_64ccm"]
|
||||
[ext_resource type="Texture2D" uid="uid://iphyceyp7aay" path="res://Graphics/Terrain (32x32).png" id="2_74wn8"]
|
||||
[ext_resource type="Texture2D" uid="uid://dwb83f7uoweuy" path="res://graphics/Terrain (32x32).png" id="2_l22q1"]
|
||||
[ext_resource type="Script" path="res://scripts/Trigger.gd" id="2_nfj1w"]
|
||||
[ext_resource type="PackedScene" uid="uid://cwfm01fpdmr1k" path="res://scenes/crate.tscn" id="2_wqngy"]
|
||||
[ext_resource type="PackedScene" uid="uid://47xe40uafw3l" path="res://scenes/platform.tscn" id="6_lke75"]
|
||||
[ext_resource type="PackedScene" uid="uid://ukuu7p7vhlq" path="res://scenes/crate.tscn" id="5_u8rgi"]
|
||||
[ext_resource type="PackedScene" uid="uid://dvd1p6xue0ub2" path="res://scenes/platform.tscn" id="6_bcgm6"]
|
||||
[ext_resource type="Texture2D" uid="uid://dly4g7fvvtamm" path="res://graphics/background/BG Image.png" id="7_gwkt6"]
|
||||
[ext_resource type="Texture2D" uid="uid://cw50mfjp2np08" path="res://graphics/background/Additional Sky.png" id="8_pwboq"]
|
||||
[ext_resource type="Texture2D" uid="uid://6olcj1w1svdg" path="res://graphics/background/Additional Water.png" id="9_pi0v8"]
|
||||
[ext_resource type="PackedScene" uid="uid://jndg1i4d5yjx" path="res://scenes/coin.tscn" id="10_vpc4p"]
|
||||
[ext_resource type="PackedScene" uid="uid://b1e3f1x6ma6xj" path="res://scenes/badguy.tscn" id="11_3ypx6"]
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_vd3un"]
|
||||
texture = ExtResource("2_74wn8")
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_xg6qs"]
|
||||
texture = ExtResource("2_l22q1")
|
||||
texture_region_size = Vector2i(32, 32)
|
||||
0:0/0 = 0
|
||||
0:0/0/terrain_set = 0
|
||||
@ -177,17 +182,8 @@ texture_region_size = Vector2i(32, 32)
|
||||
6:1/0/terrains_peering_bit/top_left_corner = 0
|
||||
6:1/0/terrains_peering_bit/top_side = 0
|
||||
7:1/0 = 0
|
||||
7:1/0/terrain_set = 0
|
||||
7:1/0/terrain = 0
|
||||
7:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
7:1/0/physics_layer_0/angular_velocity = 0.0
|
||||
7:1/0/terrains_peering_bit/right_side = 0
|
||||
7:1/0/terrains_peering_bit/bottom_right_corner = 0
|
||||
7:1/0/terrains_peering_bit/bottom_side = 0
|
||||
7:1/0/terrains_peering_bit/bottom_left_corner = 0
|
||||
7:1/0/terrains_peering_bit/left_side = 0
|
||||
7:1/0/terrains_peering_bit/top_side = 0
|
||||
7:1/0/terrains_peering_bit/top_right_corner = 0
|
||||
9:1/0 = 0
|
||||
9:1/0/terrain_set = 0
|
||||
9:1/0/terrain = 0
|
||||
@ -295,6 +291,7 @@ texture_region_size = Vector2i(32, 32)
|
||||
6:3/0/physics_layer_0/angular_velocity = 0.0
|
||||
6:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
6:3/0/terrains_peering_bit/right_side = 0
|
||||
6:3/0/terrains_peering_bit/bottom_right_corner = 0
|
||||
6:3/0/terrains_peering_bit/bottom_side = 0
|
||||
6:3/0/terrains_peering_bit/top_side = 0
|
||||
6:3/0/terrains_peering_bit/top_right_corner = 0
|
||||
@ -305,6 +302,7 @@ texture_region_size = Vector2i(32, 32)
|
||||
7:3/0/physics_layer_0/angular_velocity = 0.0
|
||||
7:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
7:3/0/terrains_peering_bit/bottom_side = 0
|
||||
7:3/0/terrains_peering_bit/bottom_left_corner = 0
|
||||
7:3/0/terrains_peering_bit/left_side = 0
|
||||
7:3/0/terrains_peering_bit/top_left_corner = 0
|
||||
7:3/0/terrains_peering_bit/top_side = 0
|
||||
@ -345,6 +343,7 @@ texture_region_size = Vector2i(32, 32)
|
||||
13:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
13:3/0/physics_layer_0/angular_velocity = 0.0
|
||||
13:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
13:3/0/terrains_peering_bit/right_side = 0
|
||||
13:3/0/terrains_peering_bit/bottom_side = 0
|
||||
13:3/0/terrains_peering_bit/left_side = 0
|
||||
15:3/0 = 0
|
||||
@ -401,6 +400,7 @@ texture_region_size = Vector2i(32, 32)
|
||||
6:4/0/terrains_peering_bit/bottom_right_corner = 0
|
||||
6:4/0/terrains_peering_bit/bottom_side = 0
|
||||
6:4/0/terrains_peering_bit/top_side = 0
|
||||
6:4/0/terrains_peering_bit/top_right_corner = 0
|
||||
7:4/0 = 0
|
||||
7:4/0/terrain_set = 0
|
||||
7:4/0/terrain = 0
|
||||
@ -410,6 +410,7 @@ texture_region_size = Vector2i(32, 32)
|
||||
7:4/0/terrains_peering_bit/bottom_side = 0
|
||||
7:4/0/terrains_peering_bit/bottom_left_corner = 0
|
||||
7:4/0/terrains_peering_bit/left_side = 0
|
||||
7:4/0/terrains_peering_bit/top_left_corner = 0
|
||||
7:4/0/terrains_peering_bit/top_side = 0
|
||||
9:4/0 = 0
|
||||
9:4/0/terrain_set = 0
|
||||
@ -468,20 +469,35 @@ texture_region_size = Vector2i(32, 32)
|
||||
16:4/0/terrains_peering_bit/left_side = 0
|
||||
16:4/0/terrains_peering_bit/top_side = 0
|
||||
|
||||
[sub_resource type="TileSet" id="TileSet_p8gjw"]
|
||||
[sub_resource type="TileSet" id="TileSet_47g5u"]
|
||||
tile_size = Vector2i(32, 32)
|
||||
physics_layer_0/collision_layer = 1
|
||||
terrain_set_0/mode = 0
|
||||
terrain_set_0/terrain_0/name = "ground"
|
||||
terrain_set_0/terrain_0/color = Color(0.5, 0.34375, 0.25, 1)
|
||||
sources/0 = SubResource("TileSetAtlasSource_vd3un")
|
||||
sources/0 = SubResource("TileSetAtlasSource_xg6qs")
|
||||
|
||||
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_3u4a8"]
|
||||
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_xkyim"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_x8qck"]
|
||||
radius = 60.2993
|
||||
|
||||
[sub_resource type="Animation" id="Animation_wmrpw"]
|
||||
[sub_resource type="Animation" id="Animation_buq5q"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(472, -21)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_ueqe3"]
|
||||
resource_name = "move"
|
||||
loop_mode = 2
|
||||
tracks/0/type = "value"
|
||||
@ -494,79 +510,106 @@ tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0), Vector2(150, 0)]
|
||||
"values": [Vector2(472, -21), Vector2(540, -21)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_fpywj"]
|
||||
length = 0.001
|
||||
loop_mode = 2
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector2(0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_eotb0"]
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_36p5o"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_fpywj"),
|
||||
"move": SubResource("Animation_wmrpw")
|
||||
"RESET": SubResource("Animation_buq5q"),
|
||||
"move": SubResource("Animation_ueqe3")
|
||||
}
|
||||
|
||||
[node name="Game" type="Node2D"]
|
||||
|
||||
[node name="GameController" type="Node" parent="."]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("1_77wyw")
|
||||
|
||||
[node name="Timer" type="Timer" parent="GameController"]
|
||||
wait_time = 5.949
|
||||
|
||||
[node name="TileMap" type="TileMap" parent="."]
|
||||
tile_set = SubResource("TileSet_p8gjw")
|
||||
tile_set = SubResource("TileSet_47g5u")
|
||||
format = 2
|
||||
layer_0/tile_data = PackedInt32Array(917501, 0, 4, 917502, 65536, 4, 917503, 65536, 4, 851968, 65536, 4, 851969, 0, 0, 851970, 655360, 3, 851971, 65536, 0, 851972, 65536, 4, 851973, 0, 4, 851974, 0, 4, 851975, 0, 4, 720898, 0, 4, 720899, 0, 4, 720900, 0, 4, 655371, 0, 4, 655372, 0, 4, 655373, 0, 4, 589839, 0, 4, 589840, 0, 4, 589841, 0, 4, 262145, 65536, 1, 327681, 65536, 2, 393218, 0, 1, 458754, 0, 2, 458755, 458752, 0, 524291, 0, 2, 524292, 589824, 4, 524293, 65536, 2, 524294, 655360, 4, 524295, 131072, 2, 458759, 393216, 0, 458760, 65536, 2, 458761, 655360, 4, 458762, 65536, 2, 458763, 131072, 2, 458764, 65536, 4, 458765, 786432, 0, 524301, 0, 2, 524302, 131072, 2, 458766, 131072, 0, 393229, 262144, 1, 327693, 1048576, 3, 327692, 0, 4, 393227, 131072, 0, 393225, 65536, 0, 393226, 65536, 0, 393224, 589824, 3, 458758, 65536, 1, 393223, 65536, 0, 458757, 65536, 1, 393221, 589824, 3, 393220, 393216, 1, 393219, 65536, 1, 327683, 65536, 1, 458756, 65536, 1, 393222, 65536, 0, 327682, 458752, 0, 262146, 65536, 1, 262147, 65536, 1, 196611, 655360, 3, 196612, 131072, 0, 262148, 131072, 1, 327684, 131072, 1, 262144, 458752, 0, 196610, 65536, 0, 196609, 589824, 3, 196608, 589824, 0, 262143, 0, 0, 327679, 0, 2, 327680, 0, 2, 983046, 131072, 4, 983045, 65536, 4, 983044, 0, 4, 917507, 131072, 2, 917506, 65536, 2, 917505, 0, 2, 851964, 131072, 4, 851963, 65536, 4, 851962, 0, 4, 786425, 131072, 4, 786424, 0, 4)
|
||||
layer_0/tile_data = PackedInt32Array(262141, 262144, 2, 262142, 65536, 4, 262143, 65536, 4, 196608, 65536, 4, 196609, 65536, 4, 196610, 131072, 4, 196613, 262144, 4, 196605, 262144, 1, 131069, 262144, 1, 65534, 65536, 4, 65535, 131072, 4, 4, 131072, 2, 3, 0, 2, -65533, 0, 0, -65532, 131072, 0, 262151, 262144, 2, 196615, 262144, 0, 262153, 262144, 4, 262156, 131072, 2, 196620, 131072, 0, 196619, 0, 0, 262155, 0, 2, 7, 0, 4, 8, 65536, 4, 9, 65536, 4, 10, 1048576, 4, -65526, 983040, 3, -65525, 65536, 4, -65524, 131072, 4, 65550, 0, 4, 65551, 851968, 3, 65552, 131072, 4, 131087, 262144, 2, 65533, 983040, 3, 196630, 0, 4, 196631, 65536, 4, 196632, 131072, 4, 65559, 262144, 4)
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="."]
|
||||
position = Vector2(236, 415)
|
||||
metadata/_edit_group_ = true
|
||||
[node name="ParallaxBackground" type="ParallaxBackground" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
|
||||
shape = SubResource("WorldBoundaryShape2D_3u4a8")
|
||||
[node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"]
|
||||
motion_mirroring = Vector2(324, 0)
|
||||
|
||||
[node name="RigidBody2D" parent="." instance=ExtResource("2_wqngy")]
|
||||
[node name="Sprite2D" type="Sprite2D" parent="ParallaxBackground/ParallaxLayer"]
|
||||
position = Vector2(150, 50)
|
||||
texture = ExtResource("7_gwkt6")
|
||||
|
||||
[node name="Sprite2D2" type="Sprite2D" parent="ParallaxBackground/ParallaxLayer"]
|
||||
position = Vector2(150, -115.5)
|
||||
scale = Vector2(12, 8.21875)
|
||||
texture = ExtResource("8_pwboq")
|
||||
|
||||
[node name="Sprite2D3" type="Sprite2D" parent="ParallaxBackground/ParallaxLayer"]
|
||||
position = Vector2(150.5, 175.5)
|
||||
scale = Vector2(11.9687, 4.21875)
|
||||
texture = ExtResource("9_pi0v8")
|
||||
|
||||
[node name="level" type="Node2D" parent="."]
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="level"]
|
||||
position = Vector2(48, 145)
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="level/StaticBody2D"]
|
||||
shape = SubResource("WorldBoundaryShape2D_xkyim")
|
||||
|
||||
[node name="CharacterBody2D" parent="." groups=["player"] instance=ExtResource("2_64ccm")]
|
||||
position = Vector2(-1, -35)
|
||||
position = Vector2(41, 43)
|
||||
PUSH_FORCE = 550
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="CharacterBody2D"]
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
position = Vector2(335, 117)
|
||||
[node name="AreaTrigger" type="Area2D" parent="."]
|
||||
position = Vector2(130, -94)
|
||||
script = ExtResource("2_nfj1w")
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="AreaTrigger"]
|
||||
shape = SubResource("CircleShape2D_x8qck")
|
||||
debug_color = Color(0.556863, 0.415686, 0.964706, 0.419608)
|
||||
|
||||
[node name="RigidBody2D2" parent="." instance=ExtResource("2_wqngy")]
|
||||
position = Vector2(216, 145)
|
||||
scale = Vector2(2.96, 2.56)
|
||||
[node name="crates" type="Node" parent="."]
|
||||
|
||||
[node name="Platform" parent="." instance=ExtResource("6_lke75")]
|
||||
[node name="crate1" parent="crates" instance=ExtResource("5_u8rgi")]
|
||||
position = Vector2(-22, -30)
|
||||
|
||||
[node name="boxtrap" type="Node2D" parent="crates"]
|
||||
position = Vector2(131, -175)
|
||||
|
||||
[node name="Platform" parent="." instance=ExtResource("6_bcgm6")]
|
||||
position = Vector2(472, -21)
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="Platform"]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_eotb0")
|
||||
"": SubResource("AnimationLibrary_36p5o")
|
||||
}
|
||||
autoplay = "move"
|
||||
|
||||
[node name="BoxTrap" type="Node2D" parent="."]
|
||||
position = Vector2(345, 108)
|
||||
[node name="Coins" type="Node" parent="."]
|
||||
|
||||
[connection signal="areatrigger" from="Area2D" to="." method="_on_area_2d_areatrigger"]
|
||||
[connection signal="body_entered" from="Area2D" to="Area2D" method="_on_body_entered"]
|
||||
[node name="Area2D" parent="Coins" instance=ExtResource("10_vpc4p")]
|
||||
position = Vector2(71, 63)
|
||||
|
||||
[node name="Area2D2" parent="Coins" instance=ExtResource("10_vpc4p")]
|
||||
position = Vector2(173, 65)
|
||||
|
||||
[node name="Area2D3" parent="Coins" instance=ExtResource("10_vpc4p")]
|
||||
position = Vector2(-23, 63)
|
||||
|
||||
[node name="Area2D4" parent="Coins" instance=ExtResource("10_vpc4p")]
|
||||
position = Vector2(237, 61)
|
||||
|
||||
[node name="Badguy" parent="." instance=ExtResource("11_3ypx6")]
|
||||
position = Vector2(-3, 83)
|
||||
|
||||
[connection signal="timeout" from="GameController/Timer" to="GameController" method="resetWorld"]
|
||||
[connection signal="areatrigger" from="AreaTrigger" to="GameController" method="_on_area_2d_areatrigger"]
|
||||
[connection signal="body_entered" from="AreaTrigger" to="AreaTrigger" method="_on_body_entered"]
|
||||
|
@ -1,11 +1,10 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://47xe40uafw3l"]
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dvd1p6xue0ub2"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_2kknn"]
|
||||
size = Vector2(146, 25)
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_i20vp"]
|
||||
size = Vector2(100, 20)
|
||||
|
||||
[node name="AnimatableBody2D" type="AnimatableBody2D"]
|
||||
[node name="Platform" type="AnimatableBody2D"]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(63, 2.5)
|
||||
shape = SubResource("RectangleShape2D_2kknn")
|
||||
shape = SubResource("RectangleShape2D_i20vp")
|
||||
one_way_collision = true
|
||||
|
@ -4,25 +4,38 @@ extends CharacterBody2D
|
||||
@export var SPEED = 300.0
|
||||
@export var JUMP_VELOCITY = -300.0
|
||||
@export var BUMP_FORCE = 80.0
|
||||
@export var PUSH_FORCE = 750
|
||||
@export var PUSH_FORCE = 200
|
||||
|
||||
@onready var right_ray = $RightRay
|
||||
@onready var left_ray = $LeftRay
|
||||
@onready var marker_right = $MarkerRight
|
||||
@onready var marker_left = $MarkerLeft
|
||||
@onready var animated_sprite_2d = $AnimatedSprite2D
|
||||
|
||||
@onready var animated_sprite = $AnimatedSprite2D
|
||||
|
||||
var faceLeft = false
|
||||
var pushLeftEnabled = false
|
||||
var pushRightEnabled = false
|
||||
var pushTarget
|
||||
var living = true
|
||||
|
||||
var bullet = preload("res://scenes/bullet.tscn")
|
||||
|
||||
# Get the gravity from the project settings to be synced with RigidBody nodes.
|
||||
var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
|
||||
|
||||
func living_status():
|
||||
return living
|
||||
|
||||
func die():
|
||||
print("kill the player")
|
||||
animated_sprite.play("death")
|
||||
living = false
|
||||
|
||||
func _physics_process(delta):
|
||||
if not living:
|
||||
return
|
||||
|
||||
# Add the gravity.
|
||||
if not is_on_floor():
|
||||
velocity.y += gravity * delta
|
||||
@ -32,54 +45,48 @@ func _physics_process(delta):
|
||||
velocity.y = JUMP_VELOCITY
|
||||
# Hand force push (melee attack)
|
||||
if Input.is_action_just_pressed("push") && pushRightEnabled && faceLeft == false:
|
||||
print("I should force push")
|
||||
pushTarget.apply_central_impulse(Vector2(1,0) * PUSH_FORCE * 10)
|
||||
pushTarget.apply_central_impulse(Vector2(1,0) * PUSH_FORCE * 5)
|
||||
pushRightEnabled = false
|
||||
if Input.is_action_just_pressed("push") && pushLeftEnabled:
|
||||
pushTarget.apply_central_impulse(Vector2(-1,0) * PUSH_FORCE * 10)
|
||||
pushTarget.apply_central_impulse(Vector2(-1,0) * PUSH_FORCE * 5)
|
||||
pushLeftEnabled = false
|
||||
|
||||
if Input.is_action_just_pressed("shoot"):
|
||||
#make a bullet
|
||||
var myBullet = bullet.instantiate() #you can only instantiate a scene
|
||||
var myBullet = bullet.instantiate()
|
||||
#set bullet speed?
|
||||
|
||||
#put the bullet at the Marker
|
||||
owner.add_child(myBullet) #owner because its adding it to the game and not the character.
|
||||
#This is important because if the character jumps you don't want the bullet to jump as well.
|
||||
owner.add_child(myBullet)
|
||||
#facing left or right?
|
||||
if not faceLeft:
|
||||
#facing right
|
||||
myBullet.transform = marker_right.global_transform
|
||||
else:
|
||||
myBullet.transform = marker_left.global_transform
|
||||
myBullet.setSpeed(-750) #Tim changed it to -750. Magic number. Not sure why.
|
||||
|
||||
#remove the pass at the end
|
||||
myBullet.setSpeed(-750)
|
||||
|
||||
# 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 <0:
|
||||
faceLeft = true
|
||||
if direction >0:
|
||||
faceLeft = false
|
||||
|
||||
# In this example we have replaced the faceLeft code to also have
|
||||
# the character's sprite flip depending what direction they are facing
|
||||
if direction:
|
||||
faceLeft = true if direction<0 else false
|
||||
animated_sprite.flip_h = true if direction < 0 else false
|
||||
velocity.x = direction * SPEED
|
||||
animated_sprite_2d.flip_h = true if direction < 0 else false
|
||||
else:
|
||||
velocity.x = move_toward(velocity.x, 0, SPEED)
|
||||
if is_on_floor():
|
||||
if direction == 0:
|
||||
animated_sprite_2d.play("Idle")
|
||||
if direction==0:
|
||||
animated_sprite.play("idle")
|
||||
else:
|
||||
animated_sprite_2d.play("Run")
|
||||
animated_sprite.play("run")
|
||||
else:
|
||||
animated_sprite_2d.play("Jump")
|
||||
animated_sprite.play("jump")
|
||||
|
||||
move_and_slide()
|
||||
if right_ray.is_colliding():
|
||||
print("right ray is colliding")
|
||||
var collider = right_ray.get_collider()
|
||||
#what did we hit?
|
||||
if collider is Node:
|
||||
@ -91,7 +98,6 @@ func _physics_process(delta):
|
||||
pushRightEnabled = false
|
||||
|
||||
if left_ray.is_colliding():
|
||||
print("left ray is colliding")
|
||||
var collider = left_ray.get_collider()
|
||||
if collider is Node:
|
||||
if collider.is_in_group("boxes"):
|
||||
|
36
scripts/badguy.gd
Normal file
@ -0,0 +1,36 @@
|
||||
extends Area2D
|
||||
|
||||
const speed = 60
|
||||
var direction = -1
|
||||
@onready var right_cast = $RightCast
|
||||
@onready var left_cast = $LeftCast
|
||||
@onready var right_floor_cast = $RightFloorCast
|
||||
@onready var left_floor_cast = $LeftFloorCast
|
||||
@onready var game = %GameController
|
||||
@onready var player = $"../CharacterBody2D"
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
if right_cast.is_colliding():
|
||||
if not right_cast.get_collider().is_in_group("player"):
|
||||
direction = -1
|
||||
|
||||
if left_cast.is_colliding():
|
||||
if not left_cast.get_collider().is_in_group("player"):
|
||||
direction = 1
|
||||
|
||||
if not right_floor_cast.is_colliding() or not left_floor_cast.is_colliding():
|
||||
direction *= -1
|
||||
|
||||
position.x += direction * speed * delta
|
||||
|
||||
|
||||
func _on_body_entered(body):
|
||||
if body.is_in_group("player") and player.living_status():
|
||||
game.playerDeath()
|
@ -10,5 +10,5 @@ func _physics_process(delta):
|
||||
|
||||
func _on_body_entered(body):
|
||||
print("bullet hit something")
|
||||
if not body.is_in_group("player"): #if it hits something other than the player, then disappear
|
||||
if not body.is_in_group("player"):
|
||||
queue_free()
|
||||
|
19
scripts/coin.gd
Normal file
@ -0,0 +1,19 @@
|
||||
extends Area2D
|
||||
@onready var game_controller = %GameController
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
func _on_body_entered(body):
|
||||
if body.is_in_group("player"):
|
||||
print("something hit the coin")
|
||||
game_controller.coinCollected()
|
||||
queue_free()
|
@ -1,28 +1,36 @@
|
||||
extends Node2D
|
||||
extends Node
|
||||
|
||||
var myBox = preload("res://scenes/crate.tscn")
|
||||
@onready var box_trap = $BoxTrap
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
var crate = preload("res://scenes/crate.tscn")
|
||||
@onready var boxtrap = $"../crates/boxtrap"
|
||||
@onready var timer = $Timer
|
||||
@onready var player = $"../CharacterBody2D"
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
|
||||
var totalCoins = 0
|
||||
|
||||
func _on_area_2d_areatrigger(effect, body):
|
||||
print("Game Controller sees the trigger"+effect)
|
||||
print("Game Controller sees the trigger "+effect)
|
||||
match effect:
|
||||
"alert":
|
||||
#do stuff
|
||||
print("hi")
|
||||
if body.is_in_group("player"):
|
||||
for n in 3:
|
||||
var box = myBox.instantiate()
|
||||
add_child(box)
|
||||
box.position = box_trap.position
|
||||
for n in 3:
|
||||
var box = crate.instantiate()
|
||||
owner.add_child(box)
|
||||
box.position = boxtrap.position
|
||||
"powerup":
|
||||
print("you got power")
|
||||
|
||||
func coinCollected():
|
||||
totalCoins += 1
|
||||
print("Game controller will add coin " + str(totalCoins))
|
||||
|
||||
func playerDeath():
|
||||
player.die()
|
||||
timer.start()
|
||||
|
||||
func resetWorld():
|
||||
get_tree().reload_current_scene()
|
||||
|
||||
|
||||
|