From d607e0d45f5229f36991f8ed98a2948eb1ab5e3a Mon Sep 17 00:00:00 2001 From: Jakob Feldmann Date: Tue, 16 Aug 2022 15:06:04 +0200 Subject: [PATCH] In-Game ButtonGroup with buttons & 1. Level --- assets/colorpalette.aseprite | Bin 0 -> 2117 bytes assets/colorpalette.aseprite.import | 26 +++ assets/contraption/elevator.aseprite | Bin 0 -> 368 bytes assets/contraption/elevator.aseprite.import | 26 +++ assets/neutral object/button.aseprite | Bin 0 -> 2141 bytes assets/neutral object/button.aseprite.import | 26 +++ .../buttonStateIndicator.aseprite | Bin 0 -> 2262 bytes .../buttonStateIndicator.aseprite.import | 26 +++ src/Actors/Blobby/Blobby.gd | 1 + src/Actors/Blobby/Blobby.tscn | 15 +- src/Levels/TLT Level.tscn | 54 ++++- src/NeutralObjects/ThreeWhyButtons.gd | 8 + src/NeutralObjects/ThreeWhyButtons.tscn | 22 ++ src/NeutralObjects/WhyButton.gd | 27 +++ src/NeutralObjects/WhyButton.tscn | 212 ++++++++++++++++++ src/NeutralObjects/button.png | Bin 0 -> 168 bytes src/NeutralObjects/button.png.import | 35 +++ src/NeutralObjects/buttonStateIndicator.png | Bin 0 -> 133 bytes .../buttonStateIndicator.png.import | 35 +++ src/UserInterface/Screens/LevelEndScreen.tscn | 2 +- 20 files changed, 503 insertions(+), 12 deletions(-) create mode 100644 assets/colorpalette.aseprite create mode 100644 assets/colorpalette.aseprite.import create mode 100644 assets/contraption/elevator.aseprite create mode 100644 assets/contraption/elevator.aseprite.import create mode 100644 assets/neutral object/button.aseprite create mode 100644 assets/neutral object/button.aseprite.import create mode 100644 assets/neutral object/buttonStateIndicator.aseprite create mode 100644 assets/neutral object/buttonStateIndicator.aseprite.import create mode 100644 src/NeutralObjects/ThreeWhyButtons.gd create mode 100644 src/NeutralObjects/ThreeWhyButtons.tscn create mode 100644 src/NeutralObjects/WhyButton.gd create mode 100644 src/NeutralObjects/WhyButton.tscn create mode 100644 src/NeutralObjects/button.png create mode 100644 src/NeutralObjects/button.png.import create mode 100644 src/NeutralObjects/buttonStateIndicator.png create mode 100644 src/NeutralObjects/buttonStateIndicator.png.import diff --git a/assets/colorpalette.aseprite b/assets/colorpalette.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..8cc5d7b9823c1bd2b3a75901adf22c88ef4ce171 GIT binary patch literal 2117 zcmd6odrXyO0Eb@;CK)1`f{aos8+Vbz#VE~TaTAe10~sqsj$Gq*P8iiztVVJZFc8vM zu9QNPM3gwL3$=to1W_)!C6kMBxWlnR=5(j$<+RBk{^M3#-*%pTyyxS6zwiBi&+qt} z3ei_(BrJrPFcn5Z2qm9;hejC5LB6-RH~24}H7yk4w$5a3RTJj5SzigevcH8T zVc$Wk<(6=ryL_U=D0wG!1zB*Q?p-)@wH)5L^#dFq)56x~pWqjt9)j8LybU8GBA`Mc zpE1P46&6Ol0Go5dVNZ1^Jd-JRLlq?V+1F9-a7=>S|I#u)*sR$Br+W9pdTlHGuvyOk z>L+i(fCPD0&d+;8s}!c~}iL_Xtd8AUK4 zY!|e5UJw2J<#}S9+^a(sXJOMXy>Li74JU`>I~r`0vo%(=z`g2X7#xho!D30IA zjoE08(+G{tsEo%*jKS!OyNHXmD2uPiim7OdqX>$fsEL5|^Pm6C&{IrnY`bLM56Shm#i(dCa-l$3o`zW+dJ#LL^m!b4x#cBP~1a?hpi&UI@&6kcwg z?hUnP>b^NufBMbzH&lBvGS#=H|GYV)`|FP-re=%GA71=Oac*ILQQp3Skbo_lw+03W zUHtXJ`SzB!R#$sx$2ATvPA98R9RK=Q%~xp&uP3D@rX)`dkB?4{OpF~~n{oMu!?rJj x54)**#=X_rw&>dQO9RgYRk%c-Qgx4dCSR$!UYpT5)$* zl656Owxj|-RD=&n2F6UxHT}=PkWkzTBH{Z)3^-m3Cp({n z*Xz>Y7tSQOKHUoAV`E@$#$&Mh<#c$V$qpwco`V;!NadqiDtxCw_N-dF2&OEKgQka~ zVZsu*hHTFh(AByGZa-&(Cw&RK?t zAIkpPZn(7LIxN2>^!+CH($#wh*6o{snVuoI%>FK{bbDdTw#%^RvzyT0C+CkHZ-Kp4 zU&F?NZ{WN+bK&DDaz`7SawTosD&f_(x8cO4UGVlF-@#vR48zmjAK<}{cf+c;-h__A zLTIzeJ?5t-!+Ph_&|AF{_8nRQk5$NOc$UjLXC}%DyGmsJckIl9UTqb;)&BuJK71N( z@k;&Gdp5(I61l3Rr_$j(Q?zWSO0}#PrM`P>J*+$VBm8{i7kFiK3~FaC!J7SYk1xI6 z0CNh~zy(Q*VOF+mZzz_v+TGL+JAdkj*M`U8*fn`ZL)}uXqqPfeE#D4T<~yM+S)O>> zf`xG1GP#CbB{lH-#>22z)8OcURP)`C_3!WLfZrZyhBX^Yp(8I3ro<=0ww-Ul!Hz&C zhdyFkACc#Hr%UFY`1BCG>Zyip1;x;vwj3tTe-twA!C?LeSIp*|p68=r(2HPhU9ZYr z1lQ-imao{Zcz-`EDwnx}rW|ROClWO4-gEsQj@qUv6)t^Hqp#3ZxNq7CYsNxK7omkP z#%t*uv<-R&4TEk$tDsNNBK&<|(^bOPD{J%9#){iu)kNRRR8j_Zhy zM7bg(!%B z$cK4ohjR#rZK#H4NQPnPgLSOHc$qkOMQ& z0w)jx8&ClckN^XSKiMbvq@Ku6lJ}7zl1|LYH~}Z!L|cL#GFX37OoVwBtS!mqddMt+ zm9*+QIptx6{Nq2`jAfp1vmsP zwX8VB&VlJ>IXXk>ch57D$jX+rMO9T%4fpFlS48SFb^bHQ4(c;Ik5*c9qH--?j@nJC zE1~dw9)I=w!UC^Td5LE54Hld^rJ!MI!MMiezTZDF)gMXQr_D*;a@e5S_hvfeYC?-y g?-rXirP#DUv7(}%b6@f28;i|$i_xIW-L}C$0kN91T>t<8 literal 0 HcmV?d00001 diff --git a/assets/neutral object/button.aseprite.import b/assets/neutral object/button.aseprite.import new file mode 100644 index 0000000..939319e --- /dev/null +++ b/assets/neutral object/button.aseprite.import @@ -0,0 +1,26 @@ +[remap] + +importer="aseprite.wizard.plugin" +type="SpriteFrames" +path="res://.import/button.aseprite-eb4ffd06c959b926c360b58c2a20bdb1.res" + +[deps] + +source_file="res://assets/neutral object/button.aseprite" +dest_files=[ "res://.import/button.aseprite-eb4ffd06c959b926c360b58c2a20bdb1.res" ] + +[params] + +split_layers=false +exclude_layers_pattern="" +only_visible_layers=false +sheet_type="Packed" +sprite_filename_pattern="{basename}.{layer}.{extension}" +texture_strip/import_texture_strip=false +texture_strip/filename_pattern="{basename}.{layer}.Strip.{extension}" +texture_atlas/import_texture_atlas=false +texture_atlas/filename_pattern="{basename}.{layer}.Atlas.{extension}" +texture_atlas/frame_filename_pattern="{basename}.{layer}.{animation}.{frame}.Atlas.{extension}" +animated_texture/import_animated_texture=false +animated_texture/filename_pattern="{basename}.{layer}.{animation}.Texture.{extension}" +animated_texture/frame_filename_pattern="{basename}.{layer}.{animation}.{frame}.Texture.{extension}" diff --git a/assets/neutral object/buttonStateIndicator.aseprite b/assets/neutral object/buttonStateIndicator.aseprite new file mode 100644 index 0000000000000000000000000000000000000000..ba53a8e545d82a81c033a2d1821981bfcebb4430 GIT binary patch literal 2262 zcmc(fe@xV69LJx7J1!Gjx>698Yq0onpu2-8LLe+S9hj3f^meOuc_8=))Hw@li<^^# z)2U4pGuD=PO`WZxT<5Il2V5f)brG{Ai==^IA}1RXQ?A#CscN;$axDlVmwN_8*4|Dx3Blp6JijgK0}0CTzYhVdb98*YB6 zQjrGNt(vOaT9ndhLjy|P6CMteqZUDX+yn4L?n3ByM8g}N=V74h6Cni-*20mNN8u%R z8vMYP1lOmVU|e(*EXZ68tDjAW-`C~9k>Mxc4;Q58_q?gFYNyn!UH1@7SsDu?7DU2? zY?*__`3SUovf-|?X4vdcfM)~!u=;fkCsu+rg!_1k}fZAY)b(GGcj;CMZ3cb$a0 z3qOVP?w<=EPLUOr*<>b-+biM4##iC+`F-%l_0QpNmwVwU-^L5vY@ZJ2zDG^4L{x_yWz~2ea=mk9k!Rs{_okF2YueP@M`Dl@ObYj_?l1p zfBLP>aCxcBDk&o!&WnhY`&8*I?{h=w?b zfY^t6c!zWthi7oW99iQ@(e1izRErm|n%4)CH#hax*V)F)7m= z{kg13BQKs}phq8?`hXOH=&EKji_HHznpWKGKSva zf-@#f**L|NC8DZd8y;K`s&YTPgVj!FlW&dLQ&nV`^_4Q`Pk*^GSN G<^BNz7QSZy literal 0 HcmV?d00001 diff --git a/assets/neutral object/buttonStateIndicator.aseprite.import b/assets/neutral object/buttonStateIndicator.aseprite.import new file mode 100644 index 0000000..c2e32fb --- /dev/null +++ b/assets/neutral object/buttonStateIndicator.aseprite.import @@ -0,0 +1,26 @@ +[remap] + +importer="aseprite.wizard.plugin" +type="SpriteFrames" +path="res://.import/buttonStateIndicator.aseprite-806b0eadbb43e41e786dd7af47b87bad.res" + +[deps] + +source_file="res://assets/neutral object/buttonStateIndicator.aseprite" +dest_files=[ "res://.import/buttonStateIndicator.aseprite-806b0eadbb43e41e786dd7af47b87bad.res" ] + +[params] + +split_layers=false +exclude_layers_pattern="" +only_visible_layers=false +sheet_type="Packed" +sprite_filename_pattern="{basename}.{layer}.{extension}" +texture_strip/import_texture_strip=false +texture_strip/filename_pattern="{basename}.{layer}.Strip.{extension}" +texture_atlas/import_texture_atlas=false +texture_atlas/filename_pattern="{basename}.{layer}.Atlas.{extension}" +texture_atlas/frame_filename_pattern="{basename}.{layer}.{animation}.{frame}.Atlas.{extension}" +animated_texture/import_animated_texture=false +animated_texture/filename_pattern="{basename}.{layer}.{animation}.Texture.{extension}" +animated_texture/frame_filename_pattern="{basename}.{layer}.{animation}.{frame}.Texture.{extension}" diff --git a/src/Actors/Blobby/Blobby.gd b/src/Actors/Blobby/Blobby.gd index fcbea59..3c0e42f 100644 --- a/src/Actors/Blobby/Blobby.gd +++ b/src/Actors/Blobby/Blobby.gd @@ -1,6 +1,7 @@ extends Player const PhysicsFunc = preload("res://src/Utilities/Physic/PhysicsFunc.gd") export var jump_buffer_filled := false +#TODO Switch to new unique node name method for referencing onready var left_wall_raycasts = $WallRaycasts/LeftWallRaycast onready var right_wall_raycasts = $WallRaycasts/RightWallRaycast onready var player_state_machine = $BlobbyStateMachine diff --git a/src/Actors/Blobby/Blobby.tscn b/src/Actors/Blobby/Blobby.tscn index ae04635..0643a44 100644 --- a/src/Actors/Blobby/Blobby.tscn +++ b/src/Actors/Blobby/Blobby.tscn @@ -251,6 +251,7 @@ switch_mode = 2 auto_advance = true [sub_resource type="AnimationNodeStateMachineTransition" id=178] +priority = 0 [sub_resource type="AnimationNodeStateMachineTransition" id=137] @@ -266,9 +267,9 @@ states/idleTurn/position = Vector2( 1375.54, -193.991 ) states/idling/node = SubResource( 116 ) states/idling/position = Vector2( 1375.54, -54 ) states/jumpToFall/node = SubResource( 119 ) -states/jumpToFall/position = Vector2( 1795.54, 311.009 ) +states/jumpToFall/position = Vector2( 1795.54, 343.009 ) states/jumping/node = SubResource( 125 ) -states/jumping/position = Vector2( 1375.54, 129.009 ) +states/jumping/position = Vector2( 1375.54, 117.009 ) states/runToJump/node = SubResource( 146 ) states/runToJump/position = Vector2( 1191.54, 36 ) states/running/node = SubResource( 122 ) @@ -278,12 +279,12 @@ states/turnToRun/position = Vector2( 1795.54, -308.991 ) states/walking/node = SubResource( 133 ) states/walking/position = Vector2( 1795.54, -54 ) states/wallslideToJump/node = SubResource( 136 ) -states/wallslideToJump/position = Vector2( 1566.54, 380.009 ) +states/wallslideToJump/position = Vector2( 1375.54, 343.009 ) states/wallsliding/node = SubResource( 96 ) -states/wallsliding/position = Vector2( 1788.54, 501.009 ) +states/wallsliding/position = Vector2( 1795.54, 493.009 ) transitions = [ "falling", "wallsliding", SubResource( 138 ), "wallsliding", "idling", SubResource( 139 ), "wallsliding", "wallslideToJump", SubResource( 140 ), "wallslideToJump", "jumping", SubResource( 141 ), "idling", "jumping", SubResource( 147 ), "runToJump", "jumping", SubResource( 148 ), "ducking", "jumping", SubResource( 149 ), "jumping", "jumpToFall", SubResource( 150 ), "jumpToFall", "falling", SubResource( 151 ), "ducking", "duckTurn", SubResource( 152 ), "duckTurn", "ducking", SubResource( 153 ), "falling", "ducking", SubResource( 154 ), "ducking", "falling", SubResource( 155 ), "ducking", "walking", SubResource( 156 ), "walking", "ducking", SubResource( 157 ), "idling", "ducking", SubResource( 158 ), "ducking", "idling", SubResource( 159 ), "ducking", "running", SubResource( 160 ), "running", "ducking", SubResource( 161 ), "running", "falling", SubResource( 162 ), "falling", "running", SubResource( 163 ), "walking", "falling", SubResource( 164 ), "falling", "walking", SubResource( 165 ), "falling", "idling", SubResource( 166 ), "idling", "walking", SubResource( 167 ), "walking", "idling", SubResource( 168 ), "walking", "turnToRun", SubResource( 169 ), "turnToRun", "walking", SubResource( 170 ), "running", "turnToRun", SubResource( 171 ), "turnToRun", "running", SubResource( 172 ), "idling", "idleTurn", SubResource( 173 ), "walking", "idleTurn", SubResource( 174 ), "idleTurn", "walking", SubResource( 175 ), "idling", "turnToRun", SubResource( 176 ), "turnToRun", "idling", SubResource( 177 ), "running", "runToJump", SubResource( 178 ), "wallsliding", "falling", SubResource( 137 ) ] start_node = "idling" -graph_offset = Vector2( 996.54, -125.991 ) +graph_offset = Vector2( 984.54, -229.991 ) [sub_resource type="AnimationNodeStateMachinePlayback" id=48] @@ -3678,7 +3679,7 @@ tracks/11/keys = { } [sub_resource type="Animation" id=73] -length = 0.2 +length = 0.15 loop = true tracks/0/type = "value" tracks/0/path = NodePath(".:frame") @@ -3827,7 +3828,7 @@ tracks/11/keys = { [sub_resource type="Animation" id=101] resource_name = "wallslideToJumpRight" -length = 0.2 +length = 0.15 loop = true tracks/0/type = "value" tracks/0/path = NodePath(".:frame") diff --git a/src/Levels/TLT Level.tscn b/src/Levels/TLT Level.tscn index 6df537f..a8ef3ce 100644 --- a/src/Levels/TLT Level.tscn +++ b/src/Levels/TLT Level.tscn @@ -1,11 +1,13 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=10 format=2] [ext_resource path="res://src/Environment/AlienShipTileSet.tres" type="TileSet" id=1] [ext_resource path="res://src/Actors/Blobby/Blobby.tscn" type="PackedScene" id=2] [ext_resource path="res://src/HarmfulObjects/Spikes.tscn" type="PackedScene" id=3] [ext_resource path="res://src/Contraptions/Platform/FlyingLaserCutter.tscn" type="PackedScene" id=4] [ext_resource path="res://src/Contraptions/Portal/Portal.tscn" type="PackedScene" id=5] +[ext_resource path="res://src/NeutralObjects/Coin.tscn" type="PackedScene" id=6] [ext_resource path="res://src/UserInterface/Buttons/UI.tscn" type="PackedScene" id=7] +[ext_resource path="res://src/NeutralObjects/ThreeWhyButtons.tscn" type="PackedScene" id=8] [sub_resource type="AnimationNodeStateMachinePlayback" id=4] @@ -24,12 +26,37 @@ scale = Vector2( 0.878906, 0.936025 ) parameters/playback = SubResource( 4 ) [node name="FlyingLaserCutter" parent="." instance=ExtResource( 4 )] -visible = false position = Vector2( 80, 80 ) rotation = 1.5708 [node name="Portal" parent="." instance=ExtResource( 5 )] -position = Vector2( 1440, -120 ) +position = Vector2( 1428, -110 ) + +[node name="Collectibles" type="Node2D" parent="."] + +[node name="Coin" parent="Collectibles" instance=ExtResource( 6 )] +position = Vector2( 336, -60 ) +scale = Vector2( 0.133, 0.133 ) + +[node name="Coin2" parent="Collectibles" instance=ExtResource( 6 )] +position = Vector2( 324, -11 ) +scale = Vector2( 0.133, 0.133 ) + +[node name="Coin3" parent="Collectibles" instance=ExtResource( 6 )] +position = Vector2( 1188, -84 ) +scale = Vector2( 0.133, 0.133 ) + +[node name="Coin4" parent="Collectibles" instance=ExtResource( 6 )] +position = Vector2( 1236, -108 ) +scale = Vector2( 0.133, 0.133 ) + +[node name="Coin5" parent="Collectibles" instance=ExtResource( 6 )] +position = Vector2( 1140, -108 ) +scale = Vector2( 0.133, 0.133 ) + +[node name="Coin6" parent="Collectibles" instance=ExtResource( 6 )] +position = Vector2( 696, -48 ) +scale = Vector2( 0.133, 0.133 ) [node name="TileMap" type="TileMap" parent="."] tile_set = ExtResource( 1 ) @@ -39,7 +66,7 @@ cell_custom_transform = Transform2D( 24, 0, 0, 24, 0, 0 ) collision_layer = 8 collision_mask = 8 format = 1 -tile_data = PoolIntArray( -589830, -1610612734, 0, -655299, 2, 0, -524294, -1610612734, 0, -589763, 2, 0, -458758, -1610612734, 0, -524227, 2, 0, -393222, -1610612734, 0, -458691, 2, 0, -327686, -1610612734, 0, -393155, 2, 0, -262150, -1610612734, 0, -327619, 2, 0, -196614, -1610612734, 0, -262088, 2, 0, -262087, 2, 0, -262086, 2, 0, -262085, 2, 0, -262084, 2, 0, -262083, 2, 0, -131078, -1610612734, 0, -196568, 2, 0, -196567, 2, 0, -196566, 2, 0, -196565, 2, 0, -196564, 2, 0, -196563, 2, 0, -196562, 2, 0, -196559, 2, 0, -196556, 2, 0, -196555, 2, 0, -196554, 2, 0, -196553, 2, 0, -196552, 2, 0, -196551, 2, 0, -196550, 2, 0, -196549, 2, 0, -196548, 2, 0, -196547, 2, 0, -65542, -1610612734, 0, -131064, 2, 0, -131063, 2, 0, -131059, 2, 0, -131058, 2, 0, -131054, 2, 0, -131053, 2, 0, -131052, 2, 0, -131051, 2, 0, -131032, 2, 0, -131026, 2, 0, -131020, 2, 0, -131019, 2, 0, -131018, 2, 0, -131017, 2, 0, -131016, 2, 0, -131015, 2, 0, -131014, 2, 0, -131013, 2, 0, -131012, 2, 0, -131011, 2, 0, -6, -1610612734, 0, -65532, 2, 0, -65531, 2, 0, -65530, 2, 0, -65529, 2, 0, -65526, 2, 0, -65519, 2, 0, -65514, 2, 0, -65501, 2, 0, -65500, 2, 0, -65499, 2, 0, -65498, 2, 0, -65497, 2, 0, -65496, 2, 0, -65490, 2, 0, -65489, 2, 0, -65488, 2, 0, -65487, 2, 0, -65486, 2, 0, -65485, 2, 0, -65484, 2, 0, -65483, 2, 0, -65482, 2, 0, -65481, 2, 0, -65480, 2, 0, -65479, 2, 0, -65478, 2, 0, -65477, 2, 0, -65476, 2, 0, -65475, 2, 0, 65530, 3, 0, 65531, 2, 0, 65532, 2, 0, 65533, 2, 0, 65534, 2, 0, 65535, 2, 0, 0, 2, 0, 1, 2, 0, 2, 2, 0, 3, 2, 0, 4, 2, 0, 10, 2, 0, 11, 2, 0, 12, 2, 0, 13, 2, 0, 14, 2, 0, 15, 2, 0, 16, 2, 0, 17, 2, 0, 22, 2, 0, 23, 2, 0, 24, 2, 0, 25, 2, 0, 26, 2, 0, 27, 2, 0, 30, 2, 0, 31, 2, 0, 32, 2, 0, 33, 2, 0, 34, 2, 0, 35, 2, 0 ) +tile_data = PoolIntArray( -786438, -1610612735, 0, -786437, 1610612738, 0, -786436, 1610612738, 0, -786435, 1610612736, 0, -786434, 1610612738, 0, -786433, 1610612738, 0, -851968, 1610612736, 0, -851967, 1610612738, 0, -851966, 1610612738, 0, -851965, 1610612736, 0, -851964, 1610612738, 0, -851963, 1610612738, 0, -851962, 1610612736, 0, -851961, 1610612738, 0, -851960, 1610612738, 0, -851959, 1610612736, 0, -851958, 1610612738, 0, -851957, 1610612738, 0, -851956, 1610612736, 0, -851955, 1610612738, 0, -851954, 1610612738, 0, -851953, 1610612736, 0, -851952, 1610612738, 0, -851951, 1610612738, 0, -851950, 1610612736, 0, -851949, 1610612738, 0, -851948, 1610612738, 0, -851947, 1610612736, 0, -851946, 1610612738, 0, -851945, 1610612738, 0, -851944, 1610612736, 0, -851943, 1610612738, 0, -851942, 1610612738, 0, -851941, 1610612736, 0, -851940, 1610612738, 0, -851939, 1610612738, 0, -851938, 1610612736, 0, -851937, 1610612738, 0, -851936, 1610612738, 0, -851935, 1610612736, 0, -851934, 1610612738, 0, -851933, 1610612738, 0, -851932, 1610612736, 0, -851931, 1610612738, 0, -851930, 1610612738, 0, -851929, 1610612736, 0, -851928, 1610612738, 0, -851927, 1610612738, 0, -851926, 1610612736, 0, -851925, 1610612738, 0, -851924, 1610612738, 0, -851923, 1610612736, 0, -851922, 1610612738, 0, -851921, 1610612738, 0, -851920, 1610612736, 0, -851919, 1610612738, 0, -851918, 1610612738, 0, -851917, 1610612736, 0, -851916, 1610612738, 0, -851915, 1610612738, 0, -851914, 1610612736, 0, -851913, 1610612738, 0, -851912, 1610612738, 0, -851911, 1610612736, 0, -851910, 1610612738, 0, -851909, 1610612738, 0, -851908, 1610612736, 0, -851907, 3, 0, -720902, -1610612734, 0, -786371, -1073741822, 0, -655366, -1610612734, 0, -720835, -1073741824, 0, -589830, -1610612736, 0, -655299, -1073741822, 0, -524294, -1610612734, 0, -589763, -1073741822, 0, -458758, -1610612734, 0, -524227, -1073741824, 0, -393222, -1610612736, 0, -458691, -1073741822, 0, -327686, -1610612734, 0, -393155, -1073741822, 0, -262150, -1610612734, 0, -327619, -1073741824, 0, -196614, -1610612736, 0, -262088, 0, 0, -262087, 2, 0, -262086, 2, 0, -262085, 0, 0, -262084, 2, 0, -262083, 1610612739, 0, -131078, -1610612734, 0, -196568, 0, 0, -196567, 2, 0, -196566, 2, 0, -196565, 0, 0, -196564, 2, 0, -196563, 2, 0, -196562, 0, 0, -196559, 2, 0, -196556, 2, 0, -196555, 0, 0, -196554, 2, 0, -196553, 2, 0, -196552, 1610612739, 0, -196551, 1610612739, 0, -196550, 1610612739, 0, -196549, 1610612739, 0, -196548, 1610612739, 0, -196547, 1610612739, 0, -65542, -1610612734, 0, -131064, 0, 0, -131063, 2, 0, -131059, -1073741822, 0, -131058, -1610612734, 0, -131054, 2, 0, -131053, 2, 0, -131052, 0, 0, -131051, 2, 0, -131032, 1610612739, 0, -131031, 1610612739, 0, -131030, 1610612739, 0, -131029, 1610612739, 0, -131028, 1610612739, 0, -131027, 1610612739, 0, -131026, 1610612739, 0, -131020, 1610612739, 0, -131019, 1610612739, 0, -131018, 1610612739, 0, -131017, 1610612739, 0, -131016, 1, 0, -131015, 1610612739, 0, -131014, 1610612739, 0, -131013, 1, 0, -131012, 1610612739, 0, -131011, 1610612739, 0, -6, -1610612736, 0, -65532, 2, 0, -65531, 0, 0, -65530, 2, 0, -65529, 2, 0, -65528, 1610612739, 0, -65527, 1610612739, 0, -65526, 2, 0, -65519, 0, 0, -65518, 1610612739, 0, -65517, 1610612739, 0, -65516, 1610612739, 0, -65515, 1610612739, 0, -65514, 2, 0, -65501, 2, 0, -65500, 2, 0, -65499, 0, 0, -65498, 2, 0, -65497, 2, 0, -65496, 1, 0, -65495, 1610612739, 0, -65494, 1610612739, 0, -65493, 1, 0, -65492, 1610612739, 0, -65491, 1610612739, 0, -65490, 1, 0, -65489, 2, 0, -65488, 2, 0, -65487, 2, 0, -65486, 2, 0, -65485, 2, 0, -65484, 1610612739, 0, -65483, 1, 0, -65482, 1610612739, 0, -65481, 1610612739, 0, -65480, 1610612739, 0, -65479, 1610612739, 0, -65478, 1610612739, 0, -65477, 1610612739, 0, -65476, 1610612739, 0, -65475, 1610612739, 0, 65530, 3, 0, 65531, 2, 0, 65532, 0, 0, 65533, 2, 0, 65534, 2, 0, 65535, 0, 0, 0, 2, 0, 1, 2, 0, 2, 0, 0, 3, 2, 0, 4, 1610612739, 0, 5, 1610612739, 0, 6, 1610612739, 0, 7, 1610612739, 0, 8, 1610612739, 0, 9, 1610612739, 0, 10, 1610612739, 0, 11, 0, 0, 12, 2, 0, 13, 2, 0, 14, 0, 0, 15, 2, 0, 16, 2, 0, 17, 1610612739, 0, 18, 1610612739, 0, 19, 1610612739, 0, 20, 1610612739, 0, 21, 1610612739, 0, 22, 1610612739, 0, 23, 0, 0, 24, 2, 0, 25, 2, 0, 26, 0, 0, 27, 2, 0, 30, 2, 0, 31, 0, 0, 32, 2, 0, 33, 2, 0, 34, 0, 0, 35, 1610612739, 0, 36, 1610612739, 0, 37, 1610612739, 0, 38, 1610612739, 0, 39, 1610612739, 0, 40, 1610612739, 0, 41, 1610612739, 0, 42, 1610612739, 0, 43, 1610612739, 0, 44, 1610612739, 0, 45, 1610612739, 0, 46, 1610612739, 0, 47, 1610612739, 0, 48, 1610612739, 0, 49, 1610612739, 0, 50, 1610612739, 0, 51, 1610612739, 0, 52, 1610612739, 0, 53, 1610612739, 0, 54, 1610612739, 0, 55, 1610612739, 0, 56, 1, 0, 57, 1610612739, 0, 58, 1610612739, 0, 59, 1, 0, 60, 1610612739, 0, 61, 1610612739, 0 ) [node name="Spikes" parent="TileMap" instance=ExtResource( 3 )] position = Vector2( 708, 12 ) @@ -62,4 +89,23 @@ position = Vector2( 1236, -36 ) [node name="Spikes3" parent="TileMap" instance=ExtResource( 3 )] position = Vector2( 684, 12 ) +[node name="TreeWhyButtons" parent="." instance=ExtResource( 8 )] +position = Vector2( -108, -7 ) + +[node name="WhyButton1" parent="TreeWhyButtons" index="0"] +position = Vector2( -12, -49 ) +rotation = 1.5708 + +[node name="WhyButton2" parent="TreeWhyButtons" index="1"] +position = Vector2( 444, -17 ) +rotation = 3.14159 + +[node name="WhyButton3" parent="TreeWhyButtons" index="2"] +position = Vector2( 1452, -77 ) +rotation = -1.5708 + [editable path="Blobby"] +[editable path="TreeWhyButtons"] +[editable path="TreeWhyButtons/WhyButton1"] +[editable path="TreeWhyButtons/WhyButton2"] +[editable path="TreeWhyButtons/WhyButton3"] diff --git a/src/NeutralObjects/ThreeWhyButtons.gd b/src/NeutralObjects/ThreeWhyButtons.gd new file mode 100644 index 0000000..7c8073d --- /dev/null +++ b/src/NeutralObjects/ThreeWhyButtons.gd @@ -0,0 +1,8 @@ +extends Node2D + +#Is emitted in child nodes +signal child_button_activated(id) + +func _on_TreeWhyButtons_child_button_activated(id: int) -> void: + for button in get_children(): + button.activateIDIndicator(id) diff --git a/src/NeutralObjects/ThreeWhyButtons.tscn b/src/NeutralObjects/ThreeWhyButtons.tscn new file mode 100644 index 0000000..56b67fd --- /dev/null +++ b/src/NeutralObjects/ThreeWhyButtons.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://src/NeutralObjects/WhyButton.tscn" type="PackedScene" id=1] +[ext_resource path="res://src/NeutralObjects/ThreeWhyButtons.gd" type="Script" id=2] + +[node name="TreeWhyButtons" type="Node2D"] +script = ExtResource( 2 ) + +[node name="WhyButton1" parent="." instance=ExtResource( 1 )] +buttonID = 1 + +[node name="WhyButton2" parent="." instance=ExtResource( 1 )] +buttonID = 2 + +[node name="WhyButton3" parent="." instance=ExtResource( 1 )] +buttonID = 3 + +[connection signal="child_button_activated" from="." to="." method="_on_TreeWhyButtons_child_button_activated"] + +[editable path="WhyButton1"] +[editable path="WhyButton2"] +[editable path="WhyButton3"] diff --git a/src/NeutralObjects/WhyButton.gd b/src/NeutralObjects/WhyButton.gd new file mode 100644 index 0000000..f0ea3d7 --- /dev/null +++ b/src/NeutralObjects/WhyButton.gd @@ -0,0 +1,27 @@ +extends Node2D + +onready var buttonPlayer = $"%ButtonPlayer" +onready var activatorArea = $"%ActivatorArea" +onready var indicator1Player = $"%Indicator1Player" +onready var indicator2Player = $"%Indicator2Player" +onready var indicator3Player = $"%Indicator3Player" + +export var buttonID: int; + +func selfActivate(): + var selfPlayerString = "indicator"+String(buttonID)+"Player" + get(selfPlayerString).play("onning") + buttonPlayer.play("pushing") + #TODO dis importante + activatorArea.set_deferred("monitoring", false) + +func activateIDIndicator(id: int): + var selfPlayerString = "indicator"+String(id)+"Player" + get(selfPlayerString).play("onning") + +func _on_ActivatorArea_area_entered(_area:Area2D) -> void: + selfActivate() + if get_parent().has_signal("child_button_activated"): + get_parent().emit_signal("child_button_activated", buttonID) + + diff --git a/src/NeutralObjects/WhyButton.tscn b/src/NeutralObjects/WhyButton.tscn new file mode 100644 index 0000000..d3f9f75 --- /dev/null +++ b/src/NeutralObjects/WhyButton.tscn @@ -0,0 +1,212 @@ +[gd_scene load_steps=15 format=2] + +[ext_resource path="res://src/NeutralObjects/WhyButton.gd" type="Script" id=1] + +[sub_resource type="StreamTexture" id=1] +load_path = "res://.import/button.png-6b06252879983e2da39a6ce37483d567.stex" + +[sub_resource type="Animation" id=2] +resource_name = "pushing" +length = 0.5 +tracks/0/type = "value" +tracks/0/path = NodePath(".:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = false +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.2, 0.4 ), +"transitions": PoolRealArray( 1, 1, 1 ), +"update": 1, +"values": [ 0.0, 1.0, 2.0 ] +} + +[sub_resource type="StreamTexture" id=5] +load_path = "res://.import/buttonStateIndicator.png-4ad4dfff1d6add183d62f1b602452b7a.stex" + +[sub_resource type="Animation" id=6] +length = 0.1 +tracks/0/type = "value" +tracks/0/path = NodePath(".:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = false +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ 0.0 ] +} + +[sub_resource type="Animation" id=8] +resource_name = "onning" +length = 0.6 +tracks/0/type = "value" +tracks/0/path = NodePath(".:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = false +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.2, 0.3, 0.5 ), +"transitions": PoolRealArray( 1, 1, 1, 1 ), +"update": 1, +"values": [ 5.0, 2.0, 6.0, 4.0 ] +} + +[sub_resource type="StreamTexture" id=17] +load_path = "res://.import/buttonStateIndicator.png-4ad4dfff1d6add183d62f1b602452b7a.stex" + +[sub_resource type="Animation" id=10] +length = 0.1 +tracks/0/type = "value" +tracks/0/path = NodePath(".:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = false +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ 0.0 ] +} + +[sub_resource type="Animation" id=13] +resource_name = "onning" +length = 0.6 +tracks/0/type = "value" +tracks/0/path = NodePath(".:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = false +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.2, 0.3, 0.5 ), +"transitions": PoolRealArray( 1, 1, 1, 1 ), +"update": 1, +"values": [ 7.0, 8.0, 6.0, 4.0 ] +} + +[sub_resource type="StreamTexture" id=18] +load_path = "res://.import/buttonStateIndicator.png-4ad4dfff1d6add183d62f1b602452b7a.stex" + +[sub_resource type="Animation" id=14] +length = 0.1 +tracks/0/type = "value" +tracks/0/path = NodePath(".:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = false +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ 0.0 ] +} + +[sub_resource type="Animation" id=19] +resource_name = "onning" +length = 0.6 +tracks/0/type = "value" +tracks/0/path = NodePath(".:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = false +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.2, 0.3, 0.5 ), +"transitions": PoolRealArray( 1, 1, 1, 1 ), +"update": 1, +"values": [ 1.0, 2.0, 3.0, 4.0 ] +} + +[sub_resource type="RectangleShape2D" id=4] +extents = Vector2( 4, 1 ) + +[sub_resource type="RectangleShape2D" id=3] +extents = Vector2( 6, 1 ) + +[node name="WhyButton" type="Node2D"] +script = ExtResource( 1 ) + +[node name="Button" type="Sprite" parent="."] +position = Vector2( 0, -6 ) +texture = SubResource( 1 ) +hframes = 2 +vframes = 2 +__meta__ = { +"_editor_description_": "YXNlcHJpdGVfd2l6YXJkX2NvbmZpZwpwbGF5ZXJ8PVNwcml0ZS9BbmltYXRpb25QbGF5ZXIKc291cmNlfD1yZXM6Ly9hc3NldHMvbmV1dHJhbCBvYmplY3QvYnV0dG9uLmFzZXByaXRlCmxheWVyfD0Kb3BfZXhwfD1GYWxzZQpvX2ZvbGRlcnw9Cm9fbmFtZXw9Cm9ubHlfdmlzaWJsZXw9RmFsc2UKb19leF9wfD0K" +} + +[node name="ButtonPlayer" type="AnimationPlayer" parent="Button"] +unique_name_in_owner = true +anims/pushing = SubResource( 2 ) + +[node name="Indicator1" type="Sprite" parent="."] +position = Vector2( -3, -1 ) +z_index = 1 +texture = SubResource( 5 ) +hframes = 3 +vframes = 3 +__meta__ = { +"_editor_description_": "YXNlcHJpdGVfd2l6YXJkX2NvbmZpZwpwbGF5ZXJ8PUluZGljYXRvcjEvQW5pbWF0aW9uUGxheWVyCnNvdXJjZXw9cmVzOi8vYXNzZXRzL25ldXRyYWwgb2JqZWN0L2J1dHRvblN0YXRlSW5kaWNhdG9yLmFzZXByaXRlCmxheWVyfD0Kb3BfZXhwfD1GYWxzZQpvX2ZvbGRlcnw9Cm9fbmFtZXw9Cm9ubHlfdmlzaWJsZXw9RmFsc2UKb19leF9wfD0K" +} + +[node name="Indicator1Player" type="AnimationPlayer" parent="Indicator1"] +unique_name_in_owner = true +anims/offing = SubResource( 6 ) +anims/onning = SubResource( 8 ) + +[node name="Indicator2" type="Sprite" parent="."] +position = Vector2( 0, -1 ) +z_index = 1 +texture = SubResource( 17 ) +hframes = 3 +vframes = 3 +__meta__ = { +"_editor_description_": "YXNlcHJpdGVfd2l6YXJkX2NvbmZpZwpwbGF5ZXJ8PUluZGljYXRvcjIvQW5pbWF0aW9uUGxheWVyCnNvdXJjZXw9cmVzOi8vYXNzZXRzL25ldXRyYWwgb2JqZWN0L2J1dHRvblN0YXRlSW5kaWNhdG9yLmFzZXByaXRlCmxheWVyfD0Kb3BfZXhwfD1GYWxzZQpvX2ZvbGRlcnw9Cm9fbmFtZXw9Cm9ubHlfdmlzaWJsZXw9RmFsc2UKb19leF9wfD0K" +} + +[node name="Indicator2Player" type="AnimationPlayer" parent="Indicator2"] +unique_name_in_owner = true +anims/offing = SubResource( 10 ) +anims/onning = SubResource( 13 ) + +[node name="Indicator3" type="Sprite" parent="."] +position = Vector2( 3, -1 ) +z_index = 1 +texture = SubResource( 18 ) +hframes = 3 +vframes = 3 +__meta__ = { +"_editor_description_": "YXNlcHJpdGVfd2l6YXJkX2NvbmZpZwpwbGF5ZXJ8PUluZGljYXRvcjMvQW5pbWF0aW9uUGxheWVyCnNvdXJjZXw9cmVzOi8vYXNzZXRzL25ldXRyYWwgb2JqZWN0L2J1dHRvblN0YXRlSW5kaWNhdG9yLmFzZXByaXRlCmxheWVyfD0Kb3BfZXhwfD1GYWxzZQpvX2ZvbGRlcnw9Cm9fbmFtZXw9Cm9ubHlfdmlzaWJsZXw9RmFsc2UKb19leF9wfD0K" +} + +[node name="Indicator3Player" type="AnimationPlayer" parent="Indicator3"] +unique_name_in_owner = true +anims/offing = SubResource( 14 ) +anims/onning = SubResource( 19 ) + +[node name="ActivatorArea" type="Area2D" parent="."] +unique_name_in_owner = true +position = Vector2( 0, -6 ) +collision_layer = 24 + +[node name="ActivatorAreaShape" type="CollisionShape2D" parent="ActivatorArea"] +unique_name_in_owner = true +position = Vector2( 0, 3 ) +shape = SubResource( 4 ) + +[node name="ButtonBody" type="StaticBody2D" parent="."] +unique_name_in_owner = true +position = Vector2( 0, -6 ) +collision_layer = 24 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="ButtonBody"] +position = Vector2( 0, 5 ) +shape = SubResource( 3 ) + +[connection signal="area_entered" from="ActivatorArea" to="." method="_on_ActivatorArea_area_entered"] diff --git a/src/NeutralObjects/button.png b/src/NeutralObjects/button.png new file mode 100644 index 0000000000000000000000000000000000000000..237227f68b87580bccd70e2968647b70e5cc701e GIT binary patch literal 168 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjjKx9jP7LeL$-D$|l001;Lp(Z@ z6C_v{Cx{pvl8}~B{`WXoVnaQvvR!3NL#vE056=!cxbl_zK@AC3XUPdM+a}~NZfu*J&B?IJN;yiu@2Vis OHU>{uKbLh*2~7aKXf?