From f351f0ade9823f4a14049dd9893297d3de5484c9 Mon Sep 17 00:00:00 2001 From: cojoedmo Date: Mon, 21 Jul 2025 03:17:09 -0400 Subject: [PATCH] 7-21-25 @ 3:17 am --- Gameplay/Actor.cs | 248 +++++++++++++++++------------------- Gameplay/ActorPanel.cs | 4 +- Gameplay/Ball.cs | 16 +-- Gameplay/Battle.cs | 17 +-- Gameplay/CueBall.cs | 19 +++ Gameplay/CueBall.cs.uid | 1 + Gameplay/Globals.cs | 5 +- Gameplay/Player.cs | 10 +- Gameplay/SupportBall.cs | 18 +++ Gameplay/SupportBall.cs.uid | 1 + Gameplay/actor_panel.tscn | 124 +++++++++++++++++- Gameplay/cue_ball.tscn | 38 ++++++ Gameplay/support_ball.tscn | 38 ++++++ 13 files changed, 375 insertions(+), 164 deletions(-) create mode 100644 Gameplay/CueBall.cs create mode 100644 Gameplay/CueBall.cs.uid create mode 100644 Gameplay/SupportBall.cs create mode 100644 Gameplay/SupportBall.cs.uid create mode 100644 Gameplay/cue_ball.tscn create mode 100644 Gameplay/support_ball.tscn diff --git a/Gameplay/Actor.cs b/Gameplay/Actor.cs index 0c785f8..f0d5c04 100644 --- a/Gameplay/Actor.cs +++ b/Gameplay/Actor.cs @@ -5,13 +5,11 @@ using System.Linq; public partial class Actor : Node2D { - public bool _available = false, _hovered = false, _selected = false; + public bool _available = false, _hovered = false; public int _health, _healthMax; public CollisionShape2D _startArea; - public List _cues = new(); - public Cue _selectedCue = null; + public Cue _cue = null; public List _balls = new(); - public List _ballBag = new(); public Ball _hoveredBall = null; public Ball _selectedBall = null; public Ball _heldBall = null; @@ -26,20 +24,22 @@ public partial class Actor : Node2D newActor.GetNode("Sprite").Texture = GD.Load("res://art/ness.png"); - Ball newBall = Ball._Create(0); - newActor._balls.Add(newBall); - newBall = Ball._Create(0); - newActor._balls.Add(newBall); + CueBall newCueBall = CueBall._Create(); + newActor._balls.Add(newCueBall); + + newCueBall = CueBall._Create(); + newActor._balls.Add(newCueBall); + + for (int i = 0; i < 7; i++) + { + SupportBall newBall = SupportBall._Create(i+1); + newActor._balls.Add(newBall); + } Cue newCue = Cue._Create(); newActor.AddChild(newCue); - newActor._cues.Add(newCue); - for (int i = 0; i < newActor._cues.Count; i++) - { - newActor._cues[i].Shoot += newActor.OnCueShoot; - } - - newActor._ballBag = new(newActor._balls); + newActor._cue = newCue; + newActor._cue.Shoot += newActor.OnCueShoot; newActor._health = 10; newActor._healthMax = newActor._health; @@ -53,132 +53,118 @@ public partial class Actor : Node2D public override void _Process(double DELTA_) { - if (_panel._hovered) - { - if (Input.IsActionJustReleased("left_click")) - { - _selected = true; - } - } - if (_ballBag.Count > 0 && _selected) - { - if (_heldBall == null) - { - _heldBall = _ballBag[0]; - } - else if (Input.IsActionJustPressed("scroll_up")) - { - _heldBall = _ballBag[(_ballBag.IndexOf(_heldBall) + 1) % _ballBag.Count]; - } - else if (Input.IsActionJustPressed("scroll_down")) - { - _heldBall = _ballBag[(_ballBag.IndexOf(_heldBall) - 1) < 0 ? ^1 : (_ballBag.IndexOf(_heldBall) - 1)]; - } + // if (_balls.Any(b => !b._placed)) + // { - Vector2 mousePosition = GetViewport().GetMousePosition(); - if (_tempBallSprite.Texture == null) - { - if (GetChildren().All(n => n != _tempBallSprite)) - { - AddChild(_tempBallSprite); - } - _tempBallSprite.Texture = _heldBall.GetNode("Image").Texture; - _tempBallSprite.ZIndex = 1; - } - if (_startArea == null) - { - _startArea = Globals.Instance._currentBattle.GetNode("Table").GetNode("PlayerStartArea").GetNode("CollisionShape2D"); - } + + // Vector2 mousePosition = GetViewport().GetMousePosition(); + // if (_tempBallSprite.Texture == null) + // { + // if (GetChildren().All(n => n != _tempBallSprite)) + // { + // AddChild(_tempBallSprite); + // } + // _tempBallSprite.Texture = _heldBall.GetNode("Image").Texture; + // _tempBallSprite.ZIndex = 1; + // } + // if (_startArea == null) + // { + // _startArea = Globals.Instance._currentBattle.GetNode
("Table").GetNode("PlayerStartArea").GetNode("CollisionShape2D"); + // } - _tempBallSprite.Position = mousePosition; - if (_tempBallSprite.Position.X >= _startArea.GlobalPosition.X - ((RectangleShape2D)(_startArea.Shape)).Size.X / 2 && _tempBallSprite.Position.X <= _startArea.GlobalPosition.X + ((RectangleShape2D)(_startArea.Shape)).Size.X / 2 && _tempBallSprite.Position.Y >= _startArea.GlobalPosition.Y - ((RectangleShape2D)(_startArea.Shape)).Size.Y / 2 && _tempBallSprite.Position.Y <= _startArea.GlobalPosition.Y + ((RectangleShape2D)(_startArea.Shape)).Size.Y / 2) - { - if (Input.IsActionJustReleased("left_click")) - { - _heldBall.Place(_tempBallSprite.Position); - int ballIndex = _ballBag.IndexOf(_heldBall); + // _tempBallSprite.Position = mousePosition; + // if (_tempBallSprite.Position.X >= _startArea.GlobalPosition.X - ((RectangleShape2D)(_startArea.Shape)).Size.X / 2 && _tempBallSprite.Position.X <= _startArea.GlobalPosition.X + ((RectangleShape2D)(_startArea.Shape)).Size.X / 2 && _tempBallSprite.Position.Y >= _startArea.GlobalPosition.Y - ((RectangleShape2D)(_startArea.Shape)).Size.Y / 2 && _tempBallSprite.Position.Y <= _startArea.GlobalPosition.Y + ((RectangleShape2D)(_startArea.Shape)).Size.Y / 2) + // { + // if (Input.IsActionJustReleased("left_click")) + // { + // _heldBall.Place(_tempBallSprite.Position); + // int ballIndex = _ballReturn.IndexOf(_heldBall); - AddChild(_heldBall); + // AddChild(_heldBall); - _ballBag.Remove(_heldBall); - _tempBallSprite.Texture = null; - if (_ballBag.Count > 0) - { - _heldBall = _ballBag[ballIndex - (ballIndex > _ballBag.Count ? 1 : 0)]; - } - else - { - _heldBall = null; - } - } - } - } - else - { - for (int i = 0; i < _balls.Count; i++) - { - if (_balls[i]._potted) - { - _balls[i]._potted = false; - _balls[i].Sleeping = true; - _ballBag.Add(_balls[i]); - RemoveChild(_balls[i]); + // _ballReturn.Remove(_heldBall); + // _tempBallSprite.Texture = null; + // if (_ballReturn.Count > 0) + // { + // _heldBall = _ballReturn[ballIndex - (ballIndex > _ballReturn.Count ? 1 : 0)]; + // } + // else + // { + // _heldBall = null; + // } + // } + // } + // } + // else + // { + // for (int i = 0; i < _balls.Count; i++) + // { + // if (_balls[i]._potted) + // { + // _balls[i]._potted = false; + // _balls[i].Sleeping = true; + // _ballReturn.Add(_balls[i]); + // RemoveChild(_balls[i]); - } - } - if (_balls.Any(b => b._hovered)) - { - _hoveredBall = _balls.Single(b => b._hovered); - } - else - { - _hoveredBall = null; - } + // } + // } + // if (_balls.Any(b => b._hovered)) + // { + // _hoveredBall = _balls.Single(b => b._hovered); + // } + // else + // { + // _hoveredBall = null; + // } - if (_selectedCue == null && _cues.Count > 0) - { - _selectedCue = _cues[0]; - } - if ((_selectedBall == null || _selectedBall != _hoveredBall) && (_hoveredBall?._available ?? false)) - { - if (Input.IsActionJustReleased("left_click")) - { - _selectedBall = _hoveredBall; - _selectedBall._selected = true; - _selectedCue.Don(_selectedBall); - } - } - else if (Input.IsActionJustReleased("right_click")) - { - _selectedBall._selected = false; - _selectedBall = null; - _selectedCue.Doff(); - } - else if (_hoveredBall == null) - { - if (Input.IsActionJustReleased("left_click") && _selectedBall != null && _selectedCue._power == 0) - { - _selectedBall._selected = false; - _selectedBall = null; - _selectedCue.Doff(); - } - } - } + // if ((_selectedBall == null || _selectedBall != _hoveredBall) && (_hoveredBall?._available ?? false)) + // { + // if (Input.IsActionJustReleased("left_click")) + // { + // _selectedBall = _hoveredBall; + // _selectedBall._selected = true; + // _cue.Don(_selectedBall); + // } + // } + // else if (Input.IsActionJustReleased("right_click")) + // { + // _selectedBall._selected = false; + // _selectedBall = null; + // _cue.Doff(); + // } + // else if (_hoveredBall == null) + // { + // if (Input.IsActionJustReleased("left_click") && _selectedBall != null && _cue._power == 0) + // { + // _selectedBall._selected = false; + // _selectedBall = null; + // _cue.Doff(); + // } + // } + // } } - //public void ResetCueBall() - //{ - //_cueBall = Ball._Create("ball", 0, _startPosition); - //_cueBall.SetName("CueBall"); - //AddChild(_cueBall); - //Texture2D image = GD.Load("res://art/cue_ball.png"); - //_cueBall.GetNode("Image").Texture = image; - //_cueBall._placed = true; - //_balls = GetTree().GetNodesInGroup("balls").Select(b => (Ball)b).ToList(); - //} + + + public void Start() + { + Panel ballReturn = _panel.GetNode("BallReturn"); + GD.Print(ballReturn.Position); + GD.Print(ballReturn.GlobalPosition); + + for (int i = 0; i < _balls.Count; i++) + { + _balls[i].GetNode("Bounds").Disabled = true; + _balls[i].Position = new Vector2(ballReturn.Size.X/2, 50 * (i + 1)); + + _panel.GetNode("BallReturn").AddChild(_balls[i]); + GD.Print(_balls[i].Position); + + } + } @@ -189,7 +175,7 @@ public partial class Actor : Node2D _selectedBall.ApplyCentralImpulse(IMPULSE); _selectedBall._selected = false; _selectedBall = null; - _selectedCue.Doff(); + _cue.Doff(); } } } diff --git a/Gameplay/ActorPanel.cs b/Gameplay/ActorPanel.cs index 1a8f4da..eaf0c80 100644 --- a/Gameplay/ActorPanel.cs +++ b/Gameplay/ActorPanel.cs @@ -14,7 +14,7 @@ public partial class ActorPanel : Panel newActorPanel.SetSprite(newActorPanel._actor.GetNode("Sprite").Texture); newActorPanel.SetMax(newActorPanel._actor._healthMax); newActorPanel.SetValue(newActorPanel._actor._health); - newActorPanel.SetPosition(new Vector2(50, 300)); + newActorPanel.SetPosition(new Vector2(50, 50)); return newActorPanel; } @@ -41,12 +41,10 @@ public partial class ActorPanel : Panel private void OnMouseEntered() { _hovered = true; - GD.Print(_hovered); } private void OnMouseExited() { _hovered = false; - GD.Print(_hovered); } } diff --git a/Gameplay/Ball.cs b/Gameplay/Ball.cs index 63950f5..6d266dd 100644 --- a/Gameplay/Ball.cs +++ b/Gameplay/Ball.cs @@ -8,23 +8,11 @@ public partial class Ball : RigidBody2D public int _defense, _defenseMax; public float _moveThreshold = 5.0f; - public static Ball _Create(int NUMBER) + public static Ball _Create() { PackedScene scene = ResourceLoader.Load("res://Gameplay/ball.tscn"); Ball newBall = scene.Instantiate(); - string fileName; - if (NUMBER == 0) - { - fileName = "res://art/cue_ball.png"; - newBall._isCue = true; - } - else - { - fileName = "res://art/ball_" + NUMBER + ".png"; - newBall._isCue = false; ; - } - Texture2D image = GD.Load(fileName); - newBall.GetNode("Image").Texture = image; + return newBall; } diff --git a/Gameplay/Battle.cs b/Gameplay/Battle.cs index 623fa22..ee4f5c1 100644 --- a/Gameplay/Battle.cs +++ b/Gameplay/Battle.cs @@ -62,7 +62,7 @@ public partial class Battle : Node for (int j = 0; j <= columns; j++) { Vector2 position = new Vector2(table.GlobalPosition.X - (i * (diameter / 2)) + (j * (diameter)), table.GlobalPosition.Y - table.Texture.GetSize().Y / 4 - (i * diameter)); - Ball ball = Ball._Create(count); + SupportBall ball = SupportBall._Create(count); ball.Place(position); AddChild(ball); @@ -108,23 +108,24 @@ public partial class Battle : Node } else { - Panel pottedPanel = GetNode("PottedPanel"); - Sprite2D ballSprite = new Sprite2D(); - AddChild(ballSprite); - ballSprite.Texture = BODY.GetNode("Image").Texture; - _potted.Add(ballSprite); - ballSprite.Position = new Vector2(pottedPanel.Position.X + pottedPanel.Size.X / 2, pottedPanel.Position.Y + (50 * _potted.Count)); + // Panel pottedPanel = GetNode("PottedPanel"); + // Sprite2D ballSprite = new Sprite2D(); + // AddChild(ballSprite); + // ballSprite.Texture = BODY.GetNode("Image").Texture; + // _potted.Add(ballSprite); + // ballSprite.Position = new Vector2(pottedPanel.Position.X + pottedPanel.Size.X / 2, pottedPanel.Position.Y + (50 * _potted.Count)); ((Ball)BODY)._placed = false; ((Ball)BODY)._potted = true; BODY.QueueFree(); } } - + public void Start() { _current = true; GenerateBalls(); Globals.Instance._currentBattle = this; + _player.Start(); } } diff --git a/Gameplay/CueBall.cs b/Gameplay/CueBall.cs new file mode 100644 index 0000000..381c15b --- /dev/null +++ b/Gameplay/CueBall.cs @@ -0,0 +1,19 @@ +using Godot; +using System; +using System.Data; + +public partial class CueBall : Ball +{ + + new public static CueBall _Create() + { + PackedScene scene = ResourceLoader.Load("res://Gameplay/cue_ball.tscn"); + CueBall newBall = scene.Instantiate(); + + newBall._isCue = true; + newBall.GetNode("Image").Texture = GD.Load("res://art/cue_ball.png"); + return newBall; + } + + +} diff --git a/Gameplay/CueBall.cs.uid b/Gameplay/CueBall.cs.uid new file mode 100644 index 0000000..5bd8b48 --- /dev/null +++ b/Gameplay/CueBall.cs.uid @@ -0,0 +1 @@ +uid://cccd8cs6b5xmd diff --git a/Gameplay/Globals.cs b/Gameplay/Globals.cs index 13b262c..f6108be 100644 --- a/Gameplay/Globals.cs +++ b/Gameplay/Globals.cs @@ -9,10 +9,13 @@ public partial class Globals : Node public Vector2 _screenSize; public Vector2 _screenCenter; public Battle _currentBattle; - + public static RandomNumberGenerator _rng = new(); + public override void _Ready() { Instance = this; } + + } diff --git a/Gameplay/Player.cs b/Gameplay/Player.cs index 77eb6a1..ccb6396 100644 --- a/Gameplay/Player.cs +++ b/Gameplay/Player.cs @@ -5,8 +5,7 @@ using System.Collections.Generic; public partial class Player : Node { public bool _available, _selected; - public Actor _selectedActor; - public List _actors = new(); + public Actor _teamLead; public static Player _Create() { @@ -14,7 +13,7 @@ public partial class Player : Node Player newPlayer = scene.Instantiate(); Actor newActor = Actor._Create(); - newPlayer._actors.Add(newActor); + newPlayer._teamLead = newActor; newPlayer.AddChild(newActor); return newPlayer; @@ -24,5 +23,10 @@ public partial class Player : Node { } + + public void Start() + { + _teamLead.Start(); + } } diff --git a/Gameplay/SupportBall.cs b/Gameplay/SupportBall.cs new file mode 100644 index 0000000..437eb49 --- /dev/null +++ b/Gameplay/SupportBall.cs @@ -0,0 +1,18 @@ +using Godot; +using System; +using System.Data; + +public partial class SupportBall : Ball +{ + + public static SupportBall _Create(int NUMBER) + { + PackedScene scene = ResourceLoader.Load("res://Gameplay/support_ball.tscn"); + SupportBall newBall = scene.Instantiate(); + + newBall.GetNode("Image").Texture = GD.Load("res://art/ball_" + NUMBER + ".png"); + return newBall; + } + + +} diff --git a/Gameplay/SupportBall.cs.uid b/Gameplay/SupportBall.cs.uid new file mode 100644 index 0000000..d44e46f --- /dev/null +++ b/Gameplay/SupportBall.cs.uid @@ -0,0 +1 @@ +uid://cwv3ic5qviw37 diff --git a/Gameplay/actor_panel.tscn b/Gameplay/actor_panel.tscn index 18656b5..57ca6e2 100644 --- a/Gameplay/actor_panel.tscn +++ b/Gameplay/actor_panel.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=5 format=3 uid="uid://8kv00jc35dma"] +[gd_scene load_steps=7 format=3 uid="uid://8kv00jc35dma"] [ext_resource type="Script" uid="uid://c4ekvurl6q7jn" path="res://Gameplay/ActorPanel.cs" id="1_dg1wx"] @@ -11,8 +11,14 @@ bg_color = Color(0.133196, 0.133196, 0.133196, 1) [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dg1wx"] bg_color = Color(0.376575, 0.904155, 0.434351, 1) +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_j2own"] +bg_color = Color(0.501407, 0.501406, 0.501406, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_058dj"] +bg_color = Color(1, 1, 1, 1) + [node name="ActorPanel" type="Panel"] -offset_right = 422.0 +offset_right = 450.0 offset_bottom = 130.0 grow_horizontal = 2 grow_vertical = 2 @@ -36,9 +42,9 @@ position = Vector2(100, 75) [node name="Health" type="Control" parent="."] anchors_preset = 0 -offset_left = 207.0 +offset_left = 203.0 offset_top = 6.0 -offset_right = 417.0 +offset_right = 429.0 offset_bottom = 51.0 [node name="Label" type="RichTextLabel" parent="Health"] @@ -110,5 +116,115 @@ theme_override_styles/fill = SubResource("StyleBoxFlat_dg1wx") step = 1.0 show_percentage = false +[node name="BallReturn" type="Panel" parent="."] +layout_mode = 0 +offset_left = 475.0 +offset_right = 550.0 +offset_bottom = 800.0 +theme_override_styles/panel = SubResource("StyleBoxFlat_j2own") + +[node name="Desk" type="Panel" parent="."] +layout_mode = 0 +offset_top = 150.0 +offset_right = 450.0 +offset_bottom = 800.0 +theme_override_styles/panel = SubResource("StyleBoxFlat_j2own") + +[node name="DeskOrnament1" type="Panel" parent="Desk"] +layout_mode = 0 +offset_left = 50.0 +offset_top = 50.0 +offset_right = 150.0 +offset_bottom = 150.0 +theme_override_styles/panel = SubResource("StyleBoxFlat_058dj") + +[node name="Sprite2D" type="Sprite2D" parent="Desk/DeskOrnament1"] +position = Vector2(50, 50) +scale = Vector2(1.5, 1.5) + +[node name="DeskOrnament2" type="Panel" parent="Desk"] +layout_mode = 0 +offset_left = 50.0 +offset_top = 200.0 +offset_right = 150.0 +offset_bottom = 300.0 +theme_override_styles/panel = SubResource("StyleBoxFlat_058dj") + +[node name="Sprite2D" type="Sprite2D" parent="Desk/DeskOrnament2"] +position = Vector2(50, 50) +scale = Vector2(1.5, 1.5) + +[node name="DeskOrnament3" type="Panel" parent="Desk"] +layout_mode = 0 +offset_left = 50.0 +offset_top = 350.0 +offset_right = 150.0 +offset_bottom = 450.0 +theme_override_styles/panel = SubResource("StyleBoxFlat_058dj") + +[node name="Sprite2D" type="Sprite2D" parent="Desk/DeskOrnament3"] +position = Vector2(50, 50) +scale = Vector2(1.5, 1.5) + +[node name="DeskOrnament4" type="Panel" parent="Desk"] +layout_mode = 0 +offset_left = 50.0 +offset_top = 500.0 +offset_right = 150.0 +offset_bottom = 600.0 +theme_override_styles/panel = SubResource("StyleBoxFlat_058dj") + +[node name="Sprite2D" type="Sprite2D" parent="Desk/DeskOrnament4"] +position = Vector2(50, 50) +scale = Vector2(1.5, 1.5) + +[node name="DeskOrnament5" type="Panel" parent="Desk"] +layout_mode = 0 +offset_left = 300.0 +offset_top = 50.0 +offset_right = 400.0 +offset_bottom = 150.0 +theme_override_styles/panel = SubResource("StyleBoxFlat_058dj") + +[node name="Sprite2D" type="Sprite2D" parent="Desk/DeskOrnament5"] +position = Vector2(50, 50) +scale = Vector2(1.5, 1.5) + +[node name="DeskOrnament6" type="Panel" parent="Desk"] +layout_mode = 0 +offset_left = 300.0 +offset_top = 200.0 +offset_right = 400.0 +offset_bottom = 300.0 +theme_override_styles/panel = SubResource("StyleBoxFlat_058dj") + +[node name="Sprite2D" type="Sprite2D" parent="Desk/DeskOrnament6"] +position = Vector2(50, 50) +scale = Vector2(1.5, 1.5) + +[node name="DeskOrnament7" type="Panel" parent="Desk"] +layout_mode = 0 +offset_left = 300.0 +offset_top = 350.0 +offset_right = 400.0 +offset_bottom = 450.0 +theme_override_styles/panel = SubResource("StyleBoxFlat_058dj") + +[node name="Sprite2D" type="Sprite2D" parent="Desk/DeskOrnament7"] +position = Vector2(50, 50) +scale = Vector2(1.5, 1.5) + +[node name="DeskOrnament8" type="Panel" parent="Desk"] +layout_mode = 0 +offset_left = 300.0 +offset_top = 500.0 +offset_right = 400.0 +offset_bottom = 600.0 +theme_override_styles/panel = SubResource("StyleBoxFlat_058dj") + +[node name="Sprite2D" type="Sprite2D" parent="Desk/DeskOrnament8"] +position = Vector2(50, 50) +scale = Vector2(1.5, 1.5) + [connection signal="mouse_entered" from="." to="." method="OnMouseEntered"] [connection signal="mouse_exited" from="." to="." method="OnMouseExited"] diff --git a/Gameplay/cue_ball.tscn b/Gameplay/cue_ball.tscn new file mode 100644 index 0000000..de071fe --- /dev/null +++ b/Gameplay/cue_ball.tscn @@ -0,0 +1,38 @@ +[gd_scene load_steps=6 format=3 uid="uid://qlhqpubnb7t2"] + +[ext_resource type="Shader" uid="uid://b6vvt5o0008ob" path="res://shaders/globe.gdshader" id="2_oil24"] +[ext_resource type="Script" uid="uid://cccd8cs6b5xmd" path="res://Gameplay/CueBall.cs" id="2_x5gxx"] + +[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_yj7wd"] +bounce = 5.0 + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_yj7wd"] +shader = ExtResource("2_oil24") +shader_parameter/scroll_x = 0.0 +shader_parameter/scroll_y = 0.0 +shader_parameter/rotation = 0.0 +shader_parameter/globe_magnitude = 0.0 + +[sub_resource type="CircleShape2D" id="CircleShape2D_803qd"] +radius = 18.0 + +[node name="CueBall" type="RigidBody2D" groups=["balls"]] +z_index = 1 +input_pickable = true +physics_material_override = SubResource("PhysicsMaterial_yj7wd") +continuous_cd = 2 +contact_monitor = true +max_contacts_reported = 1 +script = ExtResource("2_x5gxx") + +[node name="Image" type="Sprite2D" parent="."] +texture_filter = 1 +material = SubResource("ShaderMaterial_yj7wd") + +[node name="Bounds" type="CollisionShape2D" parent="."] +position = Vector2(0, -7.10543e-15) +shape = SubResource("CircleShape2D_803qd") + +[connection signal="body_entered" from="." to="." method="OnBodyEntered"] +[connection signal="mouse_entered" from="." to="." method="OnMouseEntered"] +[connection signal="mouse_exited" from="." to="." method="OnMouseExited"] diff --git a/Gameplay/support_ball.tscn b/Gameplay/support_ball.tscn new file mode 100644 index 0000000..6a761a3 --- /dev/null +++ b/Gameplay/support_ball.tscn @@ -0,0 +1,38 @@ +[gd_scene load_steps=6 format=3 uid="uid://dylhg83cnxckv"] + +[ext_resource type="Script" uid="uid://cwv3ic5qviw37" path="res://Gameplay/SupportBall.cs" id="2_4wdnc"] +[ext_resource type="Shader" uid="uid://b6vvt5o0008ob" path="res://shaders/globe.gdshader" id="2_jnwku"] + +[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_yj7wd"] +bounce = 5.0 + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_yj7wd"] +shader = ExtResource("2_jnwku") +shader_parameter/scroll_x = 0.0 +shader_parameter/scroll_y = 0.0 +shader_parameter/rotation = 0.0 +shader_parameter/globe_magnitude = 0.0 + +[sub_resource type="CircleShape2D" id="CircleShape2D_803qd"] +radius = 18.0 + +[node name="SupportBall" type="RigidBody2D" groups=["balls"]] +z_index = 1 +input_pickable = true +physics_material_override = SubResource("PhysicsMaterial_yj7wd") +continuous_cd = 2 +contact_monitor = true +max_contacts_reported = 1 +script = ExtResource("2_4wdnc") + +[node name="Image" type="Sprite2D" parent="."] +texture_filter = 1 +material = SubResource("ShaderMaterial_yj7wd") + +[node name="Bounds" type="CollisionShape2D" parent="."] +position = Vector2(0, -7.10543e-15) +shape = SubResource("CircleShape2D_803qd") + +[connection signal="body_entered" from="." to="." method="OnBodyEntered"] +[connection signal="mouse_entered" from="." to="." method="OnMouseEntered"] +[connection signal="mouse_exited" from="." to="." method="OnMouseExited"]