diff --git a/Gameplay/Arena.cs b/Gameplay/Desk.cs similarity index 77% rename from Gameplay/Arena.cs rename to Gameplay/Desk.cs index 7386bae..0791594 100644 --- a/Gameplay/Arena.cs +++ b/Gameplay/Desk.cs @@ -1,7 +1,7 @@ using Godot; using System; -public partial class Arena : Sprite2D +public partial class Desk : Sprite2D { diff --git a/Gameplay/Arena.cs.uid b/Gameplay/Desk.cs.uid similarity index 100% rename from Gameplay/Arena.cs.uid rename to Gameplay/Desk.cs.uid diff --git a/Gameplay/Effect.cs b/Gameplay/Effect.cs index 581ef8a..25226af 100644 --- a/Gameplay/Effect.cs +++ b/Gameplay/Effect.cs @@ -4,15 +4,16 @@ using System.Collections.Generic; public partial class Effect : Node { - public List _trigger; - public Worker _workerOwner; + public List _trigger = new(); + public List _expirations = new(); + public Node2D _owner; - public void SetOwner() + public Effect(Node2D OWNER) { - + _owner = OWNER; } - public virtual void TriggerEffect() + public virtual void TriggerEffect(Node TARGET = null) { } diff --git a/Gameplay/Effects/BasicAttack.cs b/Gameplay/Effects/BasicAttack.cs index 86a3475..979dc85 100644 --- a/Gameplay/Effects/BasicAttack.cs +++ b/Gameplay/Effects/BasicAttack.cs @@ -4,17 +4,26 @@ using System.Collections.Generic; public partial class BasicAttack : Effect { - public BasicAttack() : base() + public BasicAttack(Node2D OWNER) : base(OWNER) { _trigger.Add(Trigger.Collision); } - public override void TriggerEffect() + public override void TriggerEffect(Node TARGET = null) { - if (_workerOwner._collisionTarget is Worker) + if (TARGET is Worker) { - int damage = _workerOwner._aptitude; - ((Worker)_workerOwner._collisionTarget).ChangeHealth(damage, _workerOwner); + Worker target = (Worker)TARGET; + if (_owner is Worker) + { + Worker owner = (Worker)_owner; + if (target._manager != owner._manager) + { + int damage = -owner._aptitude / 2; + target.ChangeHealth(damage, owner); + } + } + } } diff --git a/Gameplay/Effects/Caffeinate.cs b/Gameplay/Effects/Caffeinate.cs new file mode 100644 index 0000000..443337c --- /dev/null +++ b/Gameplay/Effects/Caffeinate.cs @@ -0,0 +1,22 @@ +using Godot; +using System; + +public partial class Caffeinate : Effect +{ + public Caffeinate(Node2D OWNER) : base(OWNER) + { + _trigger.Add(Trigger.Collision); + } + + public override void TriggerEffect(Node TARGET = null) + { + if (TARGET is Worker) + { + Worker target = (Worker)TARGET; + target._rotationalForce += 10; + Vector2 targetDistanceNormal = (target.Position - _owner.Position).Normalized(); + target.ApplyCentralForce(targetDistanceNormal * 10); + target.ChangeHealth(-1, _owner); + } + } +} diff --git a/Gameplay/Effects/Caffeinate.cs.uid b/Gameplay/Effects/Caffeinate.cs.uid new file mode 100644 index 0000000..e633e7c --- /dev/null +++ b/Gameplay/Effects/Caffeinate.cs.uid @@ -0,0 +1 @@ +uid://cbk76ik5o17nx diff --git a/Gameplay/Effects/Spiky.cs b/Gameplay/Effects/Spiky.cs new file mode 100644 index 0000000..e1c9411 --- /dev/null +++ b/Gameplay/Effects/Spiky.cs @@ -0,0 +1,20 @@ +using Godot; +using System; + +public partial class Spiky : Effect +{ + public Spiky(Node2D OWNER) : base(OWNER) + { + _trigger.Add(Trigger.Collision); + } + + public override void TriggerEffect(Node TARGET = null) + { + if (TARGET is Worker) + { + Worker target = (Worker)TARGET; + target._rotationalForce += 10; + target.ChangeHealth(-1, _owner); + } + } +} diff --git a/Gameplay/Effects/Spiky.cs.uid b/Gameplay/Effects/Spiky.cs.uid new file mode 100644 index 0000000..80866ae --- /dev/null +++ b/Gameplay/Effects/Spiky.cs.uid @@ -0,0 +1 @@ +uid://ciwja82k4ihw6 diff --git a/Gameplay/Effects/basic_attack.tscn b/Gameplay/Effects/basic_attack.tscn new file mode 100644 index 0000000..6b22c6e --- /dev/null +++ b/Gameplay/Effects/basic_attack.tscn @@ -0,0 +1,3 @@ +[gd_scene format=3 uid="uid://bih70e65g1108"] + +[node name="BasicAttack" type="Node"] diff --git a/Gameplay/Effects/caffeinate.tscn b/Gameplay/Effects/caffeinate.tscn new file mode 100644 index 0000000..352e439 --- /dev/null +++ b/Gameplay/Effects/caffeinate.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://bo2rj0albmkkw"] + +[ext_resource type="Script" uid="uid://cbk76ik5o17nx" path="res://Gameplay/Effects/Caffeinate.cs" id="1_2f3ha"] + +[node name="Caffeinate" type="Node"] +script = ExtResource("1_2f3ha") diff --git a/Gameplay/Effects/spiky.tscn b/Gameplay/Effects/spiky.tscn new file mode 100644 index 0000000..8c2f2b6 --- /dev/null +++ b/Gameplay/Effects/spiky.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://cchjk4lohg8k3"] + +[ext_resource type="Script" uid="uid://ciwja82k4ihw6" path="res://Gameplay/Effects/Spiky.cs" id="1_levtu"] + +[node name="Spiky" type="Node"] +script = ExtResource("1_levtu") diff --git a/Gameplay/Manager.cs b/Gameplay/Manager.cs index 2c55d8a..1f33686 100644 --- a/Gameplay/Manager.cs +++ b/Gameplay/Manager.cs @@ -28,16 +28,24 @@ public partial class Manager : Node Worker newWorker = Globals.Instance._workerScene.Instantiate(); newWorker.Position = Globals.Instance._screenCenter + new Vector2(0, 100); newWorker._id = 1; + newWorker._manager = this; AddChild(newWorker); _workers.Add(newWorker); newWorker = Globals.Instance._workerScene.Instantiate(); newWorker.Position = Globals.Instance._screenCenter - new Vector2(0, 100); newWorker._id = 2; + newWorker._manager = this; AddChild(newWorker); _workers.Add(newWorker); - Tchotchke newTchotchke = Globals.Instance._tchotchkeScene.Instantiate(); + for (int i = 0; i < _workers.Count; i++) + { + GD.Print(i + 1); + _workers[i]._healthBar.Position = _managerPanel.GetNode("Team").GetNode("T"+(i+1)).GlobalPosition; + } + + AwfullyHotCoffeePot newTchotchke = ResourceLoader.Load("res://Gameplay/Tchotchkes/awfully_hot_coffee_pot.tscn").Instantiate(); newTchotchke.Position = new Vector2(Globals.Instance._screenSize.X - 100, Globals.Instance._screenCenter.Y); AddChild(newTchotchke); _tchotckes.Add(newTchotchke); diff --git a/Gameplay/Tchotchke.cs b/Gameplay/Tchotchke.cs index 3dace6c..5520a1f 100644 --- a/Gameplay/Tchotchke.cs +++ b/Gameplay/Tchotchke.cs @@ -1,10 +1,11 @@ using Godot; using System; +using System.Collections.Generic; public partial class Tchotchke : StaticBody2D { public bool _hovered = false, _held = false; - + public List _effects = new(); public override void _Process(double DELTA_) { @@ -29,11 +30,11 @@ public partial class Tchotchke : StaticBody2D } if (Input.IsActionJustPressed("scroll_up")) { - Rotation -= 1; + Rotation -= 1.0f * (float)(Math.PI) / 180.0f; } if (Input.IsActionJustPressed("scroll_down")) { - Rotation += 1; + Rotation += 1.0f * (float)(Math.PI) / 180.0f; } } } @@ -71,12 +72,13 @@ public partial class Tchotchke : StaticBody2D private void OnBodyEntered(Node NODE) { - if (NODE is Worker) - { - // _rotationalForce *= 0.8f; - // Vector2 rotatedForce = LinearVelocity.Rotated(((Worker)NODE)._rotationalForce); - - // ApplyCentralForce(rotatedForce); - } + if (NODE is Worker) + { + for (int i = 0; i < _effects.Count; i++) + { + GD.Print(1001); + _effects[i].TriggerEffect((Worker)NODE); + } + } } } diff --git a/Gameplay/Tchotchkes/AwfullyHotCoffeePot.cs b/Gameplay/Tchotchkes/AwfullyHotCoffeePot.cs new file mode 100644 index 0000000..a24b1b4 --- /dev/null +++ b/Gameplay/Tchotchkes/AwfullyHotCoffeePot.cs @@ -0,0 +1,10 @@ +using Godot; +using System; + +public partial class AwfullyHotCoffeePot : Tchotchke +{ + public AwfullyHotCoffeePot() : base() + { + _effects.Add(new Caffeinate(this)); + } +} diff --git a/Gameplay/Tchotchkes/AwfullyHotCoffeePot.cs.uid b/Gameplay/Tchotchkes/AwfullyHotCoffeePot.cs.uid new file mode 100644 index 0000000..5f7866c --- /dev/null +++ b/Gameplay/Tchotchkes/AwfullyHotCoffeePot.cs.uid @@ -0,0 +1 @@ +uid://cs41fy2tdmox8 diff --git a/Gameplay/Tchotchkes/RedStapler.cs b/Gameplay/Tchotchkes/RedStapler.cs new file mode 100644 index 0000000..603b4d0 --- /dev/null +++ b/Gameplay/Tchotchkes/RedStapler.cs @@ -0,0 +1,7 @@ +using Godot; +using System; + +public partial class RedStapler : Tchotchke +{ + +} diff --git a/Gameplay/Tchotchkes/RedStapler.cs.uid b/Gameplay/Tchotchkes/RedStapler.cs.uid new file mode 100644 index 0000000..7d67b99 --- /dev/null +++ b/Gameplay/Tchotchkes/RedStapler.cs.uid @@ -0,0 +1 @@ +uid://suk6jbpwmu1r diff --git a/Gameplay/Tchotchkes/awfully_hot_coffee_pot.tscn b/Gameplay/Tchotchkes/awfully_hot_coffee_pot.tscn new file mode 100644 index 0000000..ca25e6f --- /dev/null +++ b/Gameplay/Tchotchkes/awfully_hot_coffee_pot.tscn @@ -0,0 +1,36 @@ +[gd_scene load_steps=5 format=3 uid="uid://cbmpor83jpggo"] + +[ext_resource type="Script" uid="uid://cs41fy2tdmox8" path="res://Gameplay/Tchotchkes/AwfullyHotCoffeePot.cs" id="2_mvvpy"] +[ext_resource type="Texture2D" uid="uid://c1tv50tj5cprl" path="res://art/coffee.png" id="3_r4u41"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_smj0g"] +radius = 32.0 + +[sub_resource type="CircleShape2D" id="CircleShape2D_yxdnl"] +radius = 32.0 + +[node name="AwfullyHotCoffeePot" type="StaticBody2D"] +input_pickable = true +script = ExtResource("2_mvvpy") + +[node name="Sprite2D" type="Sprite2D" parent="."] +scale = Vector2(0.1, 0.1) +texture = ExtResource("3_r4u41") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_smj0g") + +[node name="Gravity" type="Area2D" parent="."] +gravity_space_override = 1 +gravity_point = true +gravity_point_unit_distance = 32.0 +gravity_point_center = Vector2(0, 0) +gravity_direction = Vector2(0, 0) +gravity = 5.0 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Gravity"] +shape = SubResource("CircleShape2D_yxdnl") + +[connection signal="mouse_entered" from="." to="." method="OnMouseEntered"] +[connection signal="mouse_exited" from="." to="." method="OnMouseExited"] +[connection signal="body_entered" from="Gravity" to="." method="OnBodyEntered"] diff --git a/Gameplay/Tchotchkes/red_stapler.tscn b/Gameplay/Tchotchkes/red_stapler.tscn new file mode 100644 index 0000000..335c4fa --- /dev/null +++ b/Gameplay/Tchotchkes/red_stapler.tscn @@ -0,0 +1,35 @@ +[gd_scene load_steps=4 format=3 uid="uid://bjml4u7mieb3a"] + +[ext_resource type="Script" uid="uid://suk6jbpwmu1r" path="res://Gameplay/Tchotchkes/RedStapler.cs" id="2_1dddf"] +[ext_resource type="Texture2D" uid="uid://d332fv8lhg8na" path="res://art/redstapler.png" id="2_rllbf"] + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_1dddf"] +radius = 29.0 +height = 94.0 + +[node name="RedStapler" type="StaticBody2D"] +input_pickable = true +script = ExtResource("2_1dddf") + +[node name="Sprite2D" type="Sprite2D" parent="."] +rotation = -1.0472 +scale = Vector2(0.1, 0.1) +texture = ExtResource("2_rllbf") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CapsuleShape2D_1dddf") + +[node name="Gravity" type="Area2D" parent="."] +gravity_space_override = 1 +gravity_point = true +gravity_point_unit_distance = 32.0 +gravity_point_center = Vector2(0, 0) +gravity_direction = Vector2(0, 0) +gravity = 5.0 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Gravity"] +shape = SubResource("CapsuleShape2D_1dddf") + +[connection signal="mouse_entered" from="." to="." method="OnMouseEntered"] +[connection signal="mouse_exited" from="." to="." method="OnMouseExited"] +[connection signal="body_entered" from="Gravity" to="." method="OnBodyEntered"] diff --git a/Gameplay/Worker.cs b/Gameplay/Worker.cs index 66c5cfa..17f4116 100644 --- a/Gameplay/Worker.cs +++ b/Gameplay/Worker.cs @@ -12,6 +12,7 @@ public partial class Worker : RigidBody2D public Vector2 _force = Vector2.Zero; public Node _collisionTarget; public Sprite2D _image; + public ProgressBar _healthBar; public Manager _manager; public List _effects = new(); public override void _Ready() @@ -26,6 +27,12 @@ public partial class Worker : RigidBody2D _healthMax = _health; _image = GetNode("Sprite2D"); + + _effects.Add(new BasicAttack(this)); + + _healthBar = GetNode("HealthBar"); + _healthBar.MaxValue = _healthMax; + _healthBar.Value = _health; } public override void _Process(double DELTA_) @@ -104,11 +111,13 @@ public partial class Worker : RigidBody2D // process on knockout } _health += CHANGE; + _healthBar.Value = _health; if (_health <= 0) { + Sleeping = true; _dead = true; _health = 0; - TriggerSpecificEffects(Effect.Trigger.Death); + TriggerSpecificEffects(Effect.Trigger.Death, _manager); } } @@ -140,7 +149,7 @@ public partial class Worker : RigidBody2D ApplyCentralForce(_force); _force = Vector2.Zero; _primed = false; - TriggerSpecificEffects(Effect.Trigger.Launch); + TriggerSpecificEffects(Effect.Trigger.Launch, _manager); } public void Stop() @@ -149,16 +158,18 @@ public partial class Worker : RigidBody2D Sleeping = true; _moving = false; _rotationalForce = 0f; - TriggerSpecificEffects(Effect.Trigger.Stop); + TriggerSpecificEffects(Effect.Trigger.Stop, _manager); } - public void TriggerSpecificEffects(Effect.Trigger TRIGGER) + public void TriggerSpecificEffects(Effect.Trigger TRIGGER, Node TARGET = null) { List triggeredEffects = _effects.Where(e => e._trigger.IndexOf(TRIGGER) > -1).ToList(); for (int i = 0; i < triggeredEffects.Count; i++) { - triggeredEffects[i].TriggerEffect(); + triggeredEffects[i].TriggerEffect(TARGET); } + List expiredEffects = _effects.Where(e => e._trigger.IndexOf(TRIGGER) > -1).ToList(); + _effects.Except(expiredEffects); } // PRIVATE METHODS @@ -177,7 +188,7 @@ public partial class Worker : RigidBody2D if (NODE is Worker) { _collisionTarget = NODE; - TriggerSpecificEffects(Effect.Trigger.Stop); + TriggerSpecificEffects(Effect.Trigger.Collision, NODE); _rotationalForce *= 0.8f; Vector2 rotatedForce = LinearVelocity.Rotated(((Worker)NODE)._rotationalForce); diff --git a/Gameplay/arena.tscn b/Gameplay/arena.tscn deleted file mode 100644 index 95fd68b..0000000 --- a/Gameplay/arena.tscn +++ /dev/null @@ -1,36 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://demwh8ek37mnx"] - -[ext_resource type="Script" uid="uid://pxi753iie75t" path="res://Gameplay/Arena.cs" id="1_3it5u"] -[ext_resource type="Texture2D" uid="uid://nxo2tpgmobli" path="res://art/arena.png" id="1_ya27x"] - -[sub_resource type="CircleShape2D" id="CircleShape2D_ya27x"] -radius = 400.25 - -[node name="Arena" type="Sprite2D"] -texture = ExtResource("1_ya27x") -script = ExtResource("1_3it5u") - -[node name="StaticBody2D" type="StaticBody2D" parent="."] - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="StaticBody2D"] -visible = false -polygon = PackedVector2Array(-2, -303, 150, -302, 150, -372, 218, -336, 268, -296, 310, -254, 347, -201, 373, -146, 390, -85, 398, -33, 400, 1, 398, 30, 394, 69, 388, 99, 377, 135, 355, 184, 339, 213, 312, 250, 291, 276, 268, 298, 249, 314, 209, 341, 183, 356, 167, 364, 150, 370, 150, 301, -2, 300, -1, 791, 937, 791, 935, -974, -5, -990) - -[node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="StaticBody2D"] -visible = false -rotation = 3.14159 -scale = Vector2(1, -1) -polygon = PackedVector2Array(-2, -303, 150, -302, 150, -372, 218, -336, 268, -296, 310, -254, 347, -201, 373, -146, 390, -85, 398, -33, 400, 1, 398, 30, 394, 69, 388, 99, 377, 135, 355, 184, 339, 213, 312, 250, 291, 276, 268, 298, 249, 314, 209, 341, 183, 356, 167, 364, 150, 370, 150, 301, -2, 300, -1, 791, 937, 791, 935, -974, -5, -990) - -[node name="CollisionPolygon2D3" type="CollisionPolygon2D" parent="StaticBody2D"] -polygon = PackedVector2Array(-800, 800, -153, 800, -153, 366.8, -198.5, 344, -200.4, 344, -245.4, 312, -247.2, 312, -295.2, 266, -296, 266, -324, 230, -324.9, 230, -343.9, 199, -344.7, 199, -362.7, 162, -363.6, 162, -379.6, 117, -380.3, 117, -393.4, 55, -394.1, 55, -398, 6, -398, -5.79999, -394, -48.9, -394, -57, -380, -114.8, -380, -118.5, -363, -160.6, -363, -163.5, -349, -189.5, -349, -191.4, -324, -229.4, -324, -231.3, -295, -265.3, -295, -267.1, -246, -312.1, -246, -312.9, -199, -343.9, -199, -344.8, -152, -366.8, -152, -298, 152, -298, 152, -366.9, 189.5, -349, 191.4, -349, 208.4, -338, 210.3, -338, 257.3, -302, 259.2, -302, 295.2, -266, 296, -266, 324, -230, 324.9, -230, 343.9, -199, 344.7, -199, 365.7, -155, 366.6, -155, 382.6, -107, 383.3, -107, 393.3, -55, 394.1, -55, 397.1, -4, 397.9, -4, 396, 28.9, 396, 39.7, 391, 68.8, 391, 75, 375, 130.7, 375, 133.6, 363, 160.6, 363, 163.3, 344, 198.5, 344, 200.3, 312, 245.4, 312, 247.2, 266, 295.2, 266, 296, 230, 324, 230, 324.9, 190, 348.9, 190, 349.7, 153.8, 365.9, 151.9, 298, -152, 298, -152, 800, 800, 800, 800, -800, -800, -800) - -[node name="Area2D" type="Area2D" parent="."] -gravity_space_override = 1 -gravity_point = true -gravity_point_center = Vector2(0, 0) -gravity_direction = Vector2(0, 0) -gravity = 100.0 - -[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] -shape = SubResource("CircleShape2D_ya27x") diff --git a/Gameplay/battle.tscn b/Gameplay/battle.tscn index 8bc4b56..9e1a229 100644 --- a/Gameplay/battle.tscn +++ b/Gameplay/battle.tscn @@ -1,9 +1,11 @@ [gd_scene load_steps=3 format=3 uid="uid://5ymxo45j4ryt"] [ext_resource type="Script" uid="uid://0c1u4l8lu07h" path="res://Gameplay/Battle.cs" id="1_i431l"] -[ext_resource type="PackedScene" uid="uid://demwh8ek37mnx" path="res://Gameplay/arena.tscn" id="2_fkh6t"] +[ext_resource type="PackedScene" uid="uid://demwh8ek37mnx" path="res://Gameplay/desk.tscn" id="2_fkh6t"] [node name="Battle" type="Node" groups=["battles"]] script = ExtResource("1_i431l") -[node name="Arena" parent="." instance=ExtResource("2_fkh6t")] +[node name="Desk" parent="." instance=ExtResource("2_fkh6t")] +position = Vector2(960, 540) +rotation = 1.5708 diff --git a/Gameplay/desk.tscn b/Gameplay/desk.tscn new file mode 100644 index 0000000..f0219cc --- /dev/null +++ b/Gameplay/desk.tscn @@ -0,0 +1,30 @@ +[gd_scene load_steps=4 format=3 uid="uid://demwh8ek37mnx"] + +[ext_resource type="Texture2D" uid="uid://w4cxyhjvmkq1" path="res://art/desk.png" id="1_21bwm"] +[ext_resource type="Script" uid="uid://pxi753iie75t" path="res://Gameplay/Desk.cs" id="2_15p4t"] + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_fw0uc"] +radius = 88.5 +height = 566.0 + +[node name="Desk" type="Sprite2D"] +scale = Vector2(2, 2) +texture = ExtResource("1_21bwm") +script = ExtResource("2_15p4t") + +[node name="StaticBody2D" type="StaticBody2D" parent="."] + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="StaticBody2D"] +polygon = PackedVector2Array(34.5, -87.5, 60.5, -87.5, 131.5, -87, 245, -78.5, 251, -77, 265, -55.5, 273, -16, 272.5, 0.5, 269.5, 31, 264, 58, 251, 76, 220.5, 81.5, 144, 85, 54, 87, 0, 87, -88.5, 85, -167, 84.5, -246, 77.5, -260, 62.5, -271.5, 22.5, -272, -0.5, -271.5, -25.5, -266, -47, -257, -70.5, -248, -79, -186.5, -84, -105, -87, -17.5, -87.5, 34.5, -87.5, 35, -335, -418.5, -337, -421, 448, 439, 445, 438.5, -357.5, 35, -334.5) + +[node name="Gravity" type="Area2D" parent="."] +visible = false +gravity_space_override = 1 +gravity_point = true +gravity_point_center = Vector2(0, 0) +gravity_direction = Vector2(0, 0) +gravity = 100.0 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Gravity"] +rotation = 1.5708 +shape = SubResource("CapsuleShape2D_fw0uc") diff --git a/Gameplay/effect.tscn b/Gameplay/effect.tscn index ed1563d..fa3a0f9 100644 --- a/Gameplay/effect.tscn +++ b/Gameplay/effect.tscn @@ -1,3 +1,3 @@ -[gd_scene load_steps=0 format=3 uid="uid://bp2xesqosn4fk"] +[gd_scene format=3 uid="uid://becqya8l8feni"] [node name="ProcessEffect" type="Node"] diff --git a/Gameplay/tchotchke.tscn b/Gameplay/tchotchke.tscn index ac08c2c..53a7a3d 100644 --- a/Gameplay/tchotchke.tscn +++ b/Gameplay/tchotchke.tscn @@ -3,11 +3,11 @@ [ext_resource type="Script" uid="uid://qmgo5eukvn6y" path="res://Gameplay/Tchotchke.cs" id="1_c08fi"] [ext_resource type="Texture2D" uid="uid://c1tv50tj5cprl" path="res://art/coffee.png" id="2_gl5mj"] -[sub_resource type="CircleShape2D" id="CircleShape2D_d82wc"] -radius = 31.1448 - [sub_resource type="CircleShape2D" id="CircleShape2D_gl5mj"] -radius = 65.0 +radius = 32.0 + +[sub_resource type="CircleShape2D" id="CircleShape2D_d82wc"] +radius = 32.0 [node name="Tchotchke" type="StaticBody2D"] input_pickable = true @@ -18,17 +18,19 @@ scale = Vector2(0.1, 0.1) texture = ExtResource("2_gl5mj") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -shape = SubResource("CircleShape2D_d82wc") +shape = SubResource("CircleShape2D_gl5mj") -[node name="Area2D" type="Area2D" parent="."] +[node name="Gravity" type="Area2D" parent="."] gravity_space_override = 1 gravity_point = true +gravity_point_unit_distance = 32.0 gravity_point_center = Vector2(0, 0) gravity_direction = Vector2(0, 0) -gravity = 50.0 +gravity = 5.0 -[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] -shape = SubResource("CircleShape2D_gl5mj") +[node name="CollisionShape2D" type="CollisionShape2D" parent="Gravity"] +shape = SubResource("CircleShape2D_d82wc") [connection signal="mouse_entered" from="." to="." method="OnMouseEntered"] [connection signal="mouse_exited" from="." to="." method="OnMouseExited"] +[connection signal="body_entered" from="Gravity" to="." method="OnBodyEntered"] diff --git a/Gameplay/worker.tscn b/Gameplay/worker.tscn index efd518c..f6f39fa 100644 --- a/Gameplay/worker.tscn +++ b/Gameplay/worker.tscn @@ -9,7 +9,7 @@ bounce = 3.0 load_path = "res://.godot/imported/beyblade.png-cd6ee3474fe554271afbb31b55fadfb5.ctex" [sub_resource type="CircleShape2D" id="CircleShape2D_e314i"] -radius = 80.0 +radius = 32.0 [node name="Worker" type="RigidBody2D"] input_pickable = true @@ -23,6 +23,12 @@ max_contacts_reported = 1 linear_damp = 0.25 script = ExtResource("1_e314i") +[node name="HealthBar" type="ProgressBar" parent="."] +top_level = true +offset_right = 150.0 +offset_bottom = 27.0 +step = 1.0 + [node name="Sprite2D" type="Sprite2D" parent="."] scale = Vector2(0.2, 0.2) texture = SubResource("CompressedTexture2D_e314i") @@ -31,14 +37,15 @@ texture = SubResource("CompressedTexture2D_e314i") scale = Vector2(0.2, 0.2) polygon = PackedVector2Array(8, -171, -17, -171, -17, -169.9, -26.2, -169, -29.5, -169, -62, -151.2, -84, -152.9, -84, -154.4, -102.4, -151, -104.7, -151, -150.8, -114, -153, -114, -174, -88, -175.3, -88, -180, -77.7, -180, 44.2, -178, 46.7, -178, 48.3, -163.5, 54.9, -155, 81.2, -155, 83.9, -135.8, 102, -134.9, 102, -114, 126.7, -114, 128.2, -97.5, 137, -96.1, 137, -92, 143.6, -92, 146, -82, 152.9, -82, 154.5, -34, 167.4, -34, 168.7, -18.1, 171, 31.2, 171, 49.4, 167, 52.7, 167, 68, 155, 68, 154.2, 110.5, 134, 112.7, 134, 137.7, 114, 139.7, 114, 142, 98.1, 142, 92.9, 156.9, 79, 158.4, 79, 171.4, 45, 173.1, 45, 172, 22.9, 172, 13.6, 180, 1.10001, 180, -65.5, 159, -106.6, 159, -108.7, 134, -140.7, 134, -142.3, 121.4, -148, 112.5, -148, 101.4, -142, 97.3, -142, 75, -151.3, 75, -152.5, 50.3, -159, 47.5, -159, 39, -164.1, 39, -165.8, 8, -169.8) -[node name="Area2D" type="Area2D" parent="."] +[node name="Gravity" type="Area2D" parent="."] gravity_space_override = 1 gravity_point = true +gravity_point_unit_distance = 32.0 gravity_point_center = Vector2(0, 0) gravity_direction = Vector2(0, 0) -gravity = 50.0 +gravity = 5.0 -[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] +[node name="CollisionShape2D" type="CollisionShape2D" parent="Gravity"] shape = SubResource("CircleShape2D_e314i") [connection signal="body_entered" from="." to="." method="OnBodyEntered"] diff --git a/art/desk.png b/art/desk.png new file mode 100644 index 0000000..7de9345 Binary files /dev/null and b/art/desk.png differ diff --git a/art/desk.png.import b/art/desk.png.import new file mode 100644 index 0000000..6997434 --- /dev/null +++ b/art/desk.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://w4cxyhjvmkq1" +path="res://.godot/imported/desk.png-5ab472c6092f11b3c07bcef1a7548dfb.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/desk.png" +dest_files=["res://.godot/imported/desk.png-5ab472c6092f11b3c07bcef1a7548dfb.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/art/redstapler.png b/art/redstapler.png new file mode 100644 index 0000000..5f1a358 Binary files /dev/null and b/art/redstapler.png differ diff --git a/art/redstapler.png.import b/art/redstapler.png.import new file mode 100644 index 0000000..ee26461 --- /dev/null +++ b/art/redstapler.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d332fv8lhg8na" +path="res://.godot/imported/redstapler.png-a427de8096ab80a30847aa6d8dd1d302.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/redstapler.png" +dest_files=["res://.godot/imported/redstapler.png-a427de8096ab80a30847aa6d8dd1d302.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