diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0af181c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Godot 4+ specific ignores +.godot/ +/android/ diff --git a/Renders/player.zip b/Renders/player.zip new file mode 100644 index 0000000..633224d Binary files /dev/null and b/Renders/player.zip differ diff --git a/assets/LICENSE & CREDITS.txt b/assets/LICENSE & CREDITS.txt new file mode 100644 index 0000000..e4de28b --- /dev/null +++ b/assets/LICENSE & CREDITS.txt @@ -0,0 +1,26 @@ +All assets in the pack have been repackaged and many have been modified by Brackeys. + + +LICENSE for all assets: + +Creative Commons Zero (CC0) + + +CREDIT: + +SPRITES by analogStudios_: +knight (https://analogstudios.itch.io/camelot) +slime (https://analogstudios.itch.io/dungeonsprites) +platforms and coin (https://analogstudios.itch.io/four-seasons-platformer-sprites) + +SPRITES by RottingPixels: +world_tileset and fruit (https://rottingpixels.itch.io/four-seasons-platformer-tileset-16x16free) + + +WORLD TILESET originally + +SOUNDS by Brackeys, Asbjørn Thirslund + +MUSIC by Brackeys, Sofia Thirslund + +FONTS by Jayvee Enaguas - HarvettFox96 - (https://www.dafont.com/pixel-operator.font?l[]=10&l[]=1) \ No newline at end of file diff --git a/assets/fonts/PixelOperator8-Bold.ttf b/assets/fonts/PixelOperator8-Bold.ttf new file mode 100644 index 0000000..10225eb Binary files /dev/null and b/assets/fonts/PixelOperator8-Bold.ttf differ diff --git a/assets/fonts/PixelOperator8-Bold.ttf.import b/assets/fonts/PixelOperator8-Bold.ttf.import new file mode 100644 index 0000000..4844c1c --- /dev/null +++ b/assets/fonts/PixelOperator8-Bold.ttf.import @@ -0,0 +1,34 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://3lcxwxeckyvo" +path="res://.godot/imported/PixelOperator8-Bold.ttf-74faf550739674ad3170f08e646e0614.fontdata" + +[deps] + +source_file="res://assets/fonts/PixelOperator8-Bold.ttf" +dest_files=["res://.godot/imported/PixelOperator8-Bold.ttf-74faf550739674ad3170f08e646e0614.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/fonts/PixelOperator8.ttf b/assets/fonts/PixelOperator8.ttf new file mode 100644 index 0000000..f9146ac Binary files /dev/null and b/assets/fonts/PixelOperator8.ttf differ diff --git a/assets/fonts/PixelOperator8.ttf.import b/assets/fonts/PixelOperator8.ttf.import new file mode 100644 index 0000000..29ab50b --- /dev/null +++ b/assets/fonts/PixelOperator8.ttf.import @@ -0,0 +1,34 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://fw4vwtwjmcu" +path="res://.godot/imported/PixelOperator8.ttf-6f9f01766aff16f52046b880ffb8d367.fontdata" + +[deps] + +source_file="res://assets/fonts/PixelOperator8.ttf" +dest_files=["res://.godot/imported/PixelOperator8.ttf-6f9f01766aff16f52046b880ffb8d367.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/assets/music/time_for_adventure.mp3 b/assets/music/time_for_adventure.mp3 new file mode 100644 index 0000000..2ba9940 Binary files /dev/null and b/assets/music/time_for_adventure.mp3 differ diff --git a/assets/music/time_for_adventure.mp3.import b/assets/music/time_for_adventure.mp3.import new file mode 100644 index 0000000..7747048 --- /dev/null +++ b/assets/music/time_for_adventure.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://c7tnblkq60gu0" +path="res://.godot/imported/time_for_adventure.mp3-b8a49ae1cfc83b211be9d82e6e985655.mp3str" + +[deps] + +source_file="res://assets/music/time_for_adventure.mp3" +dest_files=["res://.godot/imported/time_for_adventure.mp3-b8a49ae1cfc83b211be9d82e6e985655.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assets/sounds/coin.wav b/assets/sounds/coin.wav new file mode 100644 index 0000000..0509182 Binary files /dev/null and b/assets/sounds/coin.wav differ diff --git a/assets/sounds/coin.wav.import b/assets/sounds/coin.wav.import new file mode 100644 index 0000000..64202c5 --- /dev/null +++ b/assets/sounds/coin.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://djp87smeym64l" +path="res://.godot/imported/coin.wav-9081ee1c6d81d9c34d08bc916297b892.sample" + +[deps] + +source_file="res://assets/sounds/coin.wav" +dest_files=["res://.godot/imported/coin.wav-9081ee1c6d81d9c34d08bc916297b892.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/assets/sounds/explosion.wav b/assets/sounds/explosion.wav new file mode 100644 index 0000000..8a67b16 Binary files /dev/null and b/assets/sounds/explosion.wav differ diff --git a/assets/sounds/explosion.wav.import b/assets/sounds/explosion.wav.import new file mode 100644 index 0000000..fba8d5a --- /dev/null +++ b/assets/sounds/explosion.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://bubuj72atc1ci" +path="res://.godot/imported/explosion.wav-52e05e8d4b6600106c8dde082c90f915.sample" + +[deps] + +source_file="res://assets/sounds/explosion.wav" +dest_files=["res://.godot/imported/explosion.wav-52e05e8d4b6600106c8dde082c90f915.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/assets/sounds/hurt.wav b/assets/sounds/hurt.wav new file mode 100644 index 0000000..b46ecd7 Binary files /dev/null and b/assets/sounds/hurt.wav differ diff --git a/assets/sounds/hurt.wav.import b/assets/sounds/hurt.wav.import new file mode 100644 index 0000000..aa4545d --- /dev/null +++ b/assets/sounds/hurt.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://5lc2y775ouhg" +path="res://.godot/imported/hurt.wav-792baeb99505afd6a1496d4e4330b023.sample" + +[deps] + +source_file="res://assets/sounds/hurt.wav" +dest_files=["res://.godot/imported/hurt.wav-792baeb99505afd6a1496d4e4330b023.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/assets/sounds/jump.wav b/assets/sounds/jump.wav new file mode 100644 index 0000000..611bddf Binary files /dev/null and b/assets/sounds/jump.wav differ diff --git a/assets/sounds/jump.wav.import b/assets/sounds/jump.wav.import new file mode 100644 index 0000000..ec8e104 --- /dev/null +++ b/assets/sounds/jump.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://dvdhqsgdvohs7" +path="res://.godot/imported/jump.wav-395b727cde98999423d5c020c9c3492f.sample" + +[deps] + +source_file="res://assets/sounds/jump.wav" +dest_files=["res://.godot/imported/jump.wav-395b727cde98999423d5c020c9c3492f.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/assets/sounds/power_up.wav b/assets/sounds/power_up.wav new file mode 100644 index 0000000..d807e3f Binary files /dev/null and b/assets/sounds/power_up.wav differ diff --git a/assets/sounds/power_up.wav.import b/assets/sounds/power_up.wav.import new file mode 100644 index 0000000..d6c0f45 --- /dev/null +++ b/assets/sounds/power_up.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://clgvt4qpo8jvi" +path="res://.godot/imported/power_up.wav-8349ffe570559470036ebff4b80f7fc0.sample" + +[deps] + +source_file="res://assets/sounds/power_up.wav" +dest_files=["res://.godot/imported/power_up.wav-8349ffe570559470036ebff4b80f7fc0.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/assets/sounds/tap.wav b/assets/sounds/tap.wav new file mode 100644 index 0000000..e9dc6ab Binary files /dev/null and b/assets/sounds/tap.wav differ diff --git a/assets/sounds/tap.wav.import b/assets/sounds/tap.wav.import new file mode 100644 index 0000000..b4391aa --- /dev/null +++ b/assets/sounds/tap.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://b2h64ws2mjlai" +path="res://.godot/imported/tap.wav-78d4c5a48b21a853d89bec74f20510e7.sample" + +[deps] + +source_file="res://assets/sounds/tap.wav" +dest_files=["res://.godot/imported/tap.wav-78d4c5a48b21a853d89bec74f20510e7.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/assets/sprites/coin.png b/assets/sprites/coin.png new file mode 100644 index 0000000..01ae33d Binary files /dev/null and b/assets/sprites/coin.png differ diff --git a/assets/sprites/coin.png.import b/assets/sprites/coin.png.import new file mode 100644 index 0000000..59a2c0c --- /dev/null +++ b/assets/sprites/coin.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://db1subkmbj2d8" +path="res://.godot/imported/coin.png-c8309bf0f8fb5f3a7d1e96a4eb3f02ce.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprites/coin.png" +dest_files=["res://.godot/imported/coin.png-c8309bf0f8fb5f3a7d1e96a4eb3f02ce.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 diff --git a/assets/sprites/fruit.png b/assets/sprites/fruit.png new file mode 100644 index 0000000..b9cc7d6 Binary files /dev/null and b/assets/sprites/fruit.png differ diff --git a/assets/sprites/fruit.png.import b/assets/sprites/fruit.png.import new file mode 100644 index 0000000..d4a3468 --- /dev/null +++ b/assets/sprites/fruit.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://behnotf2awkn0" +path="res://.godot/imported/fruit.png-3735163b668af10c2b35b52cba81b68a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprites/fruit.png" +dest_files=["res://.godot/imported/fruit.png-3735163b668af10c2b35b52cba81b68a.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 diff --git a/assets/sprites/knight.png b/assets/sprites/knight.png new file mode 100644 index 0000000..5b0eb4f Binary files /dev/null and b/assets/sprites/knight.png differ diff --git a/assets/sprites/knight.png.import b/assets/sprites/knight.png.import new file mode 100644 index 0000000..26df6e6 --- /dev/null +++ b/assets/sprites/knight.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bebck3y4sy2c8" +path="res://.godot/imported/knight.png-7c67c83d34932624952797d9e971a644.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprites/knight.png" +dest_files=["res://.godot/imported/knight.png-7c67c83d34932624952797d9e971a644.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 diff --git a/assets/sprites/platforms.png b/assets/sprites/platforms.png new file mode 100644 index 0000000..9be41db Binary files /dev/null and b/assets/sprites/platforms.png differ diff --git a/assets/sprites/platforms.png.import b/assets/sprites/platforms.png.import new file mode 100644 index 0000000..b419f5f --- /dev/null +++ b/assets/sprites/platforms.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://decv4b6odh7sf" +path="res://.godot/imported/platforms.png-3869606db457611ed4193d705dc364e4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprites/platforms.png" +dest_files=["res://.godot/imported/platforms.png-3869606db457611ed4193d705dc364e4.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 diff --git a/assets/sprites/slime_green.png b/assets/sprites/slime_green.png new file mode 100644 index 0000000..a21cb6f Binary files /dev/null and b/assets/sprites/slime_green.png differ diff --git a/assets/sprites/slime_green.png.import b/assets/sprites/slime_green.png.import new file mode 100644 index 0000000..1bc8432 --- /dev/null +++ b/assets/sprites/slime_green.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dbwh17otsbga4" +path="res://.godot/imported/slime_green.png-f6349164bf3a0f5189bb927b97af9c58.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprites/slime_green.png" +dest_files=["res://.godot/imported/slime_green.png-f6349164bf3a0f5189bb927b97af9c58.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 diff --git a/assets/sprites/slime_purple.png b/assets/sprites/slime_purple.png new file mode 100644 index 0000000..76f564e Binary files /dev/null and b/assets/sprites/slime_purple.png differ diff --git a/assets/sprites/slime_purple.png.import b/assets/sprites/slime_purple.png.import new file mode 100644 index 0000000..e8ef4cd --- /dev/null +++ b/assets/sprites/slime_purple.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bpsf4g70lcehd" +path="res://.godot/imported/slime_purple.png-26dc5ddef235ce6a400e78e0d532b050.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprites/slime_purple.png" +dest_files=["res://.godot/imported/slime_purple.png-26dc5ddef235ce6a400e78e0d532b050.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 diff --git a/assets/sprites/world_tileset.png b/assets/sprites/world_tileset.png new file mode 100644 index 0000000..36bbf07 Binary files /dev/null and b/assets/sprites/world_tileset.png differ diff --git a/assets/sprites/world_tileset.png.import b/assets/sprites/world_tileset.png.import new file mode 100644 index 0000000..3a1799f --- /dev/null +++ b/assets/sprites/world_tileset.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dcqrtadm8khs6" +path="res://.godot/imported/world_tileset.png-61a32465f33c3d9d3bfecb75b6485009.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprites/world_tileset.png" +dest_files=["res://.godot/imported/world_tileset.png-61a32465f33c3d9d3bfecb75b6485009.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 diff --git a/export_presets.cfg b/export_presets.cfg new file mode 100644 index 0000000..e69de29 diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..9d8b7fa --- /dev/null +++ b/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icon.svg.import b/icon.svg.import new file mode 100644 index 0000000..9198d51 --- /dev/null +++ b/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bipu26c4t6qsk" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.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 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..66fe73d --- /dev/null +++ b/project.godot @@ -0,0 +1,20 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="FirstPlatformer" +run/main_scene="res://scenes/game.tscn" +config/features=PackedStringArray("4.3", "Forward Plus") +config/icon="res://icon.svg" + +[rendering] + +textures/canvas_textures/default_texture_filter=0 diff --git a/scenes/game.tscn b/scenes/game.tscn new file mode 100644 index 0000000..6d39743 --- /dev/null +++ b/scenes/game.tscn @@ -0,0 +1,21 @@ +[gd_scene load_steps=3 format=3 uid="uid://ddx678te8glnm"] + +[ext_resource type="PackedScene" uid="uid://cxdkngh6fo5p7" path="res://scenes/player.tscn" id="1_866nb"] + +[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_4tes5"] +distance = -12.7355 + +[node name="Game" type="Node2D"] + +[node name="Player" parent="." instance=ExtResource("1_866nb")] +position = Vector2(1, 0) + +[node name="Camera2D" type="Camera2D" parent="."] +position = Vector2(3, -37) +zoom = Vector2(4, 4) + +[node name="StaticBody2D" type="StaticBody2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"] +position = Vector2(3, 30) +shape = SubResource("WorldBoundaryShape2D_4tes5") diff --git a/scenes/player.tscn b/scenes/player.tscn new file mode 100644 index 0000000..5e44c62 --- /dev/null +++ b/scenes/player.tscn @@ -0,0 +1,57 @@ +[gd_scene load_steps=9 format=3 uid="uid://cxdkngh6fo5p7"] + +[ext_resource type="Script" path="res://scripts/player.gd" id="1_btp1f"] +[ext_resource type="Texture2D" uid="uid://bebck3y4sy2c8" path="res://assets/sprites/knight.png" id="1_uiil0"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_v1bjp"] +atlas = ExtResource("1_uiil0") +region = Rect2(0, 0, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_b0pa1"] +atlas = ExtResource("1_uiil0") +region = Rect2(32, 0, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_go8pl"] +atlas = ExtResource("1_uiil0") +region = Rect2(64, 0, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_1qkdf"] +atlas = ExtResource("1_uiil0") +region = Rect2(96, 0, 32, 32) + +[sub_resource type="SpriteFrames" id="SpriteFrames_j6wpo"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_v1bjp") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_b0pa1") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_go8pl") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_1qkdf") +}], +"loop": true, +"name": &"idle", +"speed": 10.0 +}] + +[sub_resource type="CircleShape2D" id="CircleShape2D_lh46r"] +radius = 5.0 + +[node name="Player" type="CharacterBody2D"] +script = ExtResource("1_btp1f") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +position = Vector2(0, -12) +sprite_frames = SubResource("SpriteFrames_j6wpo") +animation = &"idle" +autoplay = "idle" +frame_progress = 0.161906 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(0, -6) +shape = SubResource("CircleShape2D_lh46r") diff --git a/scripts/player.gd b/scripts/player.gd new file mode 100644 index 0000000..4f24d8a --- /dev/null +++ b/scripts/player.gd @@ -0,0 +1,25 @@ +extends CharacterBody2D + + +const SPEED = 130.0 +const JUMP_VELOCITY = -300.0 + + +func _physics_process(delta: float) -> void: + # Add the gravity. + if not is_on_floor(): + velocity += get_gravity() * delta + + # Handle jump. + if Input.is_action_just_pressed("ui_accept") and is_on_floor(): + velocity.y = JUMP_VELOCITY + + # 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: + velocity.x = direction * SPEED + else: + velocity.x = move_toward(velocity.x, 0, SPEED) + + move_and_slide()