diff --git a/MainMenu.gd b/MainMenu.gd index 0fd0765..4241b1b 100644 --- a/MainMenu.gd +++ b/MainMenu.gd @@ -38,6 +38,6 @@ func play(): var tip = pick(tip_options) $LoadingScreen/Tip.text = "Tip: %s" % tip - await get_tree().create_timer(0.4).timeout + await get_tree().create_timer(0.8).timeout var game = ResourceLoader.load_threaded_get(MAIN_SCENE_PATH) get_tree().change_scene_to_packed(game) diff --git a/RechargeProgress.gd b/RechargeProgress.gd new file mode 100644 index 0000000..cecfd70 --- /dev/null +++ b/RechargeProgress.gd @@ -0,0 +1,19 @@ +extends TextureProgressBar + +var animating = false + +func start_countdown(time: float): + animating = true + value = 100 + var tween = get_tree().create_tween() + tween.tween_property(self, "value", 0, time) + await tween.finished + animating = false + +func start_countup(time: float): + animating = true + value = 0 + var tween = get_tree().create_tween() + tween.tween_property(self, "value", 100, time) + await tween.finished + animating = false diff --git a/laser-ability.tscn b/laser-ability.tscn new file mode 100644 index 0000000..c0d5181 --- /dev/null +++ b/laser-ability.tscn @@ -0,0 +1,11 @@ +[gd_scene load_steps=3 format=3 uid="uid://1ex46dwbqgdn"] + +[ext_resource type="PackedScene" uid="uid://d2xigwib6hka4" path="res://quare_ability.tscn" id="1_k107v"] +[ext_resource type="Texture2D" uid="uid://dtipytdgtqr88" path="res://laser-icon.png" id="2_wo0et"] + +[node name="Laser" instance=ExtResource("1_k107v")] +stretch_margin_left = 0 +stretch_margin_top = 0 +stretch_margin_right = 0 +stretch_margin_bottom = 0 +texture_under = ExtResource("2_wo0et") diff --git a/laser-icon.png b/laser-icon.png new file mode 100644 index 0000000..3c004a2 Binary files /dev/null and b/laser-icon.png differ diff --git a/laser-icon.png.import b/laser-icon.png.import new file mode 100644 index 0000000..50cc91c --- /dev/null +++ b/laser-icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dtipytdgtqr88" +path="res://.godot/imported/laser-icon.png-6bdd4bc5f082cbdfbba8375dfc35129b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://laser-icon.png" +dest_files=["res://.godot/imported/laser-icon.png-6bdd4bc5f082cbdfbba8375dfc35129b.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/main.tscn b/main.tscn index 860ed1f..5bac9d7 100644 --- a/main.tscn +++ b/main.tscn @@ -750,22 +750,6 @@ theme_override_fonts/font = ExtResource("11_s4q6p") theme_override_font_sizes/font_size = 50 text = "wave 1" -[node name="Quare Count" type="Label" parent="UI"] -layout_mode = 1 -anchors_preset = 2 -anchor_top = 1.0 -anchor_bottom = 1.0 -offset_left = 44.0 -offset_top = -175.0 -offset_right = 279.0 -offset_bottom = -38.0 -grow_vertical = 0 -theme_override_constants/line_spacing = 0 -theme_override_fonts/font = ExtResource("11_s4q6p") -theme_override_font_sizes/font_size = 50 -text = "Gun" -vertical_alignment = 2 - [node name="Stopwatch" type="Label" parent="UI"] layout_mode = 1 anchors_preset = 1 @@ -782,6 +766,18 @@ horizontal_alignment = 2 justification_flags = 160 script = ExtResource("13_xhnp2") +[node name="Ability" type="HBoxContainer" parent="UI"] +unique_name_in_owner = true +layout_mode = 1 +anchors_preset = 2 +anchor_top = 1.0 +anchor_bottom = 1.0 +offset_left = 14.0 +offset_top = -51.0 +offset_right = 54.0 +offset_bottom = -11.0 +grow_vertical = 0 + [node name="GameOver" type="Label" parent="."] process_mode = 3 visible = false @@ -915,6 +911,7 @@ process_mode = 3 script = ExtResource("1_k8sg3") [node name="Music" type="AudioStreamPlayer2D" parent="."] +position = Vector2(-13, 29) stream = ExtResource("21_7hdkm") autoplay = true diff --git a/player-apezoid.gd b/player-apezoid.gd index e175ec2..0432f07 100644 --- a/player-apezoid.gd +++ b/player-apezoid.gd @@ -9,6 +9,7 @@ var active_texture = preload("res://laser_idle.png") func _ready(): update_animation() + $"../".get_node("%Ability").add_child(preload("res://laser-ability.tscn").instantiate()) if config.load("user://settings.cfg") == OK: absolute_movement = not config.get_value("config", "relative_controls") speed = 750 @@ -36,6 +37,7 @@ func _process(delta): func fire_laser(): var tween = get_tree().create_tween() speed = 0 + $"../".get_node("%Ability/Laser").start_countup(1) $Body.play("shoot") tween.set_parallel(true) tween.tween_callback(set_laser_texture.bind(aiming_texture)) @@ -48,6 +50,7 @@ func fire_laser(): tween.tween_property(self, "can_damage", false, 0) tween.tween_callback(set_laser_texture.bind(aiming_texture)) tween.set_parallel(true) + tween.tween_callback($"../".get_node("%Ability/Laser").start_countdown.bind(0.2)) tween.tween_property($Laser, "modulate", Color(Color.WHITE, 0.2), 0.2).set_ease(Tween.EASE_OUT) tween.set_parallel(false) tween.tween_callback(set_laser_texture.bind(idle_texture)) diff --git a/player-iamond.gd b/player-iamond.gd index 046000f..531da0a 100644 --- a/player-iamond.gd +++ b/player-iamond.gd @@ -1,18 +1,25 @@ extends "res://player.gd" +var can_jump = true + func _ready(): speed = 1200 + $"../".get_node("%Ability").add_child(preload("res://portal-ability.tscn").instantiate()) update_animation() if config.load("user://settings.cfg") == OK: absolute_movement = not config.get_value("config", "relative_controls") func _input(event): - if event.is_action_pressed("jump"): + if event.is_action_pressed("jump") and can_jump: + can_jump = false + $"../".get_node("%Ability/Portal").start_countup(0.5) $Sprite.speed_scale = 1 $Sprite.play("jump") await $Sprite.animation_finished + $"../".get_node("%Ability/Portal").start_countdown(0.5) global_position = get_global_mouse_position() $Sprite.speed_scale = -1 $Sprite.play("jump") await $Sprite.animation_finished $Sprite.play("idle") + can_jump = true diff --git a/player-iamond.tscn b/player-iamond.tscn index 1fbf942..a5c6e69 100644 --- a/player-iamond.tscn +++ b/player-iamond.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=30 format=3 uid="uid://c4ii0wvj20qe4"] +[gd_scene load_steps=31 format=3 uid="uid://c4ii0wvj20qe4"] [ext_resource type="PackedScene" uid="uid://cgcjicue76wsr" path="res://player.tscn" id="1_l701f"] [ext_resource type="Script" path="res://player-iamond.gd" id="2_5t06e"] @@ -176,6 +176,9 @@ animations = [{ [sub_resource type="Gradient" id="Gradient_urfxb"] colors = PackedColorArray(1, 0.9, 0, 1, 1, 0.9, 0, 0) +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_lcrvh"] +height = 52.0 + [node name="Player" instance=ExtResource("1_l701f")] linear_damp = 2.0 script = ExtResource("2_5t06e") @@ -183,17 +186,19 @@ script = ExtResource("2_5t06e") [node name="Sprite" type="AnimatedSprite2D" parent="." index="1"] scale = Vector2(2, 2) sprite_frames = SubResource("SpriteFrames_7i6wq") -animation = &"idle" +animation = &"jump" autoplay = "idle" speed_scale = -1.0 -[node name="Hitbox" type="CollisionPolygon2D" parent="." index="2"] -position = Vector2(12, 0) -polygon = PackedVector2Array(33, 0, 5, -14, -21, 0, 5, 14) - -[node name="CPUParticles2D" type="CPUParticles2D" parent="." index="3"] -position = Vector2(-23, 0) +[node name="CPUParticles2D" type="CPUParticles2D" parent="." index="2"] +z_index = -2 +position = Vector2(-9, 0) amount = 80 texture = ExtResource("5_fmfr6") gravity = Vector2(2.08165e-12, 2.08165e-12) color_ramp = SubResource("Gradient_urfxb") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="3"] +position = Vector2(19, 0) +rotation = -1.5708 +shape = SubResource("CapsuleShape2D_lcrvh") diff --git a/player-row.gd b/player-row.gd index 264f189..552b047 100644 --- a/player-row.gd +++ b/player-row.gd @@ -1,5 +1,11 @@ extends "res://player.gd" +var num_quares = 0 +var max_quares = 3 +var exagons = 0 + +var quare_ability = preload("res://quare_ability.tscn") + func update_animation(): if moving: $AnimatedSprite2D.play("moving") @@ -7,7 +13,8 @@ func update_animation(): $AnimatedSprite2D.play("idle") func _ready(): - update_display() + for i in range(max_quares): + $"../".get_node("%Ability").add_child(quare_ability.instantiate()) update_animation() if config.load("user://settings.cfg") == OK: absolute_movement = not config.get_value("config", "relative_controls") @@ -17,7 +24,10 @@ func _input(event): if num_quares >= max_quares: notifier.notify("All Quares in Use!") return - + for child in $"../".get_node("%Ability").get_children(): + if child.value == 0 and not child.animating: + child.value = 100 + break if not $"../CollisionCheck".is_clear(get_global_mouse_position(), 60): $"../CollisionCheck".flash() notifier.notify("Too Close!") @@ -27,7 +37,6 @@ func _input(event): new_quare.position = get_global_mouse_position() $/root/Node2D.add_child(new_quare) new_quare.name = "Quare" - update_display() if event.is_action_pressed("exagon"): if exagons > 1: exagons = 1 @@ -44,25 +53,19 @@ func _input(event): new_exagon.position = get_global_mouse_position() $/root/Node2D.add_child(new_exagon) new_exagon.name = "Exagon" - update_display() #$Gun.shoot() func aquire_quare(): + for child in $"../".get_node("%Ability").get_children(): + if child.value == 100 and not child.animating: + child.start_countdown(3) + break await get_tree().create_timer(3).timeout num_quares -= 1 $QuareFX.play() - update_display() func aquire_exagon(): await get_tree().create_timer(15).timeout exagons += 1 $ExagonFX.play() - update_display() - -func update_display(): - $"/root/Node2D/UI/Quare Count".text = "%d Quares\n" % [(max_quares - num_quares)] - -var num_quares = 0 -var max_quares = 3 -var exagons = 0 diff --git a/portal-ability.tscn b/portal-ability.tscn new file mode 100644 index 0000000..4ef1bd4 --- /dev/null +++ b/portal-ability.tscn @@ -0,0 +1,7 @@ +[gd_scene load_steps=3 format=3 uid="uid://bl3178jc8lq1x"] + +[ext_resource type="PackedScene" uid="uid://d2xigwib6hka4" path="res://quare_ability.tscn" id="1_ttx3n"] +[ext_resource type="Texture2D" uid="uid://dgd2mofq75e01" path="res://portal-icon.png" id="2_2epev"] + +[node name="Portal" instance=ExtResource("1_ttx3n")] +texture_under = ExtResource("2_2epev") diff --git a/portal-icon.png b/portal-icon.png new file mode 100644 index 0000000..3db8fc3 Binary files /dev/null and b/portal-icon.png differ diff --git a/portal-icon.png.import b/portal-icon.png.import new file mode 100644 index 0000000..e13d9c7 --- /dev/null +++ b/portal-icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dgd2mofq75e01" +path="res://.godot/imported/portal-icon.png-3b1ae569eea6160c02da833f62fdd212.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://portal-icon.png" +dest_files=["res://.godot/imported/portal-icon.png-3b1ae569eea6160c02da833f62fdd212.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/quare_ability.tscn b/quare_ability.tscn new file mode 100644 index 0000000..54dfc7a --- /dev/null +++ b/quare_ability.tscn @@ -0,0 +1,24 @@ +[gd_scene load_steps=5 format=3 uid="uid://d2xigwib6hka4"] + +[ext_resource type="Texture2D" uid="uid://ba2tcipuc8rdi" path="res://quare 2.png" id="1_thx02"] +[ext_resource type="Texture2D" uid="uid://barlie6sierj" path="res://square.png" id="2_odtey"] +[ext_resource type="Script" path="res://RechargeProgress.gd" id="3_gufwx"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_lvo18"] +atlas = ExtResource("1_thx02") +region = Rect2(2.08165e-12, 2.08165e-12, 64, 64) + +[node name="Quare" type="TextureProgressBar"] +custom_minimum_size = Vector2(64, 64) +step = 0.1 +fill_mode = 5 +nine_patch_stretch = true +stretch_margin_left = 2 +stretch_margin_top = 2 +stretch_margin_right = 2 +stretch_margin_bottom = 2 +texture_under = SubResource("AtlasTexture_lvo18") +texture_progress = ExtResource("2_odtey") +texture_progress_offset = Vector2(2.08165e-12, 2.08165e-12) +tint_progress = Color(0, 0, 0, 0.443137) +script = ExtResource("3_gufwx") diff --git a/square.png b/square.png new file mode 100644 index 0000000..b1502d1 Binary files /dev/null and b/square.png differ diff --git a/square.png.import b/square.png.import new file mode 100644 index 0000000..cb4e023 --- /dev/null +++ b/square.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://barlie6sierj" +path="res://.godot/imported/square.png-51b8b31f216285d75f625619e7157806.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://square.png" +dest_files=["res://.godot/imported/square.png-51b8b31f216285d75f625619e7157806.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