7-21-25 @ 3:17 am
This commit is contained in:
@@ -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<Cue> _cues = new();
|
||||
public Cue _selectedCue = null;
|
||||
public Cue _cue = null;
|
||||
public List<Ball> _balls = new();
|
||||
public List<Ball> _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<Sprite2D>("Sprite").Texture = GD.Load<Texture2D>("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<Sprite2D>("Image").Texture;
|
||||
_tempBallSprite.ZIndex = 1;
|
||||
}
|
||||
if (_startArea == null)
|
||||
{
|
||||
_startArea = Globals.Instance._currentBattle.GetNode<Table>("Table").GetNode<Area2D>("PlayerStartArea").GetNode<CollisionShape2D>("CollisionShape2D");
|
||||
}
|
||||
|
||||
// Vector2 mousePosition = GetViewport().GetMousePosition();
|
||||
// if (_tempBallSprite.Texture == null)
|
||||
// {
|
||||
// if (GetChildren().All(n => n != _tempBallSprite))
|
||||
// {
|
||||
// AddChild(_tempBallSprite);
|
||||
// }
|
||||
// _tempBallSprite.Texture = _heldBall.GetNode<Sprite2D>("Image").Texture;
|
||||
// _tempBallSprite.ZIndex = 1;
|
||||
// }
|
||||
// if (_startArea == null)
|
||||
// {
|
||||
// _startArea = Globals.Instance._currentBattle.GetNode<Table>("Table").GetNode<Area2D>("PlayerStartArea").GetNode<CollisionShape2D>("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<Texture2D>("res://art/cue_ball.png");
|
||||
//_cueBall.GetNode<Sprite2D>("Image").Texture = image;
|
||||
//_cueBall._placed = true;
|
||||
//_balls = GetTree().GetNodesInGroup("balls").Select(b => (Ball)b).ToList<Ball>();
|
||||
//}
|
||||
|
||||
|
||||
public void Start()
|
||||
{
|
||||
Panel ballReturn = _panel.GetNode<Panel>("BallReturn");
|
||||
GD.Print(ballReturn.Position);
|
||||
GD.Print(ballReturn.GlobalPosition);
|
||||
|
||||
for (int i = 0; i < _balls.Count; i++)
|
||||
{
|
||||
_balls[i].GetNode<CollisionShape2D>("Bounds").Disabled = true;
|
||||
_balls[i].Position = new Vector2(ballReturn.Size.X/2, 50 * (i + 1));
|
||||
|
||||
_panel.GetNode<Panel>("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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public partial class ActorPanel : Panel
|
||||
newActorPanel.SetSprite(newActorPanel._actor.GetNode<Sprite2D>("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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<PackedScene>("res://Gameplay/ball.tscn");
|
||||
Ball newBall = scene.Instantiate<Ball>();
|
||||
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<Texture2D>(fileName);
|
||||
newBall.GetNode<Sprite2D>("Image").Texture = image;
|
||||
|
||||
return newBall;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<Panel>("PottedPanel");
|
||||
Sprite2D ballSprite = new Sprite2D();
|
||||
AddChild(ballSprite);
|
||||
ballSprite.Texture = BODY.GetNode<Sprite2D>("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<Panel>("PottedPanel");
|
||||
// Sprite2D ballSprite = new Sprite2D();
|
||||
// AddChild(ballSprite);
|
||||
// ballSprite.Texture = BODY.GetNode<Sprite2D>("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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
19
Gameplay/CueBall.cs
Normal file
19
Gameplay/CueBall.cs
Normal file
@@ -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<PackedScene>("res://Gameplay/cue_ball.tscn");
|
||||
CueBall newBall = scene.Instantiate<CueBall>();
|
||||
|
||||
newBall._isCue = true;
|
||||
newBall.GetNode<Sprite2D>("Image").Texture = GD.Load<Texture2D>("res://art/cue_ball.png");
|
||||
return newBall;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
Gameplay/CueBall.cs.uid
Normal file
1
Gameplay/CueBall.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cccd8cs6b5xmd
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -5,8 +5,7 @@ using System.Collections.Generic;
|
||||
public partial class Player : Node
|
||||
{
|
||||
public bool _available, _selected;
|
||||
public Actor _selectedActor;
|
||||
public List<Actor> _actors = new();
|
||||
public Actor _teamLead;
|
||||
|
||||
public static Player _Create()
|
||||
{
|
||||
@@ -14,7 +13,7 @@ public partial class Player : Node
|
||||
Player newPlayer = scene.Instantiate<Player>();
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
18
Gameplay/SupportBall.cs
Normal file
18
Gameplay/SupportBall.cs
Normal file
@@ -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<PackedScene>("res://Gameplay/support_ball.tscn");
|
||||
SupportBall newBall = scene.Instantiate<SupportBall>();
|
||||
|
||||
newBall.GetNode<Sprite2D>("Image").Texture = GD.Load<Texture2D>("res://art/ball_" + NUMBER + ".png");
|
||||
return newBall;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
Gameplay/SupportBall.cs.uid
Normal file
1
Gameplay/SupportBall.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cwv3ic5qviw37
|
||||
@@ -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"]
|
||||
|
||||
38
Gameplay/cue_ball.tscn
Normal file
38
Gameplay/cue_ball.tscn
Normal file
@@ -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"]
|
||||
38
Gameplay/support_ball.tscn
Normal file
38
Gameplay/support_ball.tscn
Normal file
@@ -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"]
|
||||
Reference in New Issue
Block a user