From aa44b13532ded14622301d9a7ac3f1d74a6fea43 Mon Sep 17 00:00:00 2001 From: OddlyTimbot Date: Mon, 12 Aug 2024 15:19:54 -0400 Subject: [PATCH] bad guys and collectibles working --- graphics_assets/badguys/slime_green.png | Bin 0 -> 908 bytes graphics_assets/badguys/slime_purple.png | Bin 0 -> 1030 bytes graphics_assets/pickups/coin.png | Bin 0 -> 500 bytes ...state-0a74b53829d168d690d170585354b1a4.cfg | 175 ++++++++++++++++++ ...lding-0a74b53829d168d690d170585354b1a4.cfg | 5 + ...state-8d47ed1154ddd01351befaab61abd218.cfg | 175 ++++++++++++++++++ ...lding-8d47ed1154ddd01351befaab61abd218.cfg | 5 + ...lding-aa3680043b1211abf6e7d6fc641abc10.cfg | 3 + ...state-e196a632ea77e9a0d8baa608f164a4d2.cfg | 175 ++++++++++++++++++ ...lding-e196a632ea77e9a0d8baa608f164a4d2.cfg | 5 + ...state-6d8e6ff1e6f20a36e0402d27c623c86c.cfg | 2 +- ...state-b6bd7a241034177d7fe082a7597ba8ea.cfg | 2 +- ...lding-80a47dad698f065f8d4e0255ce133510.cfg | 3 + ...state-96b2131180b71dd158e52c5527d22dd4.cfg | 175 ++++++++++++++++++ ...lding-96b2131180b71dd158e52c5527d22dd4.cfg | 5 + ...state-65637dc57c83dac3d15ec1cb22439bd7.cfg | 2 +- .../.godot/editor/create_recent.Node | 10 +- .../.godot/editor/editor_layout.cfg | 16 +- .../.godot/editor/filesystem_cache8 | 28 ++- .../.godot/editor/filesystem_update4 | 6 + ...state-c2a7af834e91ff64325daddf58e45dc0.cfg | 6 +- ...lding-c2a7af834e91ff64325daddf58e45dc0.cfg | 6 +- ...state-1ce5c86e8ca186dcaaeaa8726f1268db.cfg | 175 ++++++++++++++++++ ...lding-1ce5c86e8ca186dcaaeaa8726f1268db.cfg | 5 + ...state-cc2f727180cd42d9c13434cb55b1ce69.cfg | 2 +- .../.godot/editor/project_metadata.cfg | 7 +- .../updated_project/.godot/editor/recent_dirs | 3 +- .../.godot/editor/script_editor_cache.cfg | 50 ++++- ....png-1a4f832699b00a99e538d3c588e44dd9.ctex | Bin 0 -> 332 bytes ...n.png-1a4f832699b00a99e538d3c588e44dd9.md5 | 3 + ....png-acdc5bd90821d624fccbb224f33e96e6.ctex | Bin 0 -> 332 bytes ...n.png-acdc5bd90821d624fccbb224f33e96e6.md5 | 3 + ....png-51201084689cedf165aaf716a58cfc31.ctex | Bin 0 -> 660 bytes ...n.png-51201084689cedf165aaf716a58cfc31.md5 | 3 + ....png-f61e94ea97c96b62fc5543e2957803c1.ctex | Bin 0 -> 660 bytes ...n.png-f61e94ea97c96b62fc5543e2957803c1.md5 | 3 + week5/updated_project/.godot/uid_cache.bin | Bin 706 -> 965 bytes week5/updated_project/graphics/coin.png | Bin 0 -> 500 bytes .../updated_project/graphics/coin.png.import | 34 ++++ .../updated_project/graphics/slime_green.png | Bin 0 -> 908 bytes .../graphics/slime_green.png.import | 34 ++++ .../updated_project/scenes/area_trigger.tscn | 10 + week5/updated_project/scenes/badguy.tscn | 62 +++++++ week5/updated_project/scenes/coin.tscn | 112 +++++++++++ week5/updated_project/scenes/game.tscn | 29 +-- week5/updated_project/scenes/menu.tscn | 8 + week5/updated_project/scripts/badguy.gd | 24 +++ week5/updated_project/scripts/coin.gd | 7 + .../updated_project/scripts/gamecontroller.gd | 13 +- 49 files changed, 1337 insertions(+), 54 deletions(-) create mode 100644 graphics_assets/badguys/slime_green.png create mode 100644 graphics_assets/badguys/slime_purple.png create mode 100644 graphics_assets/pickups/coin.png create mode 100644 week5/updated_project/.godot/editor/animatedcoin.tscn-editstate-0a74b53829d168d690d170585354b1a4.cfg create mode 100644 week5/updated_project/.godot/editor/animatedcoin.tscn-folding-0a74b53829d168d690d170585354b1a4.cfg create mode 100644 week5/updated_project/.godot/editor/area_trigger.tscn-editstate-8d47ed1154ddd01351befaab61abd218.cfg create mode 100644 week5/updated_project/.godot/editor/area_trigger.tscn-folding-8d47ed1154ddd01351befaab61abd218.cfg create mode 100644 week5/updated_project/.godot/editor/badguy.gd-folding-aa3680043b1211abf6e7d6fc641abc10.cfg create mode 100644 week5/updated_project/.godot/editor/badguy.tscn-editstate-e196a632ea77e9a0d8baa608f164a4d2.cfg create mode 100644 week5/updated_project/.godot/editor/badguy.tscn-folding-e196a632ea77e9a0d8baa608f164a4d2.cfg create mode 100644 week5/updated_project/.godot/editor/coin.gd-folding-80a47dad698f065f8d4e0255ce133510.cfg create mode 100644 week5/updated_project/.godot/editor/coin.tscn-editstate-96b2131180b71dd158e52c5527d22dd4.cfg create mode 100644 week5/updated_project/.godot/editor/coin.tscn-folding-96b2131180b71dd158e52c5527d22dd4.cfg create mode 100644 week5/updated_project/.godot/editor/menu.tscn-editstate-1ce5c86e8ca186dcaaeaa8726f1268db.cfg create mode 100644 week5/updated_project/.godot/editor/menu.tscn-folding-1ce5c86e8ca186dcaaeaa8726f1268db.cfg create mode 100644 week5/updated_project/.godot/imported/coin.png-1a4f832699b00a99e538d3c588e44dd9.ctex create mode 100644 week5/updated_project/.godot/imported/coin.png-1a4f832699b00a99e538d3c588e44dd9.md5 create mode 100644 week5/updated_project/.godot/imported/coin.png-acdc5bd90821d624fccbb224f33e96e6.ctex create mode 100644 week5/updated_project/.godot/imported/coin.png-acdc5bd90821d624fccbb224f33e96e6.md5 create mode 100644 week5/updated_project/.godot/imported/slime_green.png-51201084689cedf165aaf716a58cfc31.ctex create mode 100644 week5/updated_project/.godot/imported/slime_green.png-51201084689cedf165aaf716a58cfc31.md5 create mode 100644 week5/updated_project/.godot/imported/slime_green.png-f61e94ea97c96b62fc5543e2957803c1.ctex create mode 100644 week5/updated_project/.godot/imported/slime_green.png-f61e94ea97c96b62fc5543e2957803c1.md5 create mode 100644 week5/updated_project/graphics/coin.png create mode 100644 week5/updated_project/graphics/coin.png.import create mode 100644 week5/updated_project/graphics/slime_green.png create mode 100644 week5/updated_project/graphics/slime_green.png.import create mode 100644 week5/updated_project/scenes/area_trigger.tscn create mode 100644 week5/updated_project/scenes/badguy.tscn create mode 100644 week5/updated_project/scenes/coin.tscn create mode 100644 week5/updated_project/scenes/menu.tscn create mode 100644 week5/updated_project/scripts/badguy.gd create mode 100644 week5/updated_project/scripts/coin.gd diff --git a/graphics_assets/badguys/slime_green.png b/graphics_assets/badguys/slime_green.png new file mode 100644 index 0000000000000000000000000000000000000000..a21cb6fa253a2142be9bdad248238299dce6e695 GIT binary patch literal 908 zcmeAS@N?(olHy`uVBq!ia0vp^2|(<@!3HEb(?2AGr~;43Vg?3oVGw3ym^DX&fq~i1 z)5S5QV$Rz+)_J!b1lrmiqe6M+oJ(NX&NN4Phv|b`z4{NYP5+>JWrs--17qeTsRD5g z!(g=zZP^CRNrf+-+NH@KR$Td0s&mngVw3+xu0?EXcCBM}?K8i`C}Wk?V1NhZ=gNnL znwH6IezGFZ!~9a6?RHUyhPV4>Uu{?_FnfW>zS{qPKK*<4uVTZ$ce_63>1Q2~5psEW zx_|#J@#X97|9=sRdr@7gG^K>%S{q!=tk;zc{umA757CW^gF~?Y* zzL@Q4_FeSScBuyG05^_0b=8H-_E|RV`0{(oCG+JLF?=tr`x)+BFt>laYl`#E_4#US z^)8yV;ydQc)Lt=IzWv`O|NWa{=kBflzObA3)w^Aa^ZVqko^^cn|Ic5O3*}M*OaJxH zkT2-?mBRcbPJn+~%B^6jY(87p9(Mo#>Q7(h~rm&XFcnS2%Pu(#j4I<=R1EbeZ((y;O5o?wIy5Q|G$2J-k$H; z`tsE}e}z7FZ&xe&&T>;Ie$t&EuHB#RoL~6BudegQ(e6(xj^8Zaa&Il$W#4ySE~~5m zTfmt7%O>)U?6I5hEH)mc^Zy7i2AYE5_cS8+Pd zEL*XBwVBru|99M6hFkZ|y>aAN9DmO}@fM%8>yNRi-8VbG`yY1_&*gmzOfw=rUyaF+ zc6a>UWOJqT@=>+Yz0nhwE57CCn(*tmRI)?YzOxPXujg|0Ui|Qj8JN8oJYD@<);T3K F0RY5^vzq__ literal 0 HcmV?d00001 diff --git a/graphics_assets/badguys/slime_purple.png b/graphics_assets/badguys/slime_purple.png new file mode 100644 index 0000000000000000000000000000000000000000..76f564e1d18d3f4b59c032ee8233ebf4665af431 GIT binary patch literal 1030 zcmeAS@N?(olHy`uVBq!ia0vp^2|(<@!3HEb(?2AGr~;43Vg?3oVGw3ym^DX&fq{94 zr;B4q#hkZu_UB)A5IH_yFgSBs)oT$}vmn=*zw9@ptqPdBe?d}nV{fk>$4CBvg?)Ed z_vO50>IiWPSm-r%m!<3^wh~P~_4RS~ zpI=Gub+-QhIeq%h`RaxX{5TJNc>dLzfkEQSwe9u4|AzdIT*^2{!A86~-QWe|7ymwB zC>Ti{|81}_`+UPPl@+TN=sEg&On58UrMgnvLQXF0_ys@bQ1@EdnLWo=s>t&5b6*sD zcFMcwU?tm(D_Xg)W-Wc$-E!h}Crjk()1K3gUwWA?xq;Wdw18cHo3k~Zx-$Fb`AU$*-@DD zmGPf?jG6V$dCTQj>{2>(Zt>F0fcfj}50vb4xa*Xko3|y%e%9UPUyOMTg5ncDvEEv- z-pIj{ckVgygWdnMA2Z(bzqjb#^{`seQ^pPQ$9_6a&90O2#S*<mC1;UMyZZkxfN& z@uKHWkGnrH91Z`H^EmwCk41a3FUGWg-!^5J_|wx1K5Uz!#D3x7Zw}ELVrNTt9P8IR z_1(WOXsY%rc>^6i*W&vj&+HC_UuW8s@vbNLPX_a^r!6hi!Wct>kSmw76A*+mkqIDVjdDL!Rb}5E?Td;C@2y9S zHih2xK(yTWh+gXdrTqK8Uwx^_$MoI4V|67Hn26^Qp-rJ*c_3P5d_*tx|6%^yEznE& zeE6^KHvJ|vI7934d=L#ytZIR)9hxaN1Jm8sZ6_j{Yx1#nTWt!D2<;1?{VNX?M*l~R zzukKP+i+D+FAlB;7qkOXfaGA?&h>EX&+$Oxqgs>{d4C#zhd05hUS`kO@{&+Bb`?-H zKXwYn7Ms9B!`F}PQh%-o65r;4=uy!A4;g>*6iCRL!wF!o{9{X0YM%Mf@U=DvM2}Kx zY#A;!e+4Y{Qh#m^NPMe5dkcj0f5`ZIy8@JYG2kpkh}LrU76{dHI?&Z}2LKX(>v1MX z4k6>OaQ_N1p97frj@jdSpELonJ&y=&3jN9h(K6#Bda3^x^WUBW>`ee7IfzLSUk<|l qVg27u071wNc?u+CjZ6R`YyJS*Ofbr5QwY-l0000<>:: -::res://graphics/::1723471253 +::res://graphics/::1723485469 +coin.png::CompressedTexture2D::7063880403899111552::1723478773::1723478782::1::::<><>:: +slime_green.png::CompressedTexture2D::6822447834752212284::1723485459::1723485469::1::::<><>:: Terrain (32x32).png::CompressedTexture2D::8707534964839485024::1723471253::1723471253::1::::<><>:: ::res://graphics/background/::1723471253 Additional Sky.png::CompressedTexture2D::6380466891628860263::1723471253::1723471253::1::::<><>:: @@ -17,14 +19,20 @@ player jump 48x48.png::CompressedTexture2D::1627608568707791839::1723471253::172 player land 48x48.png::CompressedTexture2D::3499637713582873633::1723471253::1723471253::1::::<><>:: ::res://graphics/Player Run/::1723471253 player run 48x48.png::CompressedTexture2D::1502492849971408816::1723471253::1723471253::1::::<><>:: -::res://scenes/::1723472269 -bullet.tscn::PackedScene::6880909734590904373::1723471253::0::1::::<><>::res://scripts/bullet.gd -character.tscn::PackedScene::451838158579532324::1723471253::0::1::::<><>::res://scripts/CharacterBody2D.gd<>uid://c0iiaebonyhh0::::res://graphics/Player Idle/Player Idle 48x48.png<>uid://xgoqfqmvorcx::::res://graphics/Player Jump/player jump 48x48.png<>uid://vn23qn3f0dvc::::res://graphics/Player Run/player run 48x48.png -crate.tscn::PackedScene::41931541512830250::1723471253::0::1::::<><>::uid://ddxm7hj323fta::::res://graphics/items/cannister.png -game.tscn::PackedScene::1738196330916037717::1723472269::0::1::::<><>::res://scripts/gamecontroller.gd<>uid://go4yc8hfo1gq::::res://scenes/character.tscn<>uid://dwb83f7uoweuy::::res://graphics/Terrain (32x32).png<>res://scripts/Trigger.gd<>uid://ukuu7p7vhlq::::res://scenes/crate.tscn<>uid://dvd1p6xue0ub2::::res://scenes/platform.tscn<>uid://dly4g7fvvtamm::::res://graphics/background/BG Image.png<>uid://cw50mfjp2np08::::res://graphics/background/Additional Sky.png<>uid://6olcj1w1svdg::::res://graphics/background/Additional Water.png -platform.tscn::PackedScene::8641027994130079701::1723471253::0::1::::<><>:: -::res://scripts/::1723471253 +::res://scenes/::1723489409 +area_trigger.tscn::PackedScene::2953141911562060689::1723489409::0::1::::<><>::res://scripts/Trigger.gd +badguy.tscn::PackedScene::6008886082592391168::1723489409::0::1::::<><>::res://scripts/badguy.gd<>uid://c4g3ypigewuuu::::res://graphics/slime_green.png +bullet.tscn::PackedScene::6880909734590904373::1723489409::0::1::::<><>::res://scripts/bullet.gd +character.tscn::PackedScene::451838158579532324::1723489409::0::1::::<><>::res://scripts/CharacterBody2D.gd<>uid://c0iiaebonyhh0::::res://graphics/Player Idle/Player Idle 48x48.png<>uid://xgoqfqmvorcx::::res://graphics/Player Jump/player jump 48x48.png<>uid://vn23qn3f0dvc::::res://graphics/Player Run/player run 48x48.png +coin.tscn::PackedScene::61828818800194477::1723489409::0::1::::<><>::uid://c7v2cwn2826lg::::res://graphics/coin.png<>res://scripts/coin.gd +crate.tscn::PackedScene::41931541512830250::1723489409::0::1::::<><>::uid://ddxm7hj323fta::::res://graphics/items/cannister.png +game.tscn::PackedScene::1738196330916037717::1723489409::0::1::::<><>::res://scripts/gamecontroller.gd<>uid://go4yc8hfo1gq::::res://scenes/character.tscn<>uid://dwb83f7uoweuy::::res://graphics/Terrain (32x32).png<>uid://ukuu7p7vhlq::::res://scenes/crate.tscn<>uid://dvd1p6xue0ub2::::res://scenes/platform.tscn<>uid://dly4g7fvvtamm::::res://graphics/background/BG Image.png<>uid://bicr20de8c3jp::::res://scenes/area_trigger.tscn<>uid://cw50mfjp2np08::::res://graphics/background/Additional Sky.png<>uid://6olcj1w1svdg::::res://graphics/background/Additional Water.png<>uid://47kuhu1ukph::::res://scenes/coin.tscn<>uid://cru0qgdvvcc61::::res://scenes/badguy.tscn +menu.tscn::PackedScene::1738029604261438007::1723489409::0::1::::<><>:: +platform.tscn::PackedScene::8641027994130079701::1723489409::0::1::::<><>:: +::res://scripts/::1723488948 +badguy.gd::GDScript::-1::1723486639::0::1::::<>Node2D<>:: bullet.gd::GDScript::-1::1723471253::0::1::::<>Area2D<>:: CharacterBody2D.gd::GDScript::-1::1723471253::0::1::::<>CharacterBody2D<>:: -gamecontroller.gd::GDScript::-1::1723471253::0::1::::<>Node2D<>:: +coin.gd::GDScript::-1::1723482986::0::1::::<>Area2D<>:: +gamecontroller.gd::GDScript::-1::1723488948::0::1::::<>Node2D<>:: Trigger.gd::GDScript::-1::1723471253::0::1::::<>Area2D<>:: diff --git a/week5/updated_project/.godot/editor/filesystem_update4 b/week5/updated_project/.godot/editor/filesystem_update4 index 519aac9..d6285e7 100644 --- a/week5/updated_project/.godot/editor/filesystem_update4 +++ b/week5/updated_project/.godot/editor/filesystem_update4 @@ -1 +1,7 @@ +res://scenes/badguy.tscn res://scenes/game.tscn +res://scripts/badguy.gd +res://scenes/character.tscn +res://scenes/bullet.tscn +res://scenes/crate.tscn +res://scripts/gamecontroller.gd diff --git a/week5/updated_project/.godot/editor/game.tscn-editstate-c2a7af834e91ff64325daddf58e45dc0.cfg b/week5/updated_project/.godot/editor/game.tscn-editstate-c2a7af834e91ff64325daddf58e45dc0.cfg index 70da873..ec932da 100644 --- a/week5/updated_project/.godot/editor/game.tscn-editstate-c2a7af834e91ff64325daddf58e45dc0.cfg +++ b/week5/updated_project/.godot/editor/game.tscn-editstate-c2a7af834e91ff64325daddf58e45dc0.cfg @@ -8,7 +8,7 @@ Anim={ "grid_snap_active": false, "grid_step": Vector2(8, 8), "grid_visibility": 1, -"ofs": Vector2(-412, -284.19), +"ofs": Vector2(-315.322, -167.563), "primary_grid_step": Vector2i(8, 8), "show_edit_locks": true, "show_guides": true, @@ -32,7 +32,7 @@ Anim={ "snap_rotation_step": 0.261799, "snap_scale": false, "snap_scale_step": 0.1, -"zoom": 1.0 +"zoom": 1.7818 } 3D={ "fov": 70.01, @@ -172,4 +172,4 @@ Anim={ "zfar": 4000.01, "znear": 0.05 } -selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@17140/@Panel@13/@VBoxContainer@14/@HSplitContainer@17/@HSplitContainer@25/@HSplitContainer@33/@VBoxContainer@34/@VSplitContainer@36/@VSplitContainer@62/@VBoxContainer@63/@PanelContainer@110/MainScreen/@CanvasItemEditor@9462/@VSplitContainer@9281/@HSplitContainer@9283/@HSplitContainer@9285/@Control@9286/@SubViewportContainer@9287/@SubViewport@9288/Game/AreaTrigger")]) +selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@17140/@Panel@13/@VBoxContainer@14/@HSplitContainer@17/@HSplitContainer@25/@HSplitContainer@33/@VBoxContainer@34/@VSplitContainer@36/@VSplitContainer@62/@VBoxContainer@63/@PanelContainer@110/MainScreen/@CanvasItemEditor@9462/@VSplitContainer@9281/@HSplitContainer@9283/@HSplitContainer@9285/@Control@9286/@SubViewportContainer@9287/@SubViewport@9288/Game")]) diff --git a/week5/updated_project/.godot/editor/game.tscn-folding-c2a7af834e91ff64325daddf58e45dc0.cfg b/week5/updated_project/.godot/editor/game.tscn-folding-c2a7af834e91ff64325daddf58e45dc0.cfg index 0ac2829..a96bbce 100644 --- a/week5/updated_project/.godot/editor/game.tscn-folding-c2a7af834e91ff64325daddf58e45dc0.cfg +++ b/week5/updated_project/.godot/editor/game.tscn-folding-c2a7af834e91ff64325daddf58e45dc0.cfg @@ -1,5 +1,5 @@ [folding] -node_unfolds=[NodePath("."), PackedStringArray("Transform"), NodePath("TileMap"), PackedStringArray("layer__array", "tile_set"), NodePath("ParallaxBackground/ParallaxLayer"), PackedStringArray("Motion"), NodePath("ParallaxBackground/ParallaxLayer/Sprite2D"), PackedStringArray("Transform", "texture"), NodePath("level"), PackedStringArray("Transform"), NodePath("AreaTrigger"), PackedStringArray("Transform"), NodePath("Platform"), PackedStringArray("Transform")] -resource_unfolds=["res://scenes/game.tscn::TileSet_47g5u", PackedStringArray("terrain_set_0/terrain__array", "physics_layer__array"), "res://scenes/game.tscn::WorldBoundaryShape2D_xkyim", PackedStringArray(), "res://scenes/game.tscn::CircleShape2D_x8qck", PackedStringArray("Resource")] -nodes_folded=[NodePath("ParallaxBackground/ParallaxLayer"), NodePath("level"), NodePath("CharacterBody2D"), NodePath("AreaTrigger")] +node_unfolds=[NodePath("."), PackedStringArray("Transform"), NodePath("TileMap"), PackedStringArray("layer__array", "tile_set"), NodePath("ParallaxBackground/ParallaxLayer"), PackedStringArray("Motion"), NodePath("ParallaxBackground/ParallaxLayer/Sprite2D"), PackedStringArray("Transform", "texture"), NodePath("level"), PackedStringArray("Transform"), NodePath("Platform"), PackedStringArray("Transform")] +resource_unfolds=["res://scenes/game.tscn::TileSet_47g5u", PackedStringArray("terrain_set_0/terrain__array", "physics_layer__array"), "res://scenes/game.tscn::WorldBoundaryShape2D_xkyim", PackedStringArray(), "res://scenes/game.tscn::CircleShape2D_j8ltg", PackedStringArray()] +nodes_folded=[NodePath("ParallaxBackground/ParallaxLayer"), NodePath("level"), NodePath("CharacterBody2D")] diff --git a/week5/updated_project/.godot/editor/menu.tscn-editstate-1ce5c86e8ca186dcaaeaa8726f1268db.cfg b/week5/updated_project/.godot/editor/menu.tscn-editstate-1ce5c86e8ca186dcaaeaa8726f1268db.cfg new file mode 100644 index 0000000..5561df6 --- /dev/null +++ b/week5/updated_project/.godot/editor/menu.tscn-editstate-1ce5c86e8ca186dcaaeaa8726f1268db.cfg @@ -0,0 +1,175 @@ +[editor_states] + +Anim={ +"visible": false +} +2D={ +"grid_offset": Vector2(0, 0), +"grid_snap_active": false, +"grid_step": Vector2(8, 8), +"grid_visibility": 1, +"ofs": Vector2(-165, -110), +"primary_grid_step": Vector2i(8, 8), +"show_edit_locks": true, +"show_guides": true, +"show_helpers": false, +"show_origin": true, +"show_rulers": true, +"show_transformation_gizmos": true, +"show_viewport": true, +"show_zoom_control": true, +"smart_snap_active": false, +"snap_guides": true, +"snap_node_anchors": true, +"snap_node_center": true, +"snap_node_parent": true, +"snap_node_sides": true, +"snap_other_nodes": true, +"snap_pixel": true, +"snap_relative": false, +"snap_rotation": false, +"snap_rotation_offset": 0.0, +"snap_rotation_step": 0.261799, +"snap_scale": false, +"snap_scale_step": 0.1, +"zoom": 1.0 +} +3D={ +"fov": 70.01, +"gizmos_status": { +"AudioListener3D": 0, +"AudioStreamPlayer3D": 0, +"CPUParticles3D": 0, +"CSGShape3D": 0, +"Camera3D": 0, +"CollisionObject3D": 0, +"CollisionPolygon3D": 0, +"CollisionShape3D": 0, +"Decal": 0, +"FogVolume": 0, +"GPUParticles3D": 0, +"GPUParticlesCollision3D": 0, +"Joint3D": 0, +"Light3D": 0, +"LightmapGI": 0, +"LightmapProbe": 0, +"Marker3D": 0, +"NavigationLink3D": 0, +"NavigationRegion3D": 0, +"OccluderInstance3D": 0, +"Path3D": 0, +"PhysicalBone3D": 0, +"RayCast3D": 0, +"ReflectionProbe": 0, +"ShapeCast3D": 0, +"Skeleton3D": 0, +"SoftBody3D": 0, +"SpringArm3D": 0, +"VehicleWheel3D": 0, +"VisibleOnScreenNotifier3D": 0, +"VoxelGI": 0 +}, +"local_coords": false, +"preview_sun_env": { +"environ_ao_enabled": false, +"environ_enabled": true, +"environ_energy": 1.0, +"environ_gi_enabled": false, +"environ_glow_enabled": true, +"environ_ground_color": Color(0.2, 0.169, 0.133, 1), +"environ_sky_color": Color(0.385, 0.454, 0.55, 1), +"environ_tonemap_enabled": true, +"sun_color": Color(1, 1, 1, 1), +"sun_enabled": true, +"sun_energy": 1.0, +"sun_max_distance": 100.0, +"sun_rotation": Vector2(-1.0472, 2.61799) +}, +"rotate_snap": 15.0, +"scale_snap": 10.0, +"show_grid": true, +"show_origin": true, +"snap_enabled": false, +"translate_snap": 1.0, +"viewport_mode": 1, +"viewports": [{ +"auto_orthogonal": false, +"auto_orthogonal_enabled": true, +"cinematic_preview": false, +"display_mode": 20, +"distance": 4.0, +"doppler": false, +"frame_time": false, +"gizmos": true, +"half_res": false, +"information": false, +"listener": true, +"lock_rotation": false, +"orthogonal": false, +"position": Vector3(0, 0, 0), +"use_environment": false, +"view_type": 0, +"x_rotation": 0.5, +"y_rotation": -0.5 +}, { +"auto_orthogonal": false, +"auto_orthogonal_enabled": true, +"cinematic_preview": false, +"display_mode": 20, +"distance": 4.0, +"doppler": false, +"frame_time": false, +"gizmos": true, +"half_res": false, +"information": false, +"listener": false, +"lock_rotation": false, +"orthogonal": false, +"position": Vector3(0, 0, 0), +"use_environment": false, +"view_type": 0, +"x_rotation": 0.5, +"y_rotation": -0.5 +}, { +"auto_orthogonal": false, +"auto_orthogonal_enabled": true, +"cinematic_preview": false, +"display_mode": 20, +"distance": 4.0, +"doppler": false, +"frame_time": false, +"gizmos": true, +"half_res": false, +"information": false, +"listener": false, +"lock_rotation": false, +"orthogonal": false, +"position": Vector3(0, 0, 0), +"use_environment": false, +"view_type": 0, +"x_rotation": 0.5, +"y_rotation": -0.5 +}, { +"auto_orthogonal": false, +"auto_orthogonal_enabled": true, +"cinematic_preview": false, +"display_mode": 20, +"distance": 4.0, +"doppler": false, +"frame_time": false, +"gizmos": true, +"half_res": false, +"information": false, +"listener": false, +"lock_rotation": false, +"orthogonal": false, +"position": Vector3(0, 0, 0), +"use_environment": false, +"view_type": 0, +"x_rotation": 0.5, +"y_rotation": -0.5 +}], +"zfar": 4000.01, +"znear": 0.05 +} +selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@17140/@Panel@13/@VBoxContainer@14/@HSplitContainer@17/@HSplitContainer@25/@HSplitContainer@33/@VBoxContainer@34/@VSplitContainer@36/@VSplitContainer@62/@VBoxContainer@63/@PanelContainer@110/MainScreen/@CanvasItemEditor@9462/@VSplitContainer@9281/@HSplitContainer@9283/@HSplitContainer@9285/@Control@9286/@SubViewportContainer@9287/@SubViewport@9288/Node2D/CollisionShape2D")]) diff --git a/week5/updated_project/.godot/editor/menu.tscn-folding-1ce5c86e8ca186dcaaeaa8726f1268db.cfg b/week5/updated_project/.godot/editor/menu.tscn-folding-1ce5c86e8ca186dcaaeaa8726f1268db.cfg new file mode 100644 index 0000000..3549628 --- /dev/null +++ b/week5/updated_project/.godot/editor/menu.tscn-folding-1ce5c86e8ca186dcaaeaa8726f1268db.cfg @@ -0,0 +1,5 @@ +[folding] + +node_unfolds=[NodePath("."), PackedStringArray("Layout")] +resource_unfolds=[] +nodes_folded=[] diff --git a/week5/updated_project/.godot/editor/platform.tscn-editstate-cc2f727180cd42d9c13434cb55b1ce69.cfg b/week5/updated_project/.godot/editor/platform.tscn-editstate-cc2f727180cd42d9c13434cb55b1ce69.cfg index 2d5a861..cd3ca37 100644 --- a/week5/updated_project/.godot/editor/platform.tscn-editstate-cc2f727180cd42d9c13434cb55b1ce69.cfg +++ b/week5/updated_project/.godot/editor/platform.tscn-editstate-cc2f727180cd42d9c13434cb55b1ce69.cfg @@ -172,4 +172,4 @@ Anim={ "zfar": 4000.01, "znear": 0.05 } -selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@17140/@Panel@13/@VBoxContainer@14/@HSplitContainer@17/@HSplitContainer@25/@HSplitContainer@33/@VBoxContainer@34/@VSplitContainer@36/@VSplitContainer@62/@VBoxContainer@63/@PanelContainer@110/MainScreen/@CanvasItemEditor@9462/@VSplitContainer@9281/@HSplitContainer@9283/@HSplitContainer@9285/@Control@9286/@SubViewportContainer@9287/@SubViewport@9288/Game/AreaTrigger")]) +selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@17140/@Panel@13/@VBoxContainer@14/@HSplitContainer@17/@HSplitContainer@25/@HSplitContainer@33/@VBoxContainer@34/@VSplitContainer@36/@VSplitContainer@62/@VBoxContainer@63/@PanelContainer@110/MainScreen/@CanvasItemEditor@9462/@VSplitContainer@9281/@HSplitContainer@9283/@HSplitContainer@9285/@Control@9286/@SubViewportContainer@9287/@SubViewport@9288/Node2D/CollisionShape2D")]) diff --git a/week5/updated_project/.godot/editor/project_metadata.cfg b/week5/updated_project/.godot/editor/project_metadata.cfg index c83226a..ddc35ac 100644 --- a/week5/updated_project/.godot/editor/project_metadata.cfg +++ b/week5/updated_project/.godot/editor/project_metadata.cfg @@ -14,8 +14,8 @@ run_debug_collisions=true [recent_files] -scenes=["res://scenes/platform.tscn", "res://scenes/crate.tscn", "res://scenes/bullet.tscn", "res://scenes/character.tscn", "res://scenes/game.tscn"] -scripts=["res://scripts/bullet.gd", "res://scripts/CharacterBody2D.gd", "res://scripts/gamecontroller.gd"] +scenes=["res://scenes/badguy.tscn", "res://scenes/area_trigger.tscn", "res://scenes/coin.tscn", "res://scenes/menu.tscn", "res://scenes/platform.tscn", "res://scenes/crate.tscn", "res://scenes/bullet.tscn", "res://scenes/character.tscn", "res://scenes/game.tscn", "res://scenes/animatedcoin.tscn"] +scripts=["res://scripts/badguy.gd", "res://scripts/coin.gd", "res://scripts/Trigger.gd", "res://scripts/bullet.gd", "res://scripts/CharacterBody2D.gd", "res://scripts/gamecontroller.gd"] [linked_properties] @@ -37,6 +37,7 @@ ParallaxBackground:scale=true ParallaxLayer:motion_scale=true ParallaxLayer:scale=true AnimatableBody2D:scale=true +CenterContainer:scale=true [dialog_bounds] @@ -45,7 +46,7 @@ project_settings=Rect2(510, 190, 900, 700) [color_picker] -recent_presets=PackedColorArray(0.616312, 0.404074, 0.899578, 0.42, 0.720388, 0.338613, 0.856219, 0.42) +recent_presets=PackedColorArray(0.616312, 0.404074, 0.899578, 0.42, 0.720388, 0.338613, 0.856219, 0.42, 0.724243, 0.309912, 0.904036, 0.42, 0.708381, 0.310171, 0.933753, 0.42) [script_setup] diff --git a/week5/updated_project/.godot/editor/recent_dirs b/week5/updated_project/.godot/editor/recent_dirs index 16105d0..6e6eb36 100644 --- a/week5/updated_project/.godot/editor/recent_dirs +++ b/week5/updated_project/.godot/editor/recent_dirs @@ -1,5 +1,6 @@ res://scenes +res://scripts +res://graphics res://graphics/Player Jump res://graphics/Player Run res://graphics/Player Idle -res://scripts diff --git a/week5/updated_project/.godot/editor/script_editor_cache.cfg b/week5/updated_project/.godot/editor/script_editor_cache.cfg index 7b043f8..4a2fa00 100644 --- a/week5/updated_project/.godot/editor/script_editor_cache.cfg +++ b/week5/updated_project/.godot/editor/script_editor_cache.cfg @@ -3,11 +3,11 @@ state={ "bookmarks": PackedInt32Array(), "breakpoints": PackedInt32Array(), -"column": 34, +"column": 25, "folded_lines": Array[int]([]), "h_scroll_position": 0, -"row": 13, -"scroll_position": 0.0, +"row": 27, +"scroll_position": 6.0, "selection": false, "syntax_highlighter": "GDScript" } @@ -21,7 +21,7 @@ state={ "folded_lines": Array[int]([]), "h_scroll_position": 0, "row": 53, -"scroll_position": 44.0, +"scroll_position": 54.0, "selection": false, "syntax_highlighter": "GDScript" } @@ -39,3 +39,45 @@ state={ "selection": false, "syntax_highlighter": "GDScript" } + +[res://scripts/coin.gd] + +state={ +"bookmarks": PackedInt32Array(), +"breakpoints": PackedInt32Array(), +"column": 22, +"folded_lines": Array[int]([]), +"h_scroll_position": 0, +"row": 6, +"scroll_position": 0.0, +"selection": false, +"syntax_highlighter": "GDScript" +} + +[res://scripts/Trigger.gd] + +state={ +"bookmarks": PackedInt32Array(), +"breakpoints": PackedInt32Array(), +"column": 31, +"folded_lines": Array[int]([]), +"h_scroll_position": 0, +"row": 7, +"scroll_position": 0.0, +"selection": false, +"syntax_highlighter": "GDScript" +} + +[res://scripts/badguy.gd] + +state={ +"bookmarks": PackedInt32Array(), +"breakpoints": PackedInt32Array(), +"column": 20, +"folded_lines": Array[int]([]), +"h_scroll_position": 0, +"row": 23, +"scroll_position": 10.0, +"selection": false, +"syntax_highlighter": "GDScript" +} diff --git a/week5/updated_project/.godot/imported/coin.png-1a4f832699b00a99e538d3c588e44dd9.ctex b/week5/updated_project/.godot/imported/coin.png-1a4f832699b00a99e538d3c588e44dd9.ctex new file mode 100644 index 0000000000000000000000000000000000000000..f11888e0066345e005cb681bc1ce6d1cab9d58ca GIT binary patch literal 332 zcmZ<{4l!b6U|=`^!~#GJ1ib%&0K$ZjOhD=YRF)OU76EDq@^o|K0n*{FP61&77CsC> zw*LMD%mVrjVhKj|6ZdXhBIF>&b!%Iq*YZCH=f*ZV2%Y#hi<_hCkG$?b>0Qn(EF2TE zZ};A=@M1jT$^7F5Ljdz*JLaqPx_$Oc=U;dHvo4VKoVZ6Qxa|7_{%EOvKYZkWGFk6C zuZz=v%uZoeVm2 zX7Wr)X$9p}hPBK2-g&j1Ie)1(W`#zx(OOPngFwY57p++iGp&TZ7q4)U+G!;G?9?JT zR^e*VyfcNbnR<2_-dM}c$HvmA{#Ccc&-mLn?_3x8AX6)>*zUI-kdDruQbJu^^ OTlar|wg3P99~c3SFoYuj literal 0 HcmV?d00001 diff --git a/week5/updated_project/.godot/imported/coin.png-1a4f832699b00a99e538d3c588e44dd9.md5 b/week5/updated_project/.godot/imported/coin.png-1a4f832699b00a99e538d3c588e44dd9.md5 new file mode 100644 index 0000000..a9421a9 --- /dev/null +++ b/week5/updated_project/.godot/imported/coin.png-1a4f832699b00a99e538d3c588e44dd9.md5 @@ -0,0 +1,3 @@ +source_md5="9972ae36d7f15087663eef880c2522c7" +dest_md5="6323bfa165d4025b36e466114be0533d" + diff --git a/week5/updated_project/.godot/imported/coin.png-acdc5bd90821d624fccbb224f33e96e6.ctex b/week5/updated_project/.godot/imported/coin.png-acdc5bd90821d624fccbb224f33e96e6.ctex new file mode 100644 index 0000000000000000000000000000000000000000..f11888e0066345e005cb681bc1ce6d1cab9d58ca GIT binary patch literal 332 zcmZ<{4l!b6U|=`^!~#GJ1ib%&0K$ZjOhD=YRF)OU76EDq@^o|K0n*{FP61&77CsC> zw*LMD%mVrjVhKj|6ZdXhBIF>&b!%Iq*YZCH=f*ZV2%Y#hi<_hCkG$?b>0Qn(EF2TE zZ};A=@M1jT$^7F5Ljdz*JLaqPx_$Oc=U;dHvo4VKoVZ6Qxa|7_{%EOvKYZkWGFk6C zuZz=v%uZoeVm2 zX7Wr)X$9p}hPBK2-g&j1Ie)1(W`#zx(OOPngFwY57p++iGp&TZ7q4)U+G!;G?9?JT zR^e*VyfcNbnR<2_-dM}c$HvmA{#Ccc&-mLn?_3x8AX6)>*zUI-kdDruQbJu^^ OTlar|wg3P99~c3SFoYuj literal 0 HcmV?d00001 diff --git a/week5/updated_project/.godot/imported/coin.png-acdc5bd90821d624fccbb224f33e96e6.md5 b/week5/updated_project/.godot/imported/coin.png-acdc5bd90821d624fccbb224f33e96e6.md5 new file mode 100644 index 0000000..a9421a9 --- /dev/null +++ b/week5/updated_project/.godot/imported/coin.png-acdc5bd90821d624fccbb224f33e96e6.md5 @@ -0,0 +1,3 @@ +source_md5="9972ae36d7f15087663eef880c2522c7" +dest_md5="6323bfa165d4025b36e466114be0533d" + diff --git a/week5/updated_project/.godot/imported/slime_green.png-51201084689cedf165aaf716a58cfc31.ctex b/week5/updated_project/.godot/imported/slime_green.png-51201084689cedf165aaf716a58cfc31.ctex new file mode 100644 index 0000000000000000000000000000000000000000..e76e5a17216db87f6783ee82d71e8f52044a605d GIT binary patch literal 660 zcmZ<{4l!b6U|>i9Vhbl-B<^|8YeYPEXnYh+XG2U*;mC5<>&ws{P*k126v`RZ- zEBAh~@~s)%yUMFx+~VEa(PPQ{a?!In2Y(v*KV|zdlLdA=*`@}E$4>t)9>@5i9Vhbl-B<^|8YeYPEXnYh+XG2U*;mC5<>&ws{P*k126v`RZ- zEBAh~@~s)%yUMFx+~VEa(PPQ{a?!In2Y(v*KV|zdlLdA=*`@}E$4>t)9>@5nG=D=IIsWrQ6)) zT&ZEQE=~?pNpVhQZfbmbQEF=5u|e3Amw9l}U*y>7|umHIqLvddsfeT)y`AirWlg=n6s3n{2`4 kC2PJ&ws`vvISC9Exv6=jlWUn=RX*3L9hTg8ts0+Y0PsL!5dZ)H delta 26 icmX@geu$Nkes+AdXsyZyeI!+a-E#W>;M39KnP|4 diff --git a/week5/updated_project/graphics/coin.png b/week5/updated_project/graphics/coin.png new file mode 100644 index 0000000000000000000000000000000000000000..01ae33d70b398db7f1f7bcafe883a0a469805201 GIT binary patch literal 500 zcmV^r!6hi!Wct>kSmw76A*+mkqIDVjdDL!Rb}5E?Td;C@2y9S zHih2xK(yTWh+gXdrTqK8Uwx^_$MoI4V|67Hn26^Qp-rJ*c_3P5d_*tx|6%^yEznE& zeE6^KHvJ|vI7934d=L#ytZIR)9hxaN1Jm8sZ6_j{Yx1#nTWt!D2<;1?{VNX?M*l~R zzukKP+i+D+FAlB;7qkOXfaGA?&h>EX&+$Oxqgs>{d4C#zhd05hUS`kO@{&+Bb`?-H zKXwYn7Ms9B!`F}PQh%-o65r;4=uy!A4;g>*6iCRL!wF!o{9{X0YM%Mf@U=DvM2}Kx zY#A;!e+4Y{Qh#m^NPMe5dkcj0f5`ZIy8@JYG2kpkh}LrU76{dHI?&Z}2LKX(>v1MX z4k6>OaQ_N1p97frj@jdSpELonJ&y=&3jN9h(K6#Bda3^x^WUBW>`ee7IfzLSUk<|l qVg27u071wNc?u+CjZ6R`YyJS*Ofbr5QwY-l0000JWrs--17qeTsRD5g z!(g=zZP^CRNrf+-+NH@KR$Td0s&mngVw3+xu0?EXcCBM}?K8i`C}Wk?V1NhZ=gNnL znwH6IezGFZ!~9a6?RHUyhPV4>Uu{?_FnfW>zS{qPKK*<4uVTZ$ce_63>1Q2~5psEW zx_|#J@#X97|9=sRdr@7gG^K>%S{q!=tk;zc{umA757CW^gF~?Y* zzL@Q4_FeSScBuyG05^_0b=8H-_E|RV`0{(oCG+JLF?=tr`x)+BFt>laYl`#E_4#US z^)8yV;ydQc)Lt=IzWv`O|NWa{=kBflzObA3)w^Aa^ZVqko^^cn|Ic5O3*}M*OaJxH zkT2-?mBRcbPJn+~%B^6jY(87p9(Mo#>Q7(h~rm&XFcnS2%Pu(#j4I<=R1EbeZ((y;O5o?wIy5Q|G$2J-k$H; z`tsE}e}z7FZ&xe&&T>;Ie$t&EuHB#RoL~6BudegQ(e6(xj^8Zaa&Il$W#4ySE~~5m zTfmt7%O>)U?6I5hEH)mc^Zy7i2AYE5_cS8+Pd zEL*XBwVBru|99M6hFkZ|y>aAN9DmO}@fM%8>yNRi-8VbG`yY1_&*gmzOfw=rUyaF+ zc6a>UWOJqT@=>+Yz0nhwE57CCn(*tmRI)?YzOxPXujg|0Ui|Qj8JN8oJYD@<);T3K F0RY5^vzq__ literal 0 HcmV?d00001 diff --git a/week5/updated_project/graphics/slime_green.png.import b/week5/updated_project/graphics/slime_green.png.import new file mode 100644 index 0000000..98d5fed --- /dev/null +++ b/week5/updated_project/graphics/slime_green.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c4g3ypigewuuu" +path="res://.godot/imported/slime_green.png-51201084689cedf165aaf716a58cfc31.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/slime_green.png" +dest_files=["res://.godot/imported/slime_green.png-51201084689cedf165aaf716a58cfc31.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/week5/updated_project/scenes/area_trigger.tscn b/week5/updated_project/scenes/area_trigger.tscn new file mode 100644 index 0000000..51b6166 --- /dev/null +++ b/week5/updated_project/scenes/area_trigger.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://bicr20de8c3jp"] + +[ext_resource type="Script" path="res://scripts/Trigger.gd" id="1_l8git"] + +[node name="AreaTrigger" type="Area2D"] +position = Vector2(130, -94) +script = ExtResource("1_l8git") +metadata/_edit_group_ = true + +[connection signal="body_entered" from="." to="." method="_on_body_entered"] diff --git a/week5/updated_project/scenes/badguy.tscn b/week5/updated_project/scenes/badguy.tscn new file mode 100644 index 0000000..8c6b066 --- /dev/null +++ b/week5/updated_project/scenes/badguy.tscn @@ -0,0 +1,62 @@ +[gd_scene load_steps=9 format=3 uid="uid://d0evhj5ayp0ep"] + +[ext_resource type="Script" path="res://scripts/badguy.gd" id="1_ees8e"] +[ext_resource type="Texture2D" uid="uid://c4g3ypigewuuu" path="res://graphics/slime_green.png" id="2_le1an"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_aiaao"] +atlas = ExtResource("2_le1an") +region = Rect2(0, 24, 24, 24) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qiek8"] +atlas = ExtResource("2_le1an") +region = Rect2(24, 24, 24, 24) + +[sub_resource type="AtlasTexture" id="AtlasTexture_c6suc"] +atlas = ExtResource("2_le1an") +region = Rect2(48, 24, 24, 24) + +[sub_resource type="AtlasTexture" id="AtlasTexture_wxol7"] +atlas = ExtResource("2_le1an") +region = Rect2(72, 24, 24, 24) + +[sub_resource type="SpriteFrames" id="SpriteFrames_oohu0"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_aiaao") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qiek8") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_c6suc") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_wxol7") +}], +"loop": true, +"name": &"default", +"speed": 12.0 +}] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_jipcy"] +size = Vector2(17, 14) + +[node name="Area2D" type="Area2D"] +script = ExtResource("1_ees8e") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +sprite_frames = SubResource("SpriteFrames_oohu0") +autoplay = "default" + +[node name="CastRight" type="RayCast2D" parent="."] +target_position = Vector2(15, 0) + +[node name="CastLeft" type="RayCast2D" parent="."] +target_position = Vector2(-16, 0) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(-0.5, 5) +shape = SubResource("RectangleShape2D_jipcy") + +[connection signal="body_entered" from="." to="." method="_on_body_entered"] diff --git a/week5/updated_project/scenes/coin.tscn b/week5/updated_project/scenes/coin.tscn new file mode 100644 index 0000000..5fb27e3 --- /dev/null +++ b/week5/updated_project/scenes/coin.tscn @@ -0,0 +1,112 @@ +[gd_scene load_steps=17 format=3 uid="uid://47kuhu1ukph"] + +[ext_resource type="Texture2D" uid="uid://c7v2cwn2826lg" path="res://graphics/coin.png" id="1_eb1hb"] +[ext_resource type="Script" path="res://scripts/coin.gd" id="1_q2xs3"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_j26hl"] +atlas = ExtResource("1_eb1hb") +region = Rect2(0, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_w14lc"] +atlas = ExtResource("1_eb1hb") +region = Rect2(16, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ckwpx"] +atlas = ExtResource("1_eb1hb") +region = Rect2(32, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_6mbt7"] +atlas = ExtResource("1_eb1hb") +region = Rect2(48, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_b2ng3"] +atlas = ExtResource("1_eb1hb") +region = Rect2(64, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_gfrlm"] +atlas = ExtResource("1_eb1hb") +region = Rect2(80, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_itkyq"] +atlas = ExtResource("1_eb1hb") +region = Rect2(96, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_w16a2"] +atlas = ExtResource("1_eb1hb") +region = Rect2(112, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_kq134"] +atlas = ExtResource("1_eb1hb") +region = Rect2(128, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_8gvwo"] +atlas = ExtResource("1_eb1hb") +region = Rect2(144, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_5ersa"] +atlas = ExtResource("1_eb1hb") +region = Rect2(160, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_gjiky"] +atlas = ExtResource("1_eb1hb") +region = Rect2(176, 0, 16, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_dfmiy"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_j26hl") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_w14lc") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ckwpx") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_6mbt7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_b2ng3") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_gfrlm") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_itkyq") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_w16a2") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_kq134") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_8gvwo") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_5ersa") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_gjiky") +}], +"loop": true, +"name": &"default", +"speed": 12.0 +}] + +[sub_resource type="CircleShape2D" id="CircleShape2D_h7yb5"] +radius = 5.0 + +[node name="Area2D" type="Area2D"] +script = ExtResource("1_q2xs3") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +sprite_frames = SubResource("SpriteFrames_dfmiy") +autoplay = "default" + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_h7yb5") +debug_color = Color(0.709804, 0.309804, 0.933333, 0.419608) + +[connection signal="body_entered" from="." to="." method="_on_body_entered"] diff --git a/week5/updated_project/scenes/game.tscn b/week5/updated_project/scenes/game.tscn index 85dc7ad..f76701d 100644 --- a/week5/updated_project/scenes/game.tscn +++ b/week5/updated_project/scenes/game.tscn @@ -1,14 +1,16 @@ -[gd_scene load_steps=17 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://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://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="PackedScene" uid="uid://bicr20de8c3jp" path="res://scenes/area_trigger.tscn" id="7_i5ol2"] [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://47kuhu1ukph" path="res://scenes/coin.tscn" id="10_mo30d"] +[ext_resource type="PackedScene" uid="uid://d0evhj5ayp0ep" path="res://scenes/badguy.tscn" id="11_ghgxt"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_xg6qs"] texture = ExtResource("2_l22q1") @@ -477,8 +479,8 @@ sources/0 = SubResource("TileSetAtlasSource_xg6qs") [sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_xkyim"] -[sub_resource type="CircleShape2D" id="CircleShape2D_x8qck"] -radius = 60.2993 +[sub_resource type="CircleShape2D" id="CircleShape2D_j8ltg"] +radius = 23.0217 [sub_resource type="Animation" id="Animation_buq5q"] length = 0.001 @@ -523,7 +525,7 @@ script = ExtResource("1_77wyw") [node name="TileMap" type="TileMap" parent="."] tile_set = SubResource("TileSet_47g5u") format = 2 -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) +layer_0/tile_data = PackedInt32Array(262141, 262144, 2, 262142, 65536, 4, 262143, 65536, 4, 196608, 65536, 4, 196609, 786432, 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, 131073, 262144, 0) [node name="ParallaxBackground" type="ParallaxBackground" parent="."] @@ -559,14 +561,12 @@ PUSH_FORCE = 550 [node name="Camera2D" type="Camera2D" parent="CharacterBody2D"] -[node name="AreaTrigger" type="Area2D" parent="."] -position = Vector2(130, -94) -script = ExtResource("2_nfj1w") -metadata/_edit_group_ = true +[node name="AreaTrigger" parent="." instance=ExtResource("7_i5ol2")] +position = Vector2(126, -57) [node name="CollisionShape2D" type="CollisionShape2D" parent="AreaTrigger"] -shape = SubResource("CircleShape2D_x8qck") -debug_color = Color(0.556863, 0.415686, 0.964706, 0.419608) +shape = SubResource("CircleShape2D_j8ltg") +debug_color = Color(0.72549, 0.309804, 0.905882, 0.419608) [node name="crates" type="Node" parent="."] @@ -585,5 +585,10 @@ libraries = { } autoplay = "move" +[node name="coin" parent="." instance=ExtResource("10_mo30d")] +position = Vector2(79, 88) + +[node name="Area2D" parent="." instance=ExtResource("11_ghgxt")] +position = Vector2(-28, 84) + [connection signal="areatrigger" from="AreaTrigger" to="." method="_on_area_2d_areatrigger"] -[connection signal="body_entered" from="AreaTrigger" to="AreaTrigger" method="_on_body_entered"] diff --git a/week5/updated_project/scenes/menu.tscn b/week5/updated_project/scenes/menu.tscn new file mode 100644 index 0000000..003cdc9 --- /dev/null +++ b/week5/updated_project/scenes/menu.tscn @@ -0,0 +1,8 @@ +[gd_scene format=3 uid="uid://y06dgi6yo48r"] + +[node name="CenterContainer" type="CenterContainer"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 diff --git a/week5/updated_project/scripts/badguy.gd b/week5/updated_project/scripts/badguy.gd new file mode 100644 index 0000000..6d5d035 --- /dev/null +++ b/week5/updated_project/scripts/badguy.gd @@ -0,0 +1,24 @@ +extends Area2D + +const speed = 60 +var direction = 1 +@onready var cast_right = $CastRight +@onready var cast_left = $CastLeft +@onready var sprite = $AnimatedSprite2D +@onready var game = $".." + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + if cast_right.is_colliding(): + direction = -1 + sprite.flip_h = true + if cast_left.is_colliding(): + direction = 1 + sprite.flip_h = false + + position.x += direction * speed * delta + + +func _on_body_entered(body): + if body.is_in_group("player"): + game.playerDeath() diff --git a/week5/updated_project/scripts/coin.gd b/week5/updated_project/scripts/coin.gd new file mode 100644 index 0000000..442fcfe --- /dev/null +++ b/week5/updated_project/scripts/coin.gd @@ -0,0 +1,7 @@ +extends Area2D + +@onready var game = $".." + +func _on_body_entered(body): + if body.is_in_group("player"): + game.coinCollected() diff --git a/week5/updated_project/scripts/gamecontroller.gd b/week5/updated_project/scripts/gamecontroller.gd index 4df82c7..f3b8962 100644 --- a/week5/updated_project/scripts/gamecontroller.gd +++ b/week5/updated_project/scripts/gamecontroller.gd @@ -1,14 +1,16 @@ extends Node2D +var coinsCollected = 0 + var crate = preload("res://scenes/crate.tscn") @onready var boxtrap = $crates/boxtrap +@onready var player = $CharacterBody2D func _on_area_2d_areatrigger(effect, body): 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 = crate.instantiate() @@ -16,3 +18,12 @@ func _on_area_2d_areatrigger(effect, body): box.position = boxtrap.position "powerup": print("you got power") + "kill": + print("kill the player") +func coinCollected(): + coinsCollected +=1 + print("coins collected "+str(coinsCollected) ) + +func playerDeath(): + print("kill the player") +