main.tscn 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. [gd_scene load_steps=28 format=2]
  2. [ext_resource path="res://spawner.gd" type="Script" id=1]
  3. [ext_resource path="res://bacteria.tscn" type="PackedScene" id=2]
  4. [ext_resource path="res://restarter.gd" type="Script" id=3]
  5. [ext_resource path="res://Healthpickup.tscn" type="PackedScene" id=4]
  6. [ext_resource path="res://PowerUpControl.gd" type="Script" id=5]
  7. [ext_resource path="res://font/ComfortaaRegular.ttf" type="DynamicFontData" id=6]
  8. [ext_resource path="res://newdynamicfont.tres" type="DynamicFont" id=7]
  9. [ext_resource path="res://buttonsgens.gd" type="Script" id=8]
  10. [ext_resource path="res://font/newdynamicfont.tres" type="DynamicFont" id=9]
  11. [ext_resource path="res://font/newtheme.tres" type="Theme" id=10]
  12. [ext_resource path="res://ui/InterfaceLevelUpNew.png" type="Texture" id=11]
  13. [ext_resource path="res://ui/Area2D2.gd" type="Script" id=12]
  14. [ext_resource path="res://audio.ogg" type="AudioStream" id=13]
  15. [ext_resource path="res://debug.gd" type="Script" id=14]
  16. [ext_resource path="res://sandtex22.png" type="Texture" id=15]
  17. [ext_resource path="res://sounds/keylock.ogg" type="AudioStream" id=16]
  18. [sub_resource type="DynamicFont" id=1]
  19. font_data = ExtResource( 6 )
  20. [sub_resource type="Theme" id=2]
  21. default_font = SubResource( 1 )
  22. [sub_resource type="CircleShape2D" id=3]
  23. radius = 20.0
  24. [sub_resource type="GDScript" id=11]
  25. script/source = "extends Sprite
  26. func _process(delta):
  27. global_position = get_viewport_transform().get_origin() * -1
  28. region_rect.position.x = get_viewport_transform().get_origin().x * -1
  29. region_rect.position.y = get_viewport_transform().get_origin().y * -1
  30. # pass
  31. "
  32. [sub_resource type="Shader" id=4]
  33. code = "// NOTE: Shader automatically converted from Godot Engine 3.4.4.stable's CanvasItemMaterial.
  34. shader_type canvas_item;
  35. render_mode blend_mix;
  36. uniform sampler2D noise;
  37. uniform sampler2D noise2;
  38. uniform sampler2D grad;
  39. void fragment(){
  40. float col = texture(noise, UV).r * texture(noise2, UV+TIME*0.1).r + 0.3;
  41. COLOR = texture(grad, vec2( round(col)) ) + clamp(col,0.0,0.6) - 0.3;
  42. }"
  43. [sub_resource type="Gradient" id=5]
  44. offsets = PoolRealArray( 0.00833333, 0.970833 )
  45. colors = PoolColorArray( 0.00156975, 0.401855, 0.337356, 1, 0.144711, 0.686035, 0.256252, 1 )
  46. [sub_resource type="GradientTexture" id=6]
  47. gradient = SubResource( 5 )
  48. [sub_resource type="OpenSimplexNoise" id=7]
  49. [sub_resource type="NoiseTexture" id=8]
  50. width = 256
  51. height = 256
  52. noise = SubResource( 7 )
  53. [sub_resource type="NoiseTexture" id=9]
  54. width = 96
  55. height = 96
  56. seamless = true
  57. noise = SubResource( 7 )
  58. [sub_resource type="ShaderMaterial" id=10]
  59. shader = SubResource( 4 )
  60. shader_param/noise = SubResource( 8 )
  61. shader_param/noise2 = SubResource( 9 )
  62. shader_param/grad = SubResource( 6 )
  63. [node name="main" type="YSort"]
  64. position = Vector2( 2, 0 )
  65. [node name="bacteria" parent="." instance=ExtResource( 2 )]
  66. [node name="spawner" type="Node2D" parent="."]
  67. script = ExtResource( 1 )
  68. spawnspeed = 1.0
  69. [node name="spawner2" type="Node2D" parent="."]
  70. script = ExtResource( 1 )
  71. enemy_ = ExtResource( 4 )
  72. spawnspeed = 1.0
  73. [node name="restarter" type="CanvasLayer" parent="."]
  74. pause_mode = 2
  75. script = ExtResource( 3 )
  76. [node name="MarginContainer" type="MarginContainer" parent="restarter"]
  77. visible = false
  78. anchor_right = 1.0
  79. anchor_bottom = 1.0
  80. margin_left = 300.0
  81. margin_right = -300.0
  82. theme = SubResource( 2 )
  83. [node name="VBoxContainer" type="VBoxContainer" parent="restarter/MarginContainer"]
  84. margin_right = 89.0
  85. margin_bottom = 960.0
  86. theme = SubResource( 2 )
  87. alignment = 1
  88. [node name="Label" type="Label" parent="restarter/MarginContainer/VBoxContainer"]
  89. margin_top = 621.0
  90. margin_right = 120.0
  91. margin_bottom = 635.0
  92. custom_fonts/font = ExtResource( 7 )
  93. text = "game over"
  94. align = 1
  95. valign = 1
  96. [node name="Button" type="Button" parent="restarter/MarginContainer/VBoxContainer"]
  97. margin_top = 639.0
  98. margin_right = 120.0
  99. margin_bottom = 659.0
  100. custom_fonts/font = ExtResource( 7 )
  101. text = "restart"
  102. [node name="PowerUpControl" type="CanvasLayer" parent="."]
  103. pause_mode = 2
  104. script = ExtResource( 5 )
  105. [node name="Control" type="MarginContainer" parent="PowerUpControl"]
  106. pause_mode = 2
  107. visible = false
  108. anchor_right = 1.0
  109. anchor_bottom = 1.0
  110. margin_left = 120.0
  111. margin_right = -120.0
  112. theme = SubResource( 2 )
  113. [node name="VSeparator" type="VBoxContainer" parent="PowerUpControl/Control"]
  114. margin_right = 300.0
  115. margin_bottom = 960.0
  116. theme = SubResource( 2 )
  117. alignment = 1
  118. [node name="Label" type="Label" parent="PowerUpControl/Control/VSeparator"]
  119. margin_top = 408.0
  120. margin_right = 300.0
  121. margin_bottom = 427.0
  122. custom_fonts/font = ExtResource( 7 )
  123. text = "Choose a power:"
  124. [node name="ItemList" type="ItemList" parent="PowerUpControl/Control/VSeparator"]
  125. margin_top = 431.0
  126. margin_right = 300.0
  127. margin_bottom = 551.0
  128. rect_min_size = Vector2( 0, 120 )
  129. custom_fonts/font = ExtResource( 7 )
  130. items = [ "Item 0", null, false, "Item 1", null, false, "Item 2", null, false, "Item 3", null, false, "Item 4", null, false ]
  131. [node name="Control2" type="MarginContainer" parent="PowerUpControl"]
  132. pause_mode = 2
  133. visible = false
  134. anchor_right = 1.0
  135. anchor_bottom = 1.0
  136. margin_left = 80.0
  137. margin_right = -80.0
  138. theme = ExtResource( 10 )
  139. [node name="VSeparator" type="VBoxContainer" parent="PowerUpControl/Control2"]
  140. margin_right = 380.0
  141. margin_bottom = 960.0
  142. theme = SubResource( 2 )
  143. alignment = 1
  144. [node name="Label" type="Label" parent="PowerUpControl/Control2/VSeparator"]
  145. margin_top = 154.0
  146. margin_right = 380.0
  147. margin_bottom = 173.0
  148. theme = ExtResource( 10 )
  149. custom_fonts/font = ExtResource( 9 )
  150. text = "Choose a power:"
  151. [node name="ItemList" type="ItemList" parent="PowerUpControl/Control2/VSeparator"]
  152. visible = false
  153. margin_top = 431.0
  154. margin_right = 300.0
  155. margin_bottom = 551.0
  156. rect_min_size = Vector2( 0, 120 )
  157. custom_fonts/font = ExtResource( 7 )
  158. items = [ "Item 0", null, false, "Item 1", null, false, "Item 2", null, false, "Item 3", null, false, "Item 4", null, false ]
  159. [node name="ColorRect" type="ColorRect" parent="PowerUpControl/Control2/VSeparator"]
  160. margin_top = 177.0
  161. margin_right = 380.0
  162. margin_bottom = 777.0
  163. rect_min_size = Vector2( 0, 600 )
  164. color = Color( 0.117647, 0.172549, 0.211765, 1 )
  165. [node name="InterfaceLevelUpNew" type="Sprite" parent="PowerUpControl/Control2/VSeparator/ColorRect"]
  166. position = Vector2( 186, 117 )
  167. scale = Vector2( 0.75, 0.75 )
  168. texture = ExtResource( 11 )
  169. [node name="menbros" type="Node2D" parent="PowerUpControl/Control2/VSeparator"]
  170. self_modulate = Color( 0, 1, 0.952941, 1 )
  171. position = Vector2( 186, 293 )
  172. scale = Vector2( 0.75, 0.75 )
  173. [node name="Area2D2" type="Area2D" parent="PowerUpControl/Control2/VSeparator/menbros"]
  174. position = Vector2( -177.333, 36 )
  175. scale = Vector2( 1.33333, 1.33333 )
  176. collision_layer = 4
  177. collision_mask = 4
  178. script = ExtResource( 12 )
  179. [node name="CollisionShape2D" type="CollisionShape2D" parent="PowerUpControl/Control2/VSeparator/menbros/Area2D2"]
  180. position = Vector2( 32, 32 )
  181. shape = SubResource( 3 )
  182. [node name="Area2D3" type="Area2D" parent="PowerUpControl/Control2/VSeparator/menbros"]
  183. position = Vector2( -177.333, -120 )
  184. scale = Vector2( 1.33333, 1.33333 )
  185. collision_layer = 4
  186. collision_mask = 4
  187. script = ExtResource( 12 )
  188. [node name="CollisionShape2D" type="CollisionShape2D" parent="PowerUpControl/Control2/VSeparator/menbros/Area2D3"]
  189. position = Vector2( 32, 32 )
  190. shape = SubResource( 3 )
  191. [node name="Area2D6" type="Area2D" parent="PowerUpControl/Control2/VSeparator/menbros"]
  192. position = Vector2( -74.6667, 54.6667 )
  193. scale = Vector2( 1.33333, 1.33333 )
  194. collision_layer = 4
  195. collision_mask = 4
  196. script = ExtResource( 12 )
  197. id = 1
  198. [node name="CollisionShape2D" type="CollisionShape2D" parent="PowerUpControl/Control2/VSeparator/menbros/Area2D6"]
  199. position = Vector2( 32, 32 )
  200. shape = SubResource( 3 )
  201. [node name="Area2D7" type="Area2D" parent="PowerUpControl/Control2/VSeparator/menbros"]
  202. position = Vector2( -74.6667, -141.333 )
  203. scale = Vector2( 1.33333, 1.33333 )
  204. collision_layer = 4
  205. collision_mask = 4
  206. script = ExtResource( 12 )
  207. id = 1
  208. [node name="CollisionShape2D" type="CollisionShape2D" parent="PowerUpControl/Control2/VSeparator/menbros/Area2D7"]
  209. position = Vector2( 32, 32 )
  210. shape = SubResource( 3 )
  211. [node name="Area2D4" type="Area2D" parent="PowerUpControl/Control2/VSeparator/menbros"]
  212. position = Vector2( 22.6667, 36 )
  213. scale = Vector2( 1.33333, 1.33333 )
  214. collision_layer = 4
  215. collision_mask = 4
  216. script = ExtResource( 12 )
  217. id = 2
  218. [node name="CollisionShape2D" type="CollisionShape2D" parent="PowerUpControl/Control2/VSeparator/menbros/Area2D4"]
  219. position = Vector2( 32, 32 )
  220. shape = SubResource( 3 )
  221. [node name="Area2D5" type="Area2D" parent="PowerUpControl/Control2/VSeparator/menbros"]
  222. position = Vector2( 22.6667, -120 )
  223. scale = Vector2( 1.33333, 1.33333 )
  224. collision_layer = 4
  225. collision_mask = 4
  226. script = ExtResource( 12 )
  227. id = 2
  228. [node name="CollisionShape2D" type="CollisionShape2D" parent="PowerUpControl/Control2/VSeparator/menbros/Area2D5"]
  229. position = Vector2( 32, 32 )
  230. shape = SubResource( 3 )
  231. [node name="corpo" type="Node2D" parent="PowerUpControl/Control2/VSeparator"]
  232. self_modulate = Color( 1, 0.494118, 0, 1 )
  233. position = Vector2( 186, 293 )
  234. scale = Vector2( 0.75, 0.75 )
  235. [node name="Area2D8" type="Area2D" parent="PowerUpControl/Control2/VSeparator/corpo"]
  236. position = Vector2( -196, -42.6667 )
  237. scale = Vector2( 1.33333, 1.33333 )
  238. collision_layer = 8
  239. collision_mask = 8
  240. script = ExtResource( 12 )
  241. [node name="CollisionShape2D" type="CollisionShape2D" parent="PowerUpControl/Control2/VSeparator/corpo/Area2D8"]
  242. position = Vector2( 32, 32 )
  243. shape = SubResource( 3 )
  244. [node name="Area2D9" type="Area2D" parent="PowerUpControl/Control2/VSeparator/corpo"]
  245. position = Vector2( -117.333, -42.6667 )
  246. scale = Vector2( 1.33333, 1.33333 )
  247. collision_layer = 8
  248. collision_mask = 8
  249. script = ExtResource( 12 )
  250. id = 1
  251. [node name="CollisionShape2D" type="CollisionShape2D" parent="PowerUpControl/Control2/VSeparator/corpo/Area2D9"]
  252. position = Vector2( 32, 32 )
  253. shape = SubResource( 3 )
  254. [node name="Area2D10" type="Area2D" parent="PowerUpControl/Control2/VSeparator/corpo"]
  255. position = Vector2( -38.6667, -42.6667 )
  256. scale = Vector2( 1.33333, 1.33333 )
  257. collision_layer = 8
  258. collision_mask = 8
  259. script = ExtResource( 12 )
  260. id = 2
  261. [node name="CollisionShape2D" type="CollisionShape2D" parent="PowerUpControl/Control2/VSeparator/corpo/Area2D10"]
  262. position = Vector2( 32, 32 )
  263. shape = SubResource( 3 )
  264. [node name="Area2D11" type="Area2D" parent="PowerUpControl/Control2/VSeparator/corpo"]
  265. position = Vector2( 38.6667, -42.6667 )
  266. scale = Vector2( 1.33333, 1.33333 )
  267. collision_layer = 8
  268. collision_mask = 8
  269. script = ExtResource( 12 )
  270. id = 3
  271. [node name="CollisionShape2D" type="CollisionShape2D" parent="PowerUpControl/Control2/VSeparator/corpo/Area2D11"]
  272. position = Vector2( 32, 32 )
  273. shape = SubResource( 3 )
  274. [node name="Area2D12" type="Area2D" parent="PowerUpControl/Control2/VSeparator/corpo"]
  275. position = Vector2( 116, -42.6667 )
  276. scale = Vector2( 1.33333, 1.33333 )
  277. collision_layer = 8
  278. collision_mask = 8
  279. script = ExtResource( 12 )
  280. id = 4
  281. [node name="CollisionShape2D" type="CollisionShape2D" parent="PowerUpControl/Control2/VSeparator/corpo/Area2D12"]
  282. position = Vector2( 32, 32 )
  283. shape = SubResource( 3 )
  284. [node name="buttons" type="Node2D" parent="PowerUpControl/Control2/VSeparator"]
  285. position = Vector2( 24, 422 )
  286. script = ExtResource( 8 )
  287. [node name="Button" type="Button" parent="PowerUpControl/Control2/VSeparator"]
  288. margin_top = 781.0
  289. margin_right = 380.0
  290. margin_bottom = 806.0
  291. text = "accept"
  292. [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="PowerUpControl"]
  293. stream = ExtResource( 16 )
  294. bus = "menu"
  295. [node name="TextureButton2" type="Sprite" parent="."]
  296. position = Vector2( -2, 0 )
  297. z_index = -255
  298. texture = ExtResource( 15 )
  299. centered = false
  300. region_enabled = true
  301. region_rect = Rect2( 0, 0, 540, 960 )
  302. script = SubResource( 11 )
  303. [node name="CanvasLayer" type="CanvasLayer" parent="."]
  304. layer = -1
  305. [node name="TextureButton" type="ColorRect" parent="CanvasLayer"]
  306. visible = false
  307. material = SubResource( 10 )
  308. anchor_right = 1.0
  309. anchor_bottom = 1.0
  310. theme = SubResource( 2 )
  311. [node name="debug" type="Label" parent="CanvasLayer"]
  312. margin_left = 22.0
  313. margin_top = 890.0
  314. margin_right = 96.0
  315. margin_bottom = 938.0
  316. text = "Fps: 60
  317. Vram: 0 mb
  318. ram: 0 mb"
  319. script = ExtResource( 14 )
  320. [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
  321. stream = ExtResource( 13 )
  322. autoplay = true
  323. [connection signal="dieproxy" from="bacteria" to="restarter" method="_on_bacteria_dieproxy"]
  324. [connection signal="level_up" from="bacteria" to="PowerUpControl" method="_on_bacteria_level_up"]
  325. [connection signal="button_down" from="restarter/MarginContainer/VBoxContainer/Button" to="restarter" method="_on_Button_button_down"]
  326. [connection signal="item_activated" from="PowerUpControl/Control/VSeparator/ItemList" to="PowerUpControl" method="_on_ItemList_item_activated"]
  327. [connection signal="item_activated" from="PowerUpControl/Control2/VSeparator/ItemList" to="PowerUpControl" method="_on_ItemList_item_activated"]
  328. [connection signal="button_down" from="PowerUpControl/Control2/VSeparator/Button" to="PowerUpControl" method="_on_Button_button_down"]
  329. [connection signal="button_down" from="PowerUpControl/Control2/VSeparator/Button" to="PowerUpControl/AudioStreamPlayer" method="play"]