diff --git a/Gameplay/Ball.cs b/Gameplay/Ball.cs index e43844d..43d0796 100644 --- a/Gameplay/Ball.cs +++ b/Gameplay/Ball.cs @@ -3,207 +3,4 @@ using System; public partial class Ball : RigidBody2D { - [Signal] - public delegate void HoverEventHandler(bool tf = true); - [Signal] - public delegate void SelectEventHandler(bool tf = true); - [Signal] - public delegate void AimEventHandler(bool tf = true); - [Signal] - public delegate void LaunchEventHandler(bool tf = true); - [Signal] - public delegate void MoveEventHandler(bool tf = true); - [Signal] - public delegate void BumpMarbleEventHandler(Ball ball); - [Signal] - public delegate void DefenseDownEventHandler(int damage); - - public bool _holding, _placed, _hovered, _selected, _aimed, _launched, _moving; - public int _defense, _defenseMax, _speed; - public Vector2 _force, _velocity, _screenSize; - - - public override void _Ready() - { - _holding = false; - _placed = false; - _hovered = false; - _selected = false; - _aimed = false; - _launched = false; - _moving = false; - _defense = 10; - _defenseMax = _defense; - _speed = 400; - _force = new Vector2(0,0); - _velocity = new Vector2(0,0); - _screenSize = GetViewportRect().Size; - - Hide(); - } - - public override void _PhysicsProcess(double delta) //THIS IS LIKE THE UPDATE FUNCTION - { - Rotation = 0; - if (_placed) - { - TrySelect(); - TryAim(); - TryLaunch(); - TryMovement(delta); - } - else if (_holding) - { - //GetNode("Bounds").Disabled = true; - Vector2 mousePosition = GetGlobalMousePosition(); - if (Input.IsActionJustReleased("left_click")) - { - Start(mousePosition); - } - } - } - - public void DefenseChange(int change) - { - _defense += change; - if (_defense < 0) - { - EmitSignal(SignalName.DefenseDown); // transfer damage over 0 to player - _defense = 0; // set defense back to 0 - } - } - - public void Start(Vector2 position) - { - - _holding = false; - _placed = true; - Position = position; - Show(); - GetNode("Bounds").Disabled = false; - } - - public void TryAim() - { - if (_selected && Input.IsActionPressed("left_click") && ! _hovered && !_aimed) - { - _aimed = true; - EmitSignal(SignalName.Aim); - } - - if (_aimed) - { - Vector2 mousePosition = GetGlobalMousePosition(); - _force = Position - mousePosition; - - if (!Input.IsActionPressed("left_click")) - { - if (!_hovered) - { - _launched = true; - EmitSignal(SignalName.Select, false); - } - else - { - _aimed = false; - EmitSignal(SignalName.Aim, false); - } - } - } - } - - public void TryLaunch() - { - if (_aimed && Input.IsActionJustReleased("left_click")) - { - _selected = false; - EmitSignal(SignalName.Select, false); - - _aimed = false; - EmitSignal(SignalName.Aim, false); - - _launched = true; - EmitSignal(SignalName.Launch); - - ApplyCentralForce(_force * _speed); - _force = Vector2.Zero; - } - } - - public void TryMovement(double delta) - { - if (LinearVelocity.Length() > 0 && !Sleeping) - { - if (!_moving) - { - _moving = true; - EmitSignal(SignalName.Move); - } - } - if (_moving) - { - //Vector2 Scroll = -LinearVelocity / 100; -// - //Sprite2D sprite = (Sprite2D)GetNode("Texture"); - //ShaderMaterial material = (ShaderMaterial)sprite.Material; - // - //float CurrentScrollX = (float)material.GetShaderParameter("scroll_x"); - //material.SetShaderParameter("scroll_x", (CurrentScrollX + Scroll.X * (float)delta) % 1.0f); - // - //float CurrentScrollY = (float)material.GetShaderParameter("scroll_y"); - //material.SetShaderParameter("scroll_y", (CurrentScrollY + Scroll.Y * (float)delta) % 1.0f); - - - if (Sleeping) - { - _launched = false; - _moving = false; - EmitSignal(SignalName.Move, false); - } - } - } - - public void TrySelect() - { - if ( _hovered) - { - if (Input.IsActionJustPressed("left_click") && !_selected) - { - _selected = true; - EmitSignal(SignalName.Select); - } - } - - if (_selected) - { - if (!_hovered) - { - if (Input.IsActionJustPressed("left_click") && _selected) - { - _selected = false; - EmitSignal(SignalName.Select, false); - } - } - } - } - - private void OnMouseEntered() - { - _hovered = true; - EmitSignal(SignalName.Hover); - } - - private void OnMouseExited() - { - _hovered = false; - EmitSignal(SignalName.Hover, false); - } - - private void OnBodyEntered(Node2D body) - { - if (body.GetType() == typeof(Ball)) - { - EmitSignal(SignalName.BumpMarble, (Ball)body); - } - } } diff --git a/Gameplay/Ball.cs.uid b/Gameplay/Ball.cs.uid index 63623d3..339b80f 100644 --- a/Gameplay/Ball.cs.uid +++ b/Gameplay/Ball.cs.uid @@ -1 +1 @@ -uid://b1bipn8tmpggr +uid://dgdxx8tceiljg diff --git a/Gameplay/Cue.cs b/Gameplay/Cue.cs new file mode 100644 index 0000000..0d523bd --- /dev/null +++ b/Gameplay/Cue.cs @@ -0,0 +1,40 @@ +using Godot; +using System; + +public partial class Cue : Sprite2D +{ + [Signal] + public delegate void ShootEventHandler(Vector2 impulse); + public float _power = 0.0f; + public int _powerDirection = 1; + + public override void _Process(double delta) + { + Vector2 mousePosition = GetViewport().GetMousePosition(); + LookAt(mousePosition); + if (Input.IsActionPressed("left_click")) + { + _power += 0.1f * _powerDirection; + if (_power >= ((Main)GetParent())._maxPower) + { + _powerDirection = -1; + } + else if (_power <= 0) + { + _powerDirection = 1; + } + } + else + { + if (_power > 0f) + { + _powerDirection = 1; + Vector2 direction = mousePosition - Position; + EmitSignal(SignalName.Shoot, _power * direction); + _power = 0; + } + } + + } + +} diff --git a/Gameplay/Cue.cs.uid b/Gameplay/Cue.cs.uid new file mode 100644 index 0000000..5eaa7d6 --- /dev/null +++ b/Gameplay/Cue.cs.uid @@ -0,0 +1 @@ +uid://ian15gmia0uv diff --git a/Gameplay/Main.cs b/Gameplay/Main.cs index 54562bb..7e2a06c 100644 --- a/Gameplay/Main.cs +++ b/Gameplay/Main.cs @@ -1,24 +1,173 @@ using Godot; using System; +using System.Collections.Generic; +using System.Linq; public partial class Main : Node { - // Don't forget to rebuild the project so the editor knows about the new export variable. + [Export] + public PackedScene BallScene; + + public bool _takingShot, _cueBallPotted; + public float _maxPower = 8.0f, _moveThreshold = 5.0f; + public Vector2 _startPosition = new Vector2(890, 340); + public Ball _cueBall; + public List _ballImages = new(); + public List _potted = new(); + public override void _Ready() { + LoadBallImages(); NewGame(); + List pockets = GetNode("Table").GetChildren().Where(n => n.GetName().ToString().ToLower().Contains("pocket")).Select(n => (Area2D)n).ToList(); + + for (int i = 0; i < pockets.Count; i++) + { + pockets[i].BodyEntered += PottedBall; + } + //GetNode
("Table").GetNode("PocketTL").BodyEntered += PottedBall; + //GetNode
("Table").GetNode("PocketTR").BodyEntered += PottedBall; + //GetNode
("Table").GetNode("PocketR").BodyEntered += PottedBall; + //GetNode
("Table").GetNode("PocketBR").BodyEntered += PottedBall; + //GetNode
("Table").GetNode("PocketBL").BodyEntered += PottedBall; + //GetNode
("Table").GetNode("PocketL").BodyEntered += PottedBall; + } + + public override void _Process(double delta_) + { + bool moving = false; + List balls = GetTree().GetNodesInGroup("balls").Select(b => (Ball)b).ToList(); + for (int i = 0; i < balls.Count; i++) + { + if (balls[i].LinearVelocity.Length() > 0 && balls[i].LinearVelocity.Length() < _moveThreshold) + { + balls[i].Sleeping = true; + } + else if (balls[i].LinearVelocity.Length() >= _moveThreshold) + { + moving = true; + } + } + if (!moving) + { + if (_cueBallPotted) + { + ResetCueBall(); + _cueBallPotted = false; + } + if (!_takingShot) + { + _takingShot = true; + ShowCue(); + } + } + else + { + if (_takingShot) + { + _takingShot = false; + HideCue(); + } + } + + } + + public void GenerateBalls() + { + int count = 0; + int rows = 5; + int diameter = 36; + for (int i = 0; i < 5; i++) + { + for (int j = 0; j < rows; j++) + { + Ball ball = BallScene.Instantiate(); + Vector2 position = new Vector2(250 + (i*(diameter)), 267 + (j*(diameter)) + (i*(diameter / 2))); + AddChild(ball); + + ball.Position = position; + ball.GetNode("Texture").Texture = _ballImages[count]; + count += 1; + + } + rows -= 1; + + } + } + + public void HideCue() + { + GetNode("Cue").SetProcess(false); + GetNode("Cue").Hide(); + GetNode("PowerBar").Hide(); + } + + public void LoadBallImages() + { + _ballImages.Clear(); + for (int i = 1; i < 17; i++) + { + string fileName = "res://art/ball_"+i+".png"; + Texture2D image = GD.Load(fileName); + _ballImages.Add(image); + } } public void NewGame() { - Player player = new Player(); - //Marker2D enemyStart = GetNode("EnemyStart"); - //Cog enemy = GetNode("Enemy"); - //enemy.PlaceMarble(enemyStart.Position); - // - //Cog player = GetNode("Player"); - //player.HoldMarble(); + ResetCueBall(); + GenerateBalls(); + ShowCue(); } + public void PottedBall(Node2D body) + { + if (body == _cueBall) + { + _cueBallPotted = true; + RemoveCueBall(); + } + else + { + Sprite2D ballSprite = new Sprite2D(); + AddChild(ballSprite); + ballSprite.Texture = body.GetNode("Texture").Texture; + _potted.Add(ballSprite); + ballSprite.Position = new Vector2(50 * _potted.Count, 725); + body.QueueFree(); + } + //GetNode
("Table").GetNode("Pockets").GetNode("Pockets") + } + + public void RemoveCueBall() + { + Ball oldCueBall = _cueBall; + RemoveChild(oldCueBall); + oldCueBall.QueueFree(); + } + + public void ResetCueBall() + { + _cueBall = BallScene.Instantiate(); + AddChild(_cueBall); + _cueBall.Position = _startPosition; + _cueBall.GetNode("Texture").Texture = _ballImages[^1]; + _takingShot = false; + + } + + public void ShowCue() + { + GetNode("Cue").SetProcess(true); + GetNode("Cue").Position = _cueBall.Position; + GetNode("PowerBar").Position = new Vector2(_cueBall.Position.X - GetNode("PowerBar").Size.X / 2, _cueBall.Position.Y + GetNode("PowerBar").Size.Y / 2); + GetNode("Cue").Show(); + GetNode("PowerBar").Show(); + } + + private void OnCueShoot(Vector2 impulse) + { + _cueBall.ApplyCentralImpulse(impulse); + } } diff --git a/Gameplay/Player.cs b/Gameplay/Player.cs deleted file mode 100644 index 4a1cb58..0000000 --- a/Gameplay/Player.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Godot; -using System; -using System.Collections.Generic; - -public partial class Player : Node -{ - - public List _sharks; - public List _sharkHuds; - - public override void _Ready() - { - - } - -} diff --git a/Gameplay/Player.cs.uid b/Gameplay/Player.cs.uid deleted file mode 100644 index 2fac353..0000000 --- a/Gameplay/Player.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bx02wonvmk3td diff --git a/Gameplay/PowerBar.cs b/Gameplay/PowerBar.cs new file mode 100644 index 0000000..19b35e9 --- /dev/null +++ b/Gameplay/PowerBar.cs @@ -0,0 +1,15 @@ +using Godot; +using System; + +public partial class PowerBar : ProgressBar +{ + public override void _Ready() + { + + } + + public override void _Process(double delta) + { + Value = ((Main)GetParent()).GetNode("Cue")._power / ((Main)GetParent())._maxPower * 100; + } +} diff --git a/Gameplay/PowerBar.cs.uid b/Gameplay/PowerBar.cs.uid new file mode 100644 index 0000000..3956f36 --- /dev/null +++ b/Gameplay/PowerBar.cs.uid @@ -0,0 +1 @@ +uid://dbfpn1p62siat diff --git a/Gameplay/Shark.cs b/Gameplay/Shark.cs deleted file mode 100644 index 650fd04..0000000 --- a/Gameplay/Shark.cs +++ /dev/null @@ -1,69 +0,0 @@ -using Godot; -using System; -using System.Collections.Generic; - -public partial class Shark : Node2D -{ - - public bool _dead; - public int _aptitude, _agility, _ardor, _accuity, _awareness, _appeal, _health, _healthMax, _energy, _energyMax, _stamina, _staminaMax, _burden, _turnBandwidth, _turnBandwidthMax, _battleBandwidth, _criticalChance; - public string _name; - public SharkHud _hud; - public List _balls = new(); - - public override void _Ready() - { - _name = "Sample Cog"; - _dead = false; - - _aptitude = 10; // ball launch speed / strength - _agility = 10; // ball launch stamina - _ardor = 10; // ball defense - _accuity = 10; // ball - _awareness = 10; - _appeal = 10; - - _health = _ardor * 12; - _healthMax = _health; - _energy = _accuity * 12; - _energyMax = _energy; - _stamina = _agility * 12; - _staminaMax = _stamina; - _burden = _appeal / 12; - _turnBandwidth = (int)(_awareness * 2 / 3); - _turnBandwidthMax = _turnBandwidth; - _battleBandwidth = _turnBandwidthMax * 4; - - _criticalChance = 10; - } - - public void Attack(Ball target) - { - Ball ball = GetNode("Ball"); - if (ball._launched) - { - target.DefenseChange(-3); - } - } - - public void HealthChange(int change) - { - _health += change; - if (_health < 0) - { - _dead = true; - } - } - - public void HoldBall() - { - Ball ball = GetNode("Ball"); - ball._holding = true; - } - - public void PlaceBall(Vector2 position) - { - Ball ball = GetNode("Ball"); - ball.Start(position); - } -} diff --git a/Gameplay/Shark.cs.uid b/Gameplay/Shark.cs.uid deleted file mode 100644 index ec66c58..0000000 --- a/Gameplay/Shark.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://b8ppwhc4hl0uk diff --git a/Gameplay/SharkHud.cs b/Gameplay/SharkHud.cs deleted file mode 100644 index f2ec730..0000000 --- a/Gameplay/SharkHud.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Godot; -using System; - -public partial class SharkHud : CanvasLayer -{ - public void LoadCog(Shark shark) - { - RichTextLabel name = (RichTextLabel)GetNode("CogName"); - Sprite2D sprite = (Sprite2D)GetNode("Icon"); - RichTextLabel health = (RichTextLabel)GetNode("HealthValue"); - RichTextLabel energy = (RichTextLabel)GetNode("EnergyValue"); - RichTextLabel bandwidth = (RichTextLabel)GetNode("BandwidthValue"); - RichTextLabel healthMax = (RichTextLabel)GetNode("HealthMax"); - RichTextLabel energyMax = (RichTextLabel)GetNode("EnergyMax"); - RichTextLabel bandwidthMax = (RichTextLabel)GetNode("BandwidthMax"); - - name.Text = shark._name; - health.Text = shark._health.ToString(); - energy.Text = shark._energy.ToString(); - bandwidth.Text = shark._turnBandwidth.ToString(); - healthMax.Text = shark._healthMax.ToString(); - energyMax.Text = shark._energyMax.ToString(); - bandwidthMax.Text = shark._turnBandwidthMax.ToString(); - } -} diff --git a/Gameplay/SharkHud.cs.uid b/Gameplay/SharkHud.cs.uid deleted file mode 100644 index faafee7..0000000 --- a/Gameplay/SharkHud.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://cq3svhk85p2ep diff --git a/Gameplay/ball.tscn b/Gameplay/ball.tscn index 0794fa5..6637c07 100644 --- a/Gameplay/ball.tscn +++ b/Gameplay/ball.tscn @@ -1,13 +1,15 @@ -[gd_scene load_steps=8 format=3 uid="uid://c8n4lue2bn25n"] +[gd_scene load_steps=9 format=3 uid="uid://c8n4lue2bn25n"] -[ext_resource type="Script" uid="uid://b1bipn8tmpggr" path="res://Gameplay/Ball.cs" id="1_7ritg"] +[ext_resource type="Script" uid="uid://dgdxx8tceiljg" path="res://Gameplay/Ball.cs" id="1_7ritg"] [ext_resource type="Shader" uid="uid://b6vvt5o0008ob" path="res://shaders/globe.gdshader" id="2_6v01e"] -[ext_resource type="Texture2D" uid="uid://dy4lmwn1dit26" path="res://art/shade.png" id="3_yj7wd"] [ext_resource type="Texture2D" uid="uid://duy62uv828xcg" path="res://art/shadow.png" id="4_803qd"] [ext_resource type="Texture2D" uid="uid://c4jron4g4jalp" path="res://art/shine.png" id="5_fkve3"] +[ext_resource type="FontFile" uid="uid://dave7ql2luyk1" path="res://fonts/Xolonium-Regular.ttf" id="6_0l1om"] -[sub_resource type="ShaderMaterial" id="ShaderMaterial_bdlqm"] -resource_local_to_scene = true +[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_yj7wd"] +bounce = 5.0 + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_yj7wd"] shader = ExtResource("2_6v01e") shader_parameter/scroll_x = 0.0 shader_parameter/scroll_y = 0.0 @@ -15,36 +17,49 @@ shader_parameter/rotation = 0.0 shader_parameter/globe_magnitude = 0.0 [sub_resource type="CircleShape2D" id="CircleShape2D_803qd"] -radius = 60.0 +radius = 18.0 -[node name="Ball" type="RigidBody2D"] +[node name="Ball" type="RigidBody2D" groups=["balls"]] input_pickable = true -gravity_scale = 0.0 -linear_damp = 2.0 +physics_material_override = SubResource("PhysicsMaterial_yj7wd") +continuous_cd = 2 +contact_monitor = true +max_contacts_reported = 1 script = ExtResource("1_7ritg") -metadata/_edit_group_ = true [node name="Texture" type="Sprite2D" parent="."] -material = SubResource("ShaderMaterial_bdlqm") -scale = Vector2(0.46875, 0.46875) -texture = ExtResource("3_yj7wd") - -[node name="Shadow" type="Sprite2D" parent="."] -visible = false -position = Vector2(0, -9.36601e-08) -scale = Vector2(0.46875, 0.46875) -texture = ExtResource("4_803qd") - -[node name="Shine" type="Sprite2D" parent="."] -visible = false -position = Vector2(0, -9.36601e-08) -scale = Vector2(0.47712, 0.47712) -texture = ExtResource("5_fkve3") +texture_filter = 1 +material = SubResource("ShaderMaterial_yj7wd") [node name="Bounds" type="CollisionShape2D" parent="."] position = Vector2(0, -7.10543e-15) shape = SubResource("CircleShape2D_803qd") +[node name="Shadow" type="Sprite2D" parent="."] +visible = false +position = Vector2(0, -9.36601e-08) +scale = Vector2(0.148438, 0.148438) +texture = ExtResource("4_803qd") + +[node name="Shine" type="Sprite2D" parent="."] +visible = false +position = Vector2(0, -9.36601e-08) +scale = Vector2(0.046875, 0.046875) +texture = ExtResource("5_fkve3") + +[node name="Number" type="Label" parent="."] +visible = false +offset_left = -9.0 +offset_top = -10.0 +offset_right = 9.0 +offset_bottom = 10.0 +theme_override_colors/font_color = Color(0, 0, 0, 1) +theme_override_fonts/font = ExtResource("6_0l1om") +theme_override_font_sizes/font_size = 10 +text = "#" +horizontal_alignment = 1 +vertical_alignment = 1 + [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/cue.tscn b/Gameplay/cue.tscn new file mode 100644 index 0000000..31d3ad7 --- /dev/null +++ b/Gameplay/cue.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=3 format=3 uid="uid://dm4xk16ce0j"] + +[ext_resource type="Texture2D" uid="uid://qs3fa665l8x2" path="res://art/cue.png" id="1_ujx86"] +[ext_resource type="Script" uid="uid://ian15gmia0uv" path="res://Gameplay/Cue.cs" id="2_dtogv"] + +[node name="Cue" type="Sprite2D"] +z_index = 99 +texture_filter = 1 +texture = ExtResource("1_ujx86") +script = ExtResource("2_dtogv") diff --git a/Gameplay/main.tscn b/Gameplay/main.tscn index 94d2917..f945db4 100644 --- a/Gameplay/main.tscn +++ b/Gameplay/main.tscn @@ -1,6 +1,45 @@ -[gd_scene load_steps=2 format=3 uid="uid://yqtgkxjjexag"] +[gd_scene load_steps=9 format=3 uid="uid://yqtgkxjjexag"] [ext_resource type="Script" uid="uid://v6ovq4snxruc" path="res://Gameplay/Main.cs" id="1_0xm2m"] +[ext_resource type="PackedScene" uid="uid://dsprg4uahkylm" path="res://table.tscn" id="2_vkc8e"] +[ext_resource type="PackedScene" uid="uid://c8n4lue2bn25n" path="res://Gameplay/ball.tscn" id="3_u78cq"] +[ext_resource type="PackedScene" uid="uid://dm4xk16ce0j" path="res://Gameplay/cue.tscn" id="4_u78cq"] +[ext_resource type="Script" uid="uid://dbfpn1p62siat" path="res://Gameplay/PowerBar.cs" id="5_tivnh"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_tivnh"] +bg_color = Color(0.111197, 0.111197, 0.111197, 1) +border_width_left = 2 +border_width_top = 2 +border_width_right = 2 +border_width_bottom = 2 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ajequ"] +bg_color = Color(1, 1, 1, 0.458824) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_aytjx"] +bg_color = Color(0.92549, 0.0901961, 0.0627451, 1) [node name="Main" type="Node"] script = ExtResource("1_0xm2m") +BallScene = ExtResource("3_u78cq") + +[node name="Table" parent="." instance=ExtResource("2_vkc8e")] + +[node name="PottedPanel" type="Panel" parent="."] +offset_top = 678.0 +offset_right = 1200.0 +offset_bottom = 778.0 +theme_override_styles/panel = SubResource("StyleBoxFlat_tivnh") + +[node name="Cue" parent="." instance=ExtResource("4_u78cq")] + +[node name="PowerBar" type="ProgressBar" parent="."] +z_index = 1 +offset_right = 100.0 +offset_bottom = 30.0 +theme_override_styles/background = SubResource("StyleBoxFlat_ajequ") +theme_override_styles/fill = SubResource("StyleBoxFlat_aytjx") +show_percentage = false +script = ExtResource("5_tivnh") + +[connection signal="Shoot" from="Cue" to="." method="OnCueShoot"] diff --git a/Gameplay/oldball.cs b/Gameplay/oldball.cs new file mode 100644 index 0000000..7094c51 --- /dev/null +++ b/Gameplay/oldball.cs @@ -0,0 +1,208 @@ +//using Godot; +//using System; +// +//public partial class Ball : RigidBody2D +//{ + //[Signal] + //public delegate void HoverEventHandler(bool tf = true); + //[Signal] + //public delegate void SelectEventHandler(bool tf = true); + //[Signal] + //public delegate void AimEventHandler(bool tf = true); + //[Signal] + //public delegate void LaunchEventHandler(bool tf = true); + //[Signal] + //public delegate void MoveEventHandler(bool tf = true); + //[Signal] + //public delegate void BumpMarbleEventHandler(Ball ball); + //[Signal] + //public delegate void DefenseDownEventHandler(int damage); + // + //public bool _holding, _placed, _hovered, _selected, _aimed, _launched, _moving; + //public int _defense, _defenseMax, _speed; + //public Vector2 _force, _velocity, _screenSize; +// + // + //public override void _Ready() + //{ + //_holding = false; + //_placed = true; + //_hovered = false; + //_selected = false; + //_aimed = false; + //_launched = false; + //_moving = false; + //_defense = 10; + //_defenseMax = _defense; + //_speed = 400; + //_force = new Vector2(0,0); + //_velocity = new Vector2(0,0); + //_screenSize = GetViewportRect().Size; + // + ////Hide(); + //} + // + //public override void _PhysicsProcess(double delta) //THIS IS LIKE THE UPDATE FUNCTION + //{ + //if (_placed) + //{ + //TrySelect(); + //TryAim(); + //TryLaunch(); + //TryMovement(delta); + //} + //else if (_holding) + //{ + //GetNode("Bounds").Disabled = true; + //Vector2 mousePosition = GetGlobalMousePosition(); + //if (Input.IsActionJustReleased("left_click")) + //{ + //Start(mousePosition); + //} + //} + //} + // + //public void DefenseChange(int change) + //{ + //_defense += change; + //if (_defense < 0) + //{ + //EmitSignal(SignalName.DefenseDown); // transfer damage over 0 to player + //_defense = 0; // set defense back to 0 + //} + //} + // + //public void Start(Vector2 position) + //{ + // + //_holding = false; + //_placed = true; + //Position = position; + //Show(); + //GetNode("Bounds").Disabled = false; + //} + // + //public void TryAim() + //{ + //if (_selected && Input.IsActionPressed("left_click") && ! _hovered && !_aimed) + //{ + //_aimed = true; + //EmitSignal(SignalName.Aim); + //} + // + //if (_aimed) + //{ + //Vector2 mousePosition = GetGlobalMousePosition(); + //_force = (Position - mousePosition) /6; + // + //if (!Input.IsActionPressed("left_click")) + //{ + //if (!_hovered) + //{ + //_launched = true; + //EmitSignal(SignalName.Select, false); + //} + //else + //{ + //_aimed = false; + //EmitSignal(SignalName.Aim, false); + //} + //} + //} + //} + // + //public void TryLaunch() + //{ + //if (_aimed && Input.IsActionJustReleased("left_click")) + //{ + //_selected = false; + //EmitSignal(SignalName.Select, false); + // + //_aimed = false; + //EmitSignal(SignalName.Aim, false); + // + //_launched = true; + //EmitSignal(SignalName.Launch); + // + //ApplyCentralForce(_force * _speed); + //_force = Vector2.Zero; + //} + //} + // + //public void TryMovement(double delta) + //{ + //if (LinearVelocity.Length() > 0 && !Sleeping) + //{ + //if (!_moving) + //{ + //_moving = true; + //EmitSignal(SignalName.Move); + //} + //} + //if (_moving) + //{ + ////Vector2 Scroll = -LinearVelocity / 100; +//// + ////Sprite2D sprite = (Sprite2D)GetNode("Texture"); + ////ShaderMaterial material = (ShaderMaterial)sprite.Material; + //// + ////float CurrentScrollX = (float)material.GetShaderParameter("scroll_x"); + ////material.SetShaderParameter("scroll_x", (CurrentScrollX + Scroll.X * (float)delta) % 1.0f); + //// + ////float CurrentScrollY = (float)material.GetShaderParameter("scroll_y"); + ////material.SetShaderParameter("scroll_y", (CurrentScrollY + Scroll.Y * (float)delta) % 1.0f); + // + // + //if (Sleeping) + //{ + //_launched = false; + //_moving = false; + //EmitSignal(SignalName.Move, false); + //} + //} + //} + // + //public void TrySelect() + //{ + //if ( _hovered) + //{ + //if (Input.IsActionJustPressed("left_click") && !_selected) + //{ + //_selected = true; + //EmitSignal(SignalName.Select); + //} + //} + // + //if (_selected) + //{ + //if (!_hovered) + //{ + //if (Input.IsActionJustPressed("left_click") && _selected) + //{ + //_selected = false; + //EmitSignal(SignalName.Select, false); + //} + //} + //} + //} + // + //private void OnMouseEntered() + //{ + //_hovered = true; + //EmitSignal(SignalName.Hover); + //} + // + //private void OnMouseExited() + //{ + //_hovered = false; + //EmitSignal(SignalName.Hover, false); + //} + // + //private void OnBodyEntered(Node2D body) + //{ + //if (body.GetType() == typeof(Ball)) + //{ + //EmitSignal(SignalName.BumpMarble, (Ball)body); + //} + //} +//} diff --git a/Gameplay/oldball.cs.uid b/Gameplay/oldball.cs.uid new file mode 100644 index 0000000..19d2316 --- /dev/null +++ b/Gameplay/oldball.cs.uid @@ -0,0 +1 @@ +uid://2rh2m60aldei diff --git a/Gameplay/player.tscn b/Gameplay/player.tscn deleted file mode 100644 index b6834a2..0000000 --- a/Gameplay/player.tscn +++ /dev/null @@ -1,6 +0,0 @@ -[gd_scene load_steps=2 format=3 uid="uid://xb4x8a7ukx42"] - -[ext_resource type="Script" uid="uid://bx02wonvmk3td" path="res://Gameplay/Player.cs" id="1_4flbx"] - -[node name="Player" type="Node"] -script = ExtResource("1_4flbx") diff --git a/Gameplay/shark.tscn b/Gameplay/shark.tscn deleted file mode 100644 index 4edffe0..0000000 --- a/Gameplay/shark.tscn +++ /dev/null @@ -1,9 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://s0dbttuctm8"] - -[ext_resource type="Script" uid="uid://b8ppwhc4hl0uk" path="res://Gameplay/Shark.cs" id="1_tsf7f"] -[ext_resource type="PackedScene" uid="uid://c8n4lue2bn25n" path="res://Gameplay/ball.tscn" id="2_unqi5"] - -[node name="Shark" type="Node2D"] -script = ExtResource("1_tsf7f") - -[node name="Ball" parent="." instance=ExtResource("2_unqi5")] diff --git a/Gameplay/sharkhud.tscn b/Gameplay/sharkhud.tscn deleted file mode 100644 index fde3dae..0000000 --- a/Gameplay/sharkhud.tscn +++ /dev/null @@ -1,145 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://cw2ypbamocty5"] - -[ext_resource type="Script" uid="uid://cq3svhk85p2ep" path="res://Gameplay/SharkHud.cs" id="1_6jj1n"] -[ext_resource type="Texture2D" uid="uid://dy4lmwn1dit26" path="res://art/shade.png" id="2_t8tri"] - -[node name="SharkHud" type="CanvasLayer"] -script = ExtResource("1_6jj1n") - -[node name="Background" type="Sprite2D" parent="."] -position = Vector2(98, -128) -scale = Vector2(0.765625, 1) -texture = ExtResource("2_t8tri") - -[node name="SharkView" type="Node2D" parent="."] - -[node name="SharkName" type="RichTextLabel" parent="SharkView"] -offset_left = 7.0 -offset_top = -240.0 -offset_right = 174.0 -offset_bottom = -217.0 -theme_override_colors/default_color = Color(0, 0, 0, 1) -text = "Cog Name" -vertical_alignment = 1 - -[node name="Icon" type="Sprite2D" parent="SharkView"] -position = Vector2(98, -159) -scale = Vector2(0.328125, 0.328125) -texture = ExtResource("2_t8tri") - -[node name="HealthLabel" type="RichTextLabel" parent="SharkView"] -offset_left = 7.01563 -offset_top = -105.0 -offset_right = 107.016 -offset_bottom = -82.0 -theme_override_colors/default_color = Color(0, 0, 0, 1) -text = "Health" -vertical_alignment = 1 - -[node name="EnergyLabel" type="RichTextLabel" parent="SharkView"] -offset_left = 7.01563 -offset_top = -75.0 -offset_right = 107.016 -offset_bottom = -52.0 -theme_override_colors/default_color = Color(0, 0, 0, 1) -text = "Energy" -vertical_alignment = 1 - -[node name="BandwidthLabel" type="RichTextLabel" parent="SharkView"] -offset_left = 7.01563 -offset_top = -45.0 -offset_right = 107.016 -offset_bottom = -22.0 -theme_override_colors/default_color = Color(0, 0, 0, 1) -text = "Bandwidth" -vertical_alignment = 1 - -[node name="HealthValue" type="RichTextLabel" parent="SharkView"] -offset_left = 94.0 -offset_top = -105.0 -offset_right = 144.0 -offset_bottom = -82.0 -theme_override_colors/default_color = Color(0, 0, 0, 1) -text = "Value" -horizontal_alignment = 2 -vertical_alignment = 1 - -[node name="EnergyValue" type="RichTextLabel" parent="SharkView"] -offset_left = 94.0 -offset_top = -75.0 -offset_right = 144.0 -offset_bottom = -52.0 -theme_override_colors/default_color = Color(0, 0, 0, 1) -text = "Value" -horizontal_alignment = 2 -vertical_alignment = 1 - -[node name="BandwidthValue" type="RichTextLabel" parent="SharkView"] -offset_left = 94.0 -offset_top = -45.0 -offset_right = 144.0 -offset_bottom = -22.0 -theme_override_colors/default_color = Color(0, 0, 0, 1) -text = "Value" -horizontal_alignment = 2 -vertical_alignment = 1 - -[node name="HealthMax" type="RichTextLabel" parent="SharkView"] -offset_left = 137.0 -offset_top = -105.0 -offset_right = 187.0 -offset_bottom = -82.0 -theme_override_colors/default_color = Color(0, 0, 0, 1) -text = "Max" -horizontal_alignment = 2 -vertical_alignment = 1 - -[node name="EnergyMax" type="RichTextLabel" parent="SharkView"] -offset_left = 137.0 -offset_top = -75.0 -offset_right = 187.0 -offset_bottom = -52.0 -theme_override_colors/default_color = Color(0, 0, 0, 1) -text = "Max" -horizontal_alignment = 2 -vertical_alignment = 1 - -[node name="BandwidthMax" type="RichTextLabel" parent="SharkView"] -offset_left = 137.0 -offset_top = -45.0 -offset_right = 187.0 -offset_bottom = -22.0 -theme_override_colors/default_color = Color(0, 0, 0, 1) -text = "Max" -horizontal_alignment = 2 -vertical_alignment = 1 - -[node name="HealthDivider" type="RichTextLabel" parent="SharkView"] -offset_left = 123.0 -offset_top = -105.0 -offset_right = 173.0 -offset_bottom = -82.0 -theme_override_colors/default_color = Color(0, 0, 0, 1) -text = "/" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="EnergyDivider" type="RichTextLabel" parent="SharkView"] -offset_left = 123.0 -offset_top = -75.0 -offset_right = 173.0 -offset_bottom = -52.0 -theme_override_colors/default_color = Color(0, 0, 0, 1) -text = "/" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="BandwidthDivider" type="RichTextLabel" parent="SharkView"] -offset_left = 123.0 -offset_top = -45.0 -offset_right = 173.0 -offset_bottom = -22.0 -theme_override_colors/default_color = Color(0, 0, 0, 1) -text = "/" -horizontal_alignment = 1 -vertical_alignment = 1 diff --git a/Table.cs b/Table.cs new file mode 100644 index 0000000..1c141ec --- /dev/null +++ b/Table.cs @@ -0,0 +1,8 @@ +using Godot; +using System; + +public partial class Table : Sprite2D + +{ + +} diff --git a/Table.cs.uid b/Table.cs.uid new file mode 100644 index 0000000..0c8eec3 --- /dev/null +++ b/Table.cs.uid @@ -0,0 +1 @@ +uid://82h0dmyohfj1 diff --git a/addons/godot-git-plugin/win64/~libgit_plugin.windows.editor.x86_64.dll b/addons/godot-git-plugin/win64/~libgit_plugin.windows.editor.x86_64.dll new file mode 100644 index 0000000..47bbb1d Binary files /dev/null and b/addons/godot-git-plugin/win64/~libgit_plugin.windows.editor.x86_64.dll differ diff --git a/art/ball_1.png b/art/ball_1.png new file mode 100644 index 0000000..ff258ad Binary files /dev/null and b/art/ball_1.png differ diff --git a/art/ball_1.png.import b/art/ball_1.png.import new file mode 100644 index 0000000..a09c3e1 --- /dev/null +++ b/art/ball_1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://eq2g2mx115sh" +path="res://.godot/imported/ball_1.png-fdecb2f6384d93c345e2aedfd6fd7c24.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/ball_1.png" +dest_files=["res://.godot/imported/ball_1.png-fdecb2f6384d93c345e2aedfd6fd7c24.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/ball_10.png b/art/ball_10.png new file mode 100644 index 0000000..e372a2e Binary files /dev/null and b/art/ball_10.png differ diff --git a/art/ball_10.png.import b/art/ball_10.png.import new file mode 100644 index 0000000..c7374af --- /dev/null +++ b/art/ball_10.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ncsnpi2f14mm" +path="res://.godot/imported/ball_10.png-3fb92f7bdcad3e233d08cf998caa8eb5.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/ball_10.png" +dest_files=["res://.godot/imported/ball_10.png-3fb92f7bdcad3e233d08cf998caa8eb5.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/ball_11.png b/art/ball_11.png new file mode 100644 index 0000000..5398a00 Binary files /dev/null and b/art/ball_11.png differ diff --git a/art/ball_11.png.import b/art/ball_11.png.import new file mode 100644 index 0000000..612700d --- /dev/null +++ b/art/ball_11.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://g357217lef4q" +path="res://.godot/imported/ball_11.png-196eb35ce40fbb2053c66ca1294ad059.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/ball_11.png" +dest_files=["res://.godot/imported/ball_11.png-196eb35ce40fbb2053c66ca1294ad059.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/ball_12.png b/art/ball_12.png new file mode 100644 index 0000000..c4420fb Binary files /dev/null and b/art/ball_12.png differ diff --git a/art/ball_12.png.import b/art/ball_12.png.import new file mode 100644 index 0000000..4d9404d --- /dev/null +++ b/art/ball_12.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dnoqkj2msjdbe" +path="res://.godot/imported/ball_12.png-ee95853e656d2e219ff7982e8f31245b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/ball_12.png" +dest_files=["res://.godot/imported/ball_12.png-ee95853e656d2e219ff7982e8f31245b.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/ball_13.png b/art/ball_13.png new file mode 100644 index 0000000..f2f9ce1 Binary files /dev/null and b/art/ball_13.png differ diff --git a/art/ball_13.png.import b/art/ball_13.png.import new file mode 100644 index 0000000..e7500c0 --- /dev/null +++ b/art/ball_13.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://da3nlvk4dbr7k" +path="res://.godot/imported/ball_13.png-d0401eba85428b715e4b7978038050a7.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/ball_13.png" +dest_files=["res://.godot/imported/ball_13.png-d0401eba85428b715e4b7978038050a7.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/ball_14.png b/art/ball_14.png new file mode 100644 index 0000000..5fd94ad Binary files /dev/null and b/art/ball_14.png differ diff --git a/art/ball_14.png.import b/art/ball_14.png.import new file mode 100644 index 0000000..4206704 --- /dev/null +++ b/art/ball_14.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dtt144b4hcq1t" +path="res://.godot/imported/ball_14.png-3e724d693d3d782a30a6adc93f2e4b2c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/ball_14.png" +dest_files=["res://.godot/imported/ball_14.png-3e724d693d3d782a30a6adc93f2e4b2c.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/ball_15.png b/art/ball_15.png new file mode 100644 index 0000000..838e216 Binary files /dev/null and b/art/ball_15.png differ diff --git a/art/ball_15.png.import b/art/ball_15.png.import new file mode 100644 index 0000000..dab4c40 --- /dev/null +++ b/art/ball_15.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://3k6u32wysmak" +path="res://.godot/imported/ball_15.png-8cdb4b3900fffa6d5105e2cff3d59cc0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/ball_15.png" +dest_files=["res://.godot/imported/ball_15.png-8cdb4b3900fffa6d5105e2cff3d59cc0.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/ball_16.png b/art/ball_16.png new file mode 100644 index 0000000..8003d28 Binary files /dev/null and b/art/ball_16.png differ diff --git a/art/ball_16.png.import b/art/ball_16.png.import new file mode 100644 index 0000000..3d8ba60 --- /dev/null +++ b/art/ball_16.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ck4ta2f0ofjs0" +path="res://.godot/imported/ball_16.png-b2556cec5a1ae85449e8eb9a469008e8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/ball_16.png" +dest_files=["res://.godot/imported/ball_16.png-b2556cec5a1ae85449e8eb9a469008e8.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/ball_2.png b/art/ball_2.png new file mode 100644 index 0000000..9ab7630 Binary files /dev/null and b/art/ball_2.png differ diff --git a/art/ball_2.png.import b/art/ball_2.png.import new file mode 100644 index 0000000..a691a89 --- /dev/null +++ b/art/ball_2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c6082glgxonen" +path="res://.godot/imported/ball_2.png-5bfcc9971a4473ef19d9aabae57fb14f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/ball_2.png" +dest_files=["res://.godot/imported/ball_2.png-5bfcc9971a4473ef19d9aabae57fb14f.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/ball_3.png b/art/ball_3.png new file mode 100644 index 0000000..d552736 Binary files /dev/null and b/art/ball_3.png differ diff --git a/art/ball_3.png.import b/art/ball_3.png.import new file mode 100644 index 0000000..350c404 --- /dev/null +++ b/art/ball_3.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dm08od2rm4t6a" +path="res://.godot/imported/ball_3.png-1f1717ef70ccfa38748c55c3f37bf4f7.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/ball_3.png" +dest_files=["res://.godot/imported/ball_3.png-1f1717ef70ccfa38748c55c3f37bf4f7.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/ball_4.png b/art/ball_4.png new file mode 100644 index 0000000..00af88e Binary files /dev/null and b/art/ball_4.png differ diff --git a/art/ball_4.png.import b/art/ball_4.png.import new file mode 100644 index 0000000..112826f --- /dev/null +++ b/art/ball_4.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d1xed824duq5b" +path="res://.godot/imported/ball_4.png-b0b95aa2000006a1df4e046cb728e7d0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/ball_4.png" +dest_files=["res://.godot/imported/ball_4.png-b0b95aa2000006a1df4e046cb728e7d0.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/ball_5.png b/art/ball_5.png new file mode 100644 index 0000000..c83d90f Binary files /dev/null and b/art/ball_5.png differ diff --git a/art/ball_5.png.import b/art/ball_5.png.import new file mode 100644 index 0000000..7a60230 --- /dev/null +++ b/art/ball_5.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cnpkopyuvddgs" +path="res://.godot/imported/ball_5.png-a1e18fd4e8acc177e7dd8288726a71c0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/ball_5.png" +dest_files=["res://.godot/imported/ball_5.png-a1e18fd4e8acc177e7dd8288726a71c0.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/ball_6.png b/art/ball_6.png new file mode 100644 index 0000000..bc93b2c Binary files /dev/null and b/art/ball_6.png differ diff --git a/art/ball_6.png.import b/art/ball_6.png.import new file mode 100644 index 0000000..e9e1df9 --- /dev/null +++ b/art/ball_6.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d0w8ji224tqo2" +path="res://.godot/imported/ball_6.png-8d292140d73da9ac261c7faa0383e9d6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/ball_6.png" +dest_files=["res://.godot/imported/ball_6.png-8d292140d73da9ac261c7faa0383e9d6.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/ball_7.png b/art/ball_7.png new file mode 100644 index 0000000..98bdb24 Binary files /dev/null and b/art/ball_7.png differ diff --git a/art/ball_7.png.import b/art/ball_7.png.import new file mode 100644 index 0000000..3c0ec78 --- /dev/null +++ b/art/ball_7.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b8lfcpntlj5sv" +path="res://.godot/imported/ball_7.png-0fceb32a90a934eda906dd7cb8e82b2d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/ball_7.png" +dest_files=["res://.godot/imported/ball_7.png-0fceb32a90a934eda906dd7cb8e82b2d.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/ball_8.png b/art/ball_8.png new file mode 100644 index 0000000..e7ed125 Binary files /dev/null and b/art/ball_8.png differ diff --git a/art/ball_8.png.import b/art/ball_8.png.import new file mode 100644 index 0000000..64f4caf --- /dev/null +++ b/art/ball_8.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b6pal6tj8p06x" +path="res://.godot/imported/ball_8.png-29925aa4b6d7d0aa4d07d880dce61a9b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/ball_8.png" +dest_files=["res://.godot/imported/ball_8.png-29925aa4b6d7d0aa4d07d880dce61a9b.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/ball_9.png b/art/ball_9.png new file mode 100644 index 0000000..d224d47 Binary files /dev/null and b/art/ball_9.png differ diff --git a/art/ball_9.png.import b/art/ball_9.png.import new file mode 100644 index 0000000..c33d007 --- /dev/null +++ b/art/ball_9.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://eenlj817x36o" +path="res://.godot/imported/ball_9.png-08b4dc6ca8b6b459c88fba956d99b26b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/ball_9.png" +dest_files=["res://.godot/imported/ball_9.png-08b4dc6ca8b6b459c88fba956d99b26b.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/billiarball.png b/art/billiardball.png similarity index 100% rename from art/billiarball.png rename to art/billiardball.png diff --git a/art/billiarball.png.import b/art/billiardball.png.import similarity index 71% rename from art/billiarball.png.import rename to art/billiardball.png.import index 87171a8..9c36c31 100644 --- a/art/billiarball.png.import +++ b/art/billiardball.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://cjqa565njih7d" -path="res://.godot/imported/billiarball.png-01a72da7dad54c01690de129789ed199.ctex" +path="res://.godot/imported/billiardball.png-eeae925c3c8f24d7b41954cfa69037f0.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://art/billiarball.png" -dest_files=["res://.godot/imported/billiarball.png-01a72da7dad54c01690de129789ed199.ctex"] +source_file="res://art/billiardball.png" +dest_files=["res://.godot/imported/billiardball.png-eeae925c3c8f24d7b41954cfa69037f0.ctex"] [params] diff --git a/art/cue.png b/art/cue.png new file mode 100644 index 0000000..074f29d Binary files /dev/null and b/art/cue.png differ diff --git a/art/cue.png.import b/art/cue.png.import new file mode 100644 index 0000000..881dd32 --- /dev/null +++ b/art/cue.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://qs3fa665l8x2" +path="res://.godot/imported/cue.png-ebbdc3aa79a87e133e086726e876d410.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/cue.png" +dest_files=["res://.godot/imported/cue.png-ebbdc3aa79a87e133e086726e876d410.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/table.png b/art/table.png new file mode 100644 index 0000000..fdbf371 Binary files /dev/null and b/art/table.png differ diff --git a/art/table.png.import b/art/table.png.import new file mode 100644 index 0000000..84e79c0 --- /dev/null +++ b/art/table.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://df2xulwx34fi" +path="res://.godot/imported/table.png-2f7ddccae7f21a9c21b1a69f78f7d278.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/table.png" +dest_files=["res://.godot/imported/table.png-2f7ddccae7f21a9c21b1a69f78f7d278.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/project.godot b/project.godot index 8687b7b..01bd0ec 100644 --- a/project.godot +++ b/project.godot @@ -15,6 +15,11 @@ run/main_scene="uid://yqtgkxjjexag" config/features=PackedStringArray("4.4", "C#", "Forward Plus") config/icon="res://icon.svg" +[display] + +window/size/viewport_width=1200 +window/size/viewport_height=778 + [dotnet] project/assembly_name="Hotdesking" @@ -55,3 +60,8 @@ left_click={ "events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"canceled":false,"pressed":false,"double_click":false,"script":null) ] } + +[physics] + +2d/default_gravity_vector=Vector2(0, 0) +2d/default_linear_damp=1.5 diff --git a/shaders/blue.gdshader b/shaders/blue.gdshader new file mode 100644 index 0000000..8a0d8ef --- /dev/null +++ b/shaders/blue.gdshader @@ -0,0 +1,15 @@ +shader_type canvas_item; + +void vertex() { + // Called for every vertex the material is visible on. +} + +void fragment() { + // Called for every pixel the material is visible on. + COLOR = vec4(0, 0, 1, 1); +} + +//void light() { +// // Called for every pixel for every light affecting the material. +// // Uncomment to replace the default light processing function with this one. +//} diff --git a/shaders/blue.gdshader.uid b/shaders/blue.gdshader.uid new file mode 100644 index 0000000..d30b96f --- /dev/null +++ b/shaders/blue.gdshader.uid @@ -0,0 +1 @@ +uid://dxe6cenx6rgsb diff --git a/shaders/cyan.gdshader b/shaders/cyan.gdshader new file mode 100644 index 0000000..28b6564 --- /dev/null +++ b/shaders/cyan.gdshader @@ -0,0 +1,15 @@ +shader_type canvas_item; + +void vertex() { + // Called for every vertex the material is visible on. +} + +void fragment() { + // Called for every pixel the material is visible on. + COLOR = vec4(0, 1, 1, 1); +} + +//void light() { +// // Called for every pixel for every light affecting the material. +// // Uncomment to replace the default light processing function with this one. +//} diff --git a/shaders/cyan.gdshader.uid b/shaders/cyan.gdshader.uid new file mode 100644 index 0000000..433a546 --- /dev/null +++ b/shaders/cyan.gdshader.uid @@ -0,0 +1 @@ +uid://c7w62rrw5edj diff --git a/shaders/green.gdshader b/shaders/green.gdshader new file mode 100644 index 0000000..0830a20 --- /dev/null +++ b/shaders/green.gdshader @@ -0,0 +1,15 @@ +shader_type canvas_item; + +void vertex() { + // Called for every vertex the material is visible on. +} + +void fragment() { + // Called for every pixel the material is visible on. + COLOR = vec4(0, 1, 0, 1); +} + +//void light() { +// // Called for every pixel for every light affecting the material. +// // Uncomment to replace the default light processing function with this one. +//} diff --git a/shaders/green.gdshader.uid b/shaders/green.gdshader.uid new file mode 100644 index 0000000..5989745 --- /dev/null +++ b/shaders/green.gdshader.uid @@ -0,0 +1 @@ +uid://ddbp2vqce6ru5 diff --git a/shaders/magenta.gdshader b/shaders/magenta.gdshader new file mode 100644 index 0000000..f7e2c07 --- /dev/null +++ b/shaders/magenta.gdshader @@ -0,0 +1,15 @@ +shader_type canvas_item; + +void vertex() { + // Called for every vertex the material is visible on. +} + +void fragment() { + // Called for every pixel the material is visible on. + COLOR = vec4(1, 0, 1, 1); +} + +//void light() { +// // Called for every pixel for every light affecting the material. +// // Uncomment to replace the default light processing function with this one. +//} diff --git a/shaders/magenta.gdshader.uid b/shaders/magenta.gdshader.uid new file mode 100644 index 0000000..9d55f1a --- /dev/null +++ b/shaders/magenta.gdshader.uid @@ -0,0 +1 @@ +uid://cg2es6x0hwv0c diff --git a/shaders/red.tres b/shaders/red.tres deleted file mode 100644 index 9d34ca2..0000000 --- a/shaders/red.tres +++ /dev/null @@ -1,7 +0,0 @@ -[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://dnjqa0ph5ptli"] - -[ext_resource type="Shader" uid="uid://dvpsalh3o60iu" path="res://shaders/red.gdshader" id="1_ofpe7"] - -[resource] -render_priority = 0 -shader = ExtResource("1_ofpe7") diff --git a/shaders/yellow.gdshader b/shaders/yellow.gdshader new file mode 100644 index 0000000..83af3bb --- /dev/null +++ b/shaders/yellow.gdshader @@ -0,0 +1,15 @@ +shader_type canvas_item; + +void vertex() { + // Called for every vertex the material is visible on. +} + +void fragment() { + // Called for every pixel the material is visible on. + COLOR = vec4(1, 1, 0, 1); +} + +//void light() { +// // Called for every pixel for every light affecting the material. +// // Uncomment to replace the default light processing function with this one. +//} diff --git a/shaders/yellow.gdshader.uid b/shaders/yellow.gdshader.uid new file mode 100644 index 0000000..edc370d --- /dev/null +++ b/shaders/yellow.gdshader.uid @@ -0,0 +1 @@ +uid://ogfqc2dsl6ma diff --git a/table.tscn b/table.tscn new file mode 100644 index 0000000..c96516f --- /dev/null +++ b/table.tscn @@ -0,0 +1,134 @@ +[gd_scene load_steps=11 format=3 uid="uid://dsprg4uahkylm"] + +[ext_resource type="Texture2D" uid="uid://df2xulwx34fi" path="res://art/table.png" id="1_kl0hw"] +[ext_resource type="Script" uid="uid://82h0dmyohfj1" path="res://Table.cs" id="1_v5i0k"] + +[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_v5i0k"] +bounce = 1.0 +absorbent = true + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_v5i0k"] +radius = 74.0 +height = 264.0 + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_kl0hw"] +radius = 74.0 +height = 264.0 + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_vjl2i"] +radius = 28.75 +height = 154.0 + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_67vji"] +radius = 74.0 +height = 264.0 + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_jry6c"] +radius = 74.0 +height = 264.0 + +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bhh2s"] +radius = 28.75 +height = 154.0 + +[sub_resource type="CircleShape2D" id="CircleShape2D_v5i0k"] +radius = 28.0713 + +[node name="Table" type="Sprite2D"] +texture_filter = 1 +texture = ExtResource("1_kl0hw") +centered = false +script = ExtResource("1_v5i0k") + +[node name="Cushions" type="StaticBody2D" parent="."] +physics_material_override = SubResource("PhysicsMaterial_v5i0k") + +[node name="TL" type="CollisionPolygon2D" parent="Cushions"] +position = Vector2(404, 650) +rotation = 3.14159 +polygon = PackedVector2Array(-153, 47, -160, 26, -160, -128, 314, -127, 314, 27.9999, 292, 47) + +[node name="T" type="CollisionPolygon2D" parent="Cushions"] +position = Vector2(29, 410) +rotation = -1.5708 +polygon = PackedVector2Array(-153, 48, -171, 29, -173, -129, 314, -127, 314, 27.9999, 292, 47.9999) + +[node name="TR" type="CollisionPolygon2D" parent="Cushions"] +position = Vector2(260, 31) +polygon = PackedVector2Array(-149, 47, -169, 27, -172, -130, 303, -127, 306, 25, 292, 47) + +[node name="BR" type="CollisionPolygon2D" parent="Cushions"] +position = Vector2(783, 29) +polygon = PackedVector2Array(-153, 47, -160, 26, -160, -128, 318, -126, 320, 28, 298, 47) + +[node name="B" type="CollisionPolygon2D" parent="Cushions"] +position = Vector2(1172, 270) +rotation = 1.5708 +polygon = PackedVector2Array(-153, 47, -175, 26, -175, -138, 314, -127, 314, 25, 292, 47) + +[node name="BL" type="CollisionPolygon2D" parent="Cushions"] +position = Vector2(943, 648) +rotation = 3.14159 +polygon = PackedVector2Array(-139, 47.0001, -160, 26, -160, -128, 320, -127, 319, 28, 310, 47) + +[node name="PocketTL" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="PocketTL"] +position = Vector2(13, 717) +shape = SubResource("CapsuleShape2D_v5i0k") + +[node name="PocketTR" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="PocketTR"] +position = Vector2(13, -36) +shape = SubResource("CapsuleShape2D_kl0hw") + +[node name="PocketR" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="PocketR"] +position = Vector2(593.25, -19) +shape = SubResource("CapsuleShape2D_vjl2i") + +[node name="PocketBR" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="PocketBR"] +position = Vector2(1177, -37) +shape = SubResource("CapsuleShape2D_67vji") + +[node name="PocketBL" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="PocketBL"] +position = Vector2(1178, 715) +shape = SubResource("CapsuleShape2D_jry6c") + +[node name="PocketL" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="PocketL"] +position = Vector2(593.25, 697) +shape = SubResource("CapsuleShape2D_bhh2s") + +[node name="Pots" type="Area2D" parent="."] + +[node name="TL" type="CollisionShape2D" parent="Pots"] +position = Vector2(56, 616) +shape = SubResource("CircleShape2D_v5i0k") + +[node name="TR" type="CollisionShape2D" parent="Pots"] +position = Vector2(56, 63) +shape = SubResource("CircleShape2D_v5i0k") + +[node name="R" type="CollisionShape2D" parent="Pots"] +position = Vector2(593, 49) +shape = SubResource("CircleShape2D_v5i0k") + +[node name="BR" type="CollisionShape2D" parent="Pots"] +position = Vector2(1135, 63) +shape = SubResource("CircleShape2D_v5i0k") + +[node name="BL" type="CollisionShape2D" parent="Pots"] +position = Vector2(1135, 616) +shape = SubResource("CircleShape2D_v5i0k") + +[node name="L" type="CollisionShape2D" parent="Pots"] +position = Vector2(593, 629) +shape = SubResource("CircleShape2D_v5i0k")