From 2fdf0d644235b5ae2f72d48c3972f98d3d5f412e Mon Sep 17 00:00:00 2001 From: cojoedmo Date: Sun, 25 Jan 2026 15:01:48 -0500 Subject: [PATCH] add runwon and runlost functions, default win cards, call button that calls a loaded contact, added rotatecells, shiftcells, and swapcells functions to actor, reworked address to be 0-8 instead of 1-9, added underscore naming convention to function parameters, business cards to be slightly transparent when not met, added actions to contacts and made a couple examples --- Art/DiagonalArrow.png | Bin 0 -> 1003 bytes Art/DiagonalArrow.png.import | 34 +++++ Art/RowColArrow.png | Bin 0 -> 811 bytes Art/RowColArrow.png.import | 34 +++++ Gameplay/Actor.cs | 93 +++++++++--- Gameplay/Board.cs | 11 +- Gameplay/Boss.cs | 4 +- Gameplay/BusinessCard.cs | 8 + Gameplay/CallButton.cs | 19 +++ Gameplay/CallButton.cs.uid | 1 + Gameplay/Contact.cs | 6 +- Gameplay/Contacts/Rotate90.cs | 7 + Gameplay/Contacts/Rotate90.cs.uid | 1 + Gameplay/Contacts/ShiftBack2.cs | 7 + Gameplay/Contacts/ShiftBack2.cs.uid | 1 + Gameplay/Contacts/Swap1And6.cs | 7 + Gameplay/Contacts/Swap1And6.cs.uid | 1 + Gameplay/Dragon.cs | 4 +- Gameplay/Enemy.cs | 31 +++- Gameplay/Mook.cs | 4 +- Gameplay/Phone.cs | 27 +++- Gameplay/PhoneButton.cs | 7 + Gameplay/business_card.tscn | 1 - Gameplay/call_button.tscn | 15 ++ Gameplay/phone.tscn | 20 ++- Gameplay/player.tscn | 224 ++++++++++++++++++++-------- Player.cs | 10 ++ 27 files changed, 473 insertions(+), 104 deletions(-) create mode 100644 Art/DiagonalArrow.png create mode 100644 Art/DiagonalArrow.png.import create mode 100644 Art/RowColArrow.png create mode 100644 Art/RowColArrow.png.import create mode 100644 Gameplay/CallButton.cs create mode 100644 Gameplay/CallButton.cs.uid create mode 100644 Gameplay/Contacts/Rotate90.cs create mode 100644 Gameplay/Contacts/Rotate90.cs.uid create mode 100644 Gameplay/Contacts/ShiftBack2.cs create mode 100644 Gameplay/Contacts/ShiftBack2.cs.uid create mode 100644 Gameplay/Contacts/Swap1And6.cs create mode 100644 Gameplay/Contacts/Swap1And6.cs.uid create mode 100644 Gameplay/call_button.tscn diff --git a/Art/DiagonalArrow.png b/Art/DiagonalArrow.png new file mode 100644 index 0000000000000000000000000000000000000000..74bfbc21249fd4d88dcf28b74a704219eff7e78d GIT binary patch literal 1003 zcmVz@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vG?BLDy{BLR4&KXw2B00(qQO+^Rl0Tl%{J0EbS;{X5y zK}keGRA}Dq+RJX+MihYIe?}B_aV(osTG?(;pxLy$<{8o#>7(RP`XcQzTXkZ66 z;#;7~vUrh54mq6ZqPFT3b|FfRB)giGD3Am{%+WcA2NJw`WqAZk@<`UBfjBo0zW?s! zgL?QMe*9@2T5HG}^1senWtP?&YYb9KDvt9oAxRu_d~!mbYdUR@PN#!gt35185-0qz zf50z;0RUZp$O~9HMwUnH^ZVuHsa@sL?C-x^DnXS_K+ znIHhhS`&mJp6AWn9n9VBmBGAz_m0e3lrh{qV{8omXhcz%#dp86V1lB!^B#pU%#(rd zt^b}Db7$v}Yy6?l=d~JA%H=`k#q`sZXf&crcQxJ+uQ6YAyX-U?Q(u=^OV9U-<9M}R zb(PBKC&|?37uFKz89LXi0htuLqazYiE(d%GpSe}!)y*p< ztK2BhiAE#Le-zJ8T1T228|>}v;%#pcMiJxq?~HX3MGVuF;gsRxYfTW1=;nE;dD*=| zgb>sl4eE^st*tGLwMZ%14FZ%>^aqzjNy2^@;$H1ic1QTcN|g?+PckB`I1ZJo&tAI? zK)cf+SBkHqh%C!7#?beNT#REPttTjJE!r4Vn$l=CmkYUVxvq=rx->U7u+~x(1)X-A zG))Mi2$f}|SNKSsX=wo*;w%1#>BkTqltSwmK0eN;zo{n|a}6X0QUx2^yH002ovPDHLkV1lV%!)pKl literal 0 HcmV?d00001 diff --git a/Art/DiagonalArrow.png.import b/Art/DiagonalArrow.png.import new file mode 100644 index 0000000..778d5f9 --- /dev/null +++ b/Art/DiagonalArrow.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dvu33m28odcl0" +path="res://.godot/imported/DiagonalArrow.png-81a7e688d85f1b93e37b2dd52d3288e3.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Art/DiagonalArrow.png" +dest_files=["res://.godot/imported/DiagonalArrow.png-81a7e688d85f1b93e37b2dd52d3288e3.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/RowColArrow.png b/Art/RowColArrow.png new file mode 100644 index 0000000000000000000000000000000000000000..6327611927386f89ef1cab34c7b2fc4da073ef0b GIT binary patch literal 811 zcmV+`1JwM9P)z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy32;bRa{vG?BLDy{BLR4&KXw2B00(qQO+^Rl0Tl%`9FbQ*O8@`@ zfk{L`RCwC$-A_-`a2&_+Pq%I@+o0|K#9@&pj$u~EW<2OPc#)XMv+$wtPI=AkQp}ugDAA`SHgj1>EX-X>+d&Ou(Y$22*6Z1MgR~9Fc*9Bn-5!W znFum(cW<9F2*45xxXUFL{*NR{lq7$Dm}ps+EX!g*1d?sX!=Vm`$I4B_FfvAic3aKI z%S6HwE8C1Q`ZgNr^y1?3>-%`Dk4H!PadyUl2m~MyfIt8O0SE*DfdB*o5C}jZ0D%Am z0uTs5AOL{?1Oi|ZH%$E_SKT#e%nIzG*LgdKn2bo1d=vI$I;7; z4MnBW+&`>0QKVX<&M*lio$NwELAj*-92@LjqoLMXi;s5+B;9)5t|~WtkuT=+s(MQd zk3iDTvMlvhR&KWMa9yoN5yK;pYy`5p`sDh17t2z&^_0O8NQU+zwypPZ=UUI*?)O!1 zG#DCzWauoC%jr?GsdvxTuY8`D&#SyxVPFK3&860Y>&mxhU-7f`qR;hK1d?6VdVS`G zeQmL#0&x&X<|7Gwg;OpaS&t$u%=t@25J+nH)v8`SkJWUX%g1`Pnmo^AI0OPo@_b*V z-`7{gzOQbl!v%>1f=RFYJ%z5Tvg@kou=ltRxMAuZaa>nhn*;tQA%S4#DV+-uSz-YM p0;Fw;wY#^^L;%hp0D%Cv_6w%ZWgh0t#`ORI002ovPDHLkV1l97U}yjU literal 0 HcmV?d00001 diff --git a/Art/RowColArrow.png.import b/Art/RowColArrow.png.import new file mode 100644 index 0000000..12c9140 --- /dev/null +++ b/Art/RowColArrow.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c6q55ex5d5wgi" +path="res://.godot/imported/RowColArrow.png-e5c500cb2d2a9e324ea87decae2d824d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Art/RowColArrow.png" +dest_files=["res://.godot/imported/RowColArrow.png-e5c500cb2d2a9e324ea87decae2d824d.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/Gameplay/Actor.cs b/Gameplay/Actor.cs index 30c8137..7c72a66 100644 --- a/Gameplay/Actor.cs +++ b/Gameplay/Actor.cs @@ -2,7 +2,7 @@ using Godot; using System; using System.Collections.Generic; using System.Linq; -using System.Security.Cryptography.X509Certificates; + public partial class Actor : Sprite2D { @@ -17,23 +17,80 @@ public partial class Actor : Sprite2D _markFocused = GetNode("MarkFocused"); } - // public List> CheckGoals() - // { - // List ownedCells = _board._cells.Where(c=>c._marker == this).ToList(); - // List ownedCellAddresses = ownedCells.Select(c=>c._address).ToList(); - // string ownedCellAddressesString = string.Join("",ownedCellAddresses); + // CALLABLE ACTIONS - // List> goalsMet = new(); - // for (int i = 0; i < _goal._eligibleGoals.Count; i++) - // { - // Goal.GoalName goalName = _goal._eligibleGoals[i]; - // List goal = _goal._conditions[goalName]; - // if (goal.All(n=>ownedCellAddresses.Contains(n))) - // { - // goalsMet.Add(goal); - // } - // } - // return goalsMet; - // } + public bool RotateCells(int ROTATIONS = 1, bool JUST_MARKS = false) + { + List positions = new(_board._cells.Select(c=>c.Position).ToList()); + List addresses = new(_board._cells.Select(c=>c._address).ToList()); + Dictionary cwShifts = new() + { + {0,1}, {1,2}, {2,5}, {3,0}, {4,4}, {5,8}, {6,3}, {7,6}, {8,7} + }; + Dictionary ccwShifts = new() + { + {0,3}, {1,0}, {2,1}, {3,6}, {4,4}, {5,2}, {6,7}, {7,8}, {8,5} + }; + Dictionary shifts = ROTATIONS > 0 ? cwShifts : ccwShifts; + + for (int i = 0; i < Math.Abs(ROTATIONS); i++) + { + for (int j = 0; j < addresses.Count; j++) + { + int address = addresses[j]; + int newAddress = shifts[address]; + addresses[j] = newAddress; + } + } + + for (int i = 0; i < _board._cells.Count; i++) + { + int newCellAddress = addresses[i]; + _board._cells[i].Position = positions[newCellAddress]; + } + + _board.RenumberCells(); + return true; + } + + public bool ShiftCells(int SHIFT_SPOTS = 1) + { + List positions = new(_board._cells.Select(c=>c.Position).ToList()); + int start = SHIFT_SPOTS > 0 ? 0 : 9; + for (int i = 0; i < _board._cells.Count; i++) + { + int newSpot = (start + i + SHIFT_SPOTS) % 9; + _board._cells[i].Position = positions[newSpot]; + } + _board.RenumberCells(); + return true; + } + + public bool SwapCells(int CELL_A_ADDRESS = -1, int CELL_B_ADDRESS = -1) + { + if (CELL_A_ADDRESS < -1 || CELL_A_ADDRESS > 8 || CELL_B_ADDRESS < -1 || CELL_B_ADDRESS > 8) + { + return false; + } + List positions = new(_board._cells.Select(c=>c.Position).ToList()); + Random random = new (); + if (CELL_A_ADDRESS == -1) + { + CELL_A_ADDRESS = random.Next(8); + } + if (CELL_B_ADDRESS == -1) + { + CELL_B_ADDRESS = random.Next(8); + while (CELL_B_ADDRESS == CELL_A_ADDRESS) + { + CELL_B_ADDRESS = random.Next(8); + } + } + _board._cells[CELL_A_ADDRESS].Position = positions[CELL_B_ADDRESS]; + _board._cells[CELL_B_ADDRESS].Position = positions[CELL_A_ADDRESS]; + _board.RenumberCells(); + + return true; + } } diff --git a/Gameplay/Board.cs b/Gameplay/Board.cs index 91a507f..b73cd00 100644 --- a/Gameplay/Board.cs +++ b/Gameplay/Board.cs @@ -17,7 +17,7 @@ public partial class Board : Sprite2D _cells = GetChildren().Where(c=>c is Cell).Cast().ToList(); for (int i = 0; i < _cells.Count; i++) { - _cells[i]._address = i+1; + _cells[i]._address = i; } } @@ -88,12 +88,15 @@ public partial class Board : Sprite2D public void RenumberCells() { - _cells.OrderBy(c => c.Position.X).ThenBy(c => c.Position.Y).ToList(); + GD.Print(string.Join(", ", _cells.Select(c=>c._address))); + _cells = _cells.OrderBy(c => c.Position.Y).ThenBy(c => c.Position.X).ToList(); + GD.Print(string.Join(", ", _cells.Select(c=>c._address))); + for (int i = 0; i < _cells.Count; i++) { - Cell cell = _cells[i]; - cell._address = i; + _cells[i]._address = i; } + } public void Start() diff --git a/Gameplay/Boss.cs b/Gameplay/Boss.cs index f46db13..237ae7c 100644 --- a/Gameplay/Boss.cs +++ b/Gameplay/Boss.cs @@ -26,9 +26,9 @@ public partial class Boss : Enemy _dragons.ForEach(d=>d.PassPlayer(PLAYER)); } - public override void ClickCell(Cell CLICKEDCELL) + public override void ClickCell(Cell CLICKED_CELL) { - _playerOpponent.Challenge(CLICKEDCELL._tenant); + _playerOpponent.Challenge(CLICKED_CELL._tenant); } } diff --git a/Gameplay/BusinessCard.cs b/Gameplay/BusinessCard.cs index e8505c2..fc447fc 100644 --- a/Gameplay/BusinessCard.cs +++ b/Gameplay/BusinessCard.cs @@ -43,6 +43,14 @@ public partial class BusinessCard : TextureButton List ownedCells = _player._board.GetCellsByOwner(_player); List addresses = _goal.GetAddresses(_goalName); _goalMet = addresses.All(a=>ownedCells.Select(c=>c._address).ToList().IndexOf(a)>-1); + if (_goalMet) + { + Modulate = new Color(1,1,1,1); + } + else + { + Modulate = new Color(1,1,1,0.3f); + } } public void PassPlayer(Player PLAYER) diff --git a/Gameplay/CallButton.cs b/Gameplay/CallButton.cs new file mode 100644 index 0000000..2abbe44 --- /dev/null +++ b/Gameplay/CallButton.cs @@ -0,0 +1,19 @@ +using Godot; +using System; + +public partial class CallButton : TextureButton +{ + public bool _isHovered = false; + public Phone _phone; + + public override void _Ready() + { + base._Ready(); + } + + public override void _Pressed() + { + base._Pressed(); + _phone.CallLoadedContact(); + } +} diff --git a/Gameplay/CallButton.cs.uid b/Gameplay/CallButton.cs.uid new file mode 100644 index 0000000..5258077 --- /dev/null +++ b/Gameplay/CallButton.cs.uid @@ -0,0 +1 @@ +uid://bis1fw8peln2x diff --git a/Gameplay/Contact.cs b/Gameplay/Contact.cs index 685a5d1..072407f 100644 --- a/Gameplay/Contact.cs +++ b/Gameplay/Contact.cs @@ -11,6 +11,11 @@ public partial class Contact : Sprite2D } + public virtual void CallAction() + { + + } + public void PassNumber(int NUMBER) { _number = NUMBER; @@ -19,5 +24,4 @@ public partial class Contact : Sprite2D { _player = PLAYER; } - } diff --git a/Gameplay/Contacts/Rotate90.cs b/Gameplay/Contacts/Rotate90.cs new file mode 100644 index 0000000..61cf504 --- /dev/null +++ b/Gameplay/Contacts/Rotate90.cs @@ -0,0 +1,7 @@ +public partial class Rotate90 : Contact +{ + public override void CallAction() + { + _player.RotateCells(2); + } +} \ No newline at end of file diff --git a/Gameplay/Contacts/Rotate90.cs.uid b/Gameplay/Contacts/Rotate90.cs.uid new file mode 100644 index 0000000..7eb66ed --- /dev/null +++ b/Gameplay/Contacts/Rotate90.cs.uid @@ -0,0 +1 @@ +uid://dtv3bqpuf0y33 diff --git a/Gameplay/Contacts/ShiftBack2.cs b/Gameplay/Contacts/ShiftBack2.cs new file mode 100644 index 0000000..da6b159 --- /dev/null +++ b/Gameplay/Contacts/ShiftBack2.cs @@ -0,0 +1,7 @@ +public partial class ShiftBack2 : Contact +{ + public override void CallAction() + { + _player.ShiftCells(-2); + } +} \ No newline at end of file diff --git a/Gameplay/Contacts/ShiftBack2.cs.uid b/Gameplay/Contacts/ShiftBack2.cs.uid new file mode 100644 index 0000000..be11010 --- /dev/null +++ b/Gameplay/Contacts/ShiftBack2.cs.uid @@ -0,0 +1 @@ +uid://c14om0rrrui02 diff --git a/Gameplay/Contacts/Swap1And6.cs b/Gameplay/Contacts/Swap1And6.cs new file mode 100644 index 0000000..2412c80 --- /dev/null +++ b/Gameplay/Contacts/Swap1And6.cs @@ -0,0 +1,7 @@ +public partial class Swap1And6 : Contact +{ + public override void CallAction() + { + _player.SwapCells(1-1,6-1); + } +} \ No newline at end of file diff --git a/Gameplay/Contacts/Swap1And6.cs.uid b/Gameplay/Contacts/Swap1And6.cs.uid new file mode 100644 index 0000000..d3d3d24 --- /dev/null +++ b/Gameplay/Contacts/Swap1And6.cs.uid @@ -0,0 +1 @@ +uid://bl37rkfpucd5e diff --git a/Gameplay/Dragon.cs b/Gameplay/Dragon.cs index dc4bae1..b10611f 100644 --- a/Gameplay/Dragon.cs +++ b/Gameplay/Dragon.cs @@ -35,8 +35,8 @@ public partial class Dragon : Enemy } - public override void ClickCell(Cell CLICKEDCELL) + public override void ClickCell(Cell CLICKED_CELL) { - _playerOpponent.Challenge(CLICKEDCELL._tenant); + _playerOpponent.Challenge(CLICKED_CELL._tenant); } } diff --git a/Gameplay/Enemy.cs b/Gameplay/Enemy.cs index 9ee351a..8e84e3c 100644 --- a/Gameplay/Enemy.cs +++ b/Gameplay/Enemy.cs @@ -10,6 +10,8 @@ public partial class Enemy : Actor public Cell _cell; public Enemy _owner; public List _defaultGoals = new(); + public List _goals = new(); + public override void _Ready() { @@ -49,20 +51,35 @@ public partial class Enemy : Actor } } - public virtual void ClickCell(Cell CLICKEDCELL) + public virtual void ClickCell(Cell CLICKED_CELL) { } - public void Defeat(GoalName WINNINGPATTERN) + public void Defeat(GoalName WINNING_PATTERN) { - _board._winningPattern = WINNINGPATTERN; - _owner._board.GetCellByTenant(this).Mark(_playerOpponent); + _board._winningPattern = WINNING_PATTERN; + if (_owner != null) + { + _owner._board.GetCellByTenant(this).Mark(_playerOpponent); + } + else + { + _playerOpponent.RunWon(); + } } - public void Victory(GoalName WINNINGPATTERN) + public void Victory(GoalName WINNING_PATTERN) { - _board._winningPattern = WINNINGPATTERN; - _owner._board.GetCellByTenant(this).Mark(this); + _board._winningPattern = WINNING_PATTERN; + if (_owner != null) + { + _owner._board.GetCellByTenant(this).Mark(this); + } + else + { + _playerOpponent.RunLost(); + } + } } diff --git a/Gameplay/Mook.cs b/Gameplay/Mook.cs index eb888ea..945b351 100644 --- a/Gameplay/Mook.cs +++ b/Gameplay/Mook.cs @@ -12,9 +12,9 @@ public partial class Mook : Enemy } - public override void ClickCell(Cell CLICKEDCELL) + public override void ClickCell(Cell CLICKED_CELL) { - CLICKEDCELL.Mark(_playerOpponent); + CLICKED_CELL.Mark(_playerOpponent); _playerOpponent.CheckGoals(); } } diff --git a/Gameplay/Phone.cs b/Gameplay/Phone.cs index 386b599..4c0e3eb 100644 --- a/Gameplay/Phone.cs +++ b/Gameplay/Phone.cs @@ -8,20 +8,39 @@ public partial class Phone : Sprite2D public PhoneButton _hoveredButton; public List _phoneButtons = new(); public Player _player; + public Contact _loadedContact; + public CallButton _callButton; + public RichTextLabel _debug; public override void _Ready() { + _debug = GetNode("Debug"); + _callButton = GetNode("CallButton"); + _callButton._phone = this; _phoneButtons = GetChildren().Where(c=>c is PhoneButton).Cast().ToList(); for (int i = 0; i < _phoneButtons.Count; i++) { _phoneButtons[i]._phone = this; } + _phoneButtons[0]._contact = new ShiftBack2(); + _phoneButtons[1]._contact = new Rotate90(); + _phoneButtons[2]._contact = new Swap1And6(); } public override void _Process(double DELTA_) { // _hoveredButton = _phoneButtons.FirstOrDefault(c => c._isHovered, null); + } - + public void CallLoadedContact() + { + _loadedContact.CallAction(); + ResetContact(); + } + + public void LoadContact(Contact CONTACT) + { + _loadedContact = CONTACT; + _debug.Text = _loadedContact.GetType().ToString(); } public void PassPlayer(Player PLAYER) @@ -34,4 +53,10 @@ public partial class Phone : Sprite2D _phoneButtons[i]._contact.PassNumber((i+1)%10); } } + + public void ResetContact() + { + // _loadedContact = null; + // _debug.Text = ""; + } } diff --git a/Gameplay/PhoneButton.cs b/Gameplay/PhoneButton.cs index 0dafe91..2b1667a 100644 --- a/Gameplay/PhoneButton.cs +++ b/Gameplay/PhoneButton.cs @@ -15,6 +15,13 @@ public partial class PhoneButton : TextureButton _contact = GetNode("Contact"); } + public override void _Pressed() + { + base._Pressed(); + _phone.LoadContact(_contact); + } + + // private void OnMouseEntered() // { diff --git a/Gameplay/business_card.tscn b/Gameplay/business_card.tscn index ec6c354..3630568 100644 --- a/Gameplay/business_card.tscn +++ b/Gameplay/business_card.tscn @@ -5,7 +5,6 @@ [ext_resource type="PackedScene" uid="uid://tk7fjdvu5c0u" path="res://Gameplay/goal.tscn" id="3_ejro6"] [node name="BusinessCard" type="TextureButton"] -modulate = Color(1, 1, 1, 0.2) texture_normal = ExtResource("1_8xr8s") texture_pressed = ExtResource("1_8xr8s") texture_hover = ExtResource("1_8xr8s") diff --git a/Gameplay/call_button.tscn b/Gameplay/call_button.tscn new file mode 100644 index 0000000..f8a7f09 --- /dev/null +++ b/Gameplay/call_button.tscn @@ -0,0 +1,15 @@ +[gd_scene load_steps=3 format=3 uid="uid://dh1oddbsjpysy"] + +[ext_resource type="Texture2D" uid="uid://4hculjnuw6ha" path="res://Art/capsule-fill.svg" id="1_r2s83"] +[ext_resource type="Script" uid="uid://bis1fw8peln2x" path="res://Gameplay/CallButton.cs" id="2_r2s83"] + +[node name="CallButton" type="TextureButton"] +modulate = Color(1, 1, 1, 0.2) +offset_right = 800.0 +offset_bottom = 800.0 +texture_normal = ExtResource("1_r2s83") +texture_pressed = ExtResource("1_r2s83") +texture_hover = ExtResource("1_r2s83") +texture_disabled = ExtResource("1_r2s83") +texture_focused = ExtResource("1_r2s83") +script = ExtResource("2_r2s83") diff --git a/Gameplay/phone.tscn b/Gameplay/phone.tscn index 10c621a..ee2ea3e 100644 --- a/Gameplay/phone.tscn +++ b/Gameplay/phone.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=4 format=3 uid="uid://yaybgshgeb3d"] +[gd_scene load_steps=5 format=3 uid="uid://yaybgshgeb3d"] [ext_resource type="Texture2D" uid="uid://buee5y051op2" path="res://Art/phone.png" id="1_lrxfg"] [ext_resource type="PackedScene" uid="uid://dj6cr426bn30b" path="res://Gameplay/phone_button.tscn" id="2_pr3bu"] [ext_resource type="Script" uid="uid://dgmkhlit1vnf3" path="res://Gameplay/Phone.cs" id="2_ujt17"] +[ext_resource type="PackedScene" uid="uid://dh1oddbsjpysy" path="res://Gameplay/call_button.tscn" id="4_e164q"] [node name="Phone" type="Sprite2D"] texture = ExtResource("1_lrxfg") @@ -77,3 +78,20 @@ offset_top = 565.0 offset_right = 759.0 offset_bottom = 1365.0 scale = Vector2(0.13, 0.13) + +[node name="CallButton" parent="." instance=ExtResource("4_e164q")] +offset_left = -199.0 +offset_top = 123.0 +offset_right = 601.0 +offset_bottom = 923.0 +scale = Vector2(0.13, 0.13) + +[node name="Debug" type="RichTextLabel" parent="."] +offset_left = -209.0 +offset_top = -339.0 +offset_right = 225.0 +offset_bottom = -30.0 +theme_override_font_sizes/normal_font_size = 48 +text = "DEBUG" +horizontal_alignment = 1 +vertical_alignment = 1 diff --git a/Gameplay/player.tscn b/Gameplay/player.tscn index 009c7b8..bc26602 100644 --- a/Gameplay/player.tscn +++ b/Gameplay/player.tscn @@ -1,10 +1,12 @@ -[gd_scene load_steps=6 format=3 uid="uid://b7vhq2dkltsv"] +[gd_scene load_steps=8 format=3 uid="uid://b7vhq2dkltsv"] [ext_resource type="Texture2D" uid="uid://c51oi06i4yrvv" path="res://Art/x.png" id="1_c6108"] [ext_resource type="Script" uid="uid://dth2vcgkp7iq0" path="res://Player.cs" id="1_enp12"] [ext_resource type="PackedScene" uid="uid://yaybgshgeb3d" path="res://Gameplay/phone.tscn" id="4_1d6nn"] [ext_resource type="PackedScene" uid="uid://b0ks34m6smjfd" path="res://Gameplay/business_card.tscn" id="5_ek8wa"] [ext_resource type="PackedScene" uid="uid://bmy783a4c0tal" path="res://Gameplay/boss.tscn" id="5_lfxdo"] +[ext_resource type="Texture2D" uid="uid://dvu33m28odcl0" path="res://Art/DiagonalArrow.png" id="6_ehowo"] +[ext_resource type="Texture2D" uid="uid://c6q55ex5d5wgi" path="res://Art/RowColArrow.png" id="7_cbnuf"] [node name="Player" type="Sprite2D"] script = ExtResource("1_enp12") @@ -51,100 +53,192 @@ offset_right = 298.0 offset_bottom = 969.0 [node name="DefaultDiagonal1To9" parent="." instance=ExtResource("5_ek8wa")] -offset_left = 461.0 -offset_top = 41.0 -offset_right = 661.0 -offset_bottom = 241.0 +offset_left = 610.0 +offset_top = 190.0 +offset_right = 660.0 +offset_bottom = 240.0 +texture_normal = ExtResource("6_ehowo") +texture_pressed = ExtResource("6_ehowo") +texture_hover = ExtResource("6_ehowo") +texture_disabled = ExtResource("6_ehowo") +texture_focused = ExtResource("6_ehowo") [node name="DefaultTopRow" parent="." instance=ExtResource("5_ek8wa")] -offset_left = 467.0 -offset_top = 236.0 -offset_right = 667.0 -offset_bottom = 436.0 +offset_left = 610.0 +offset_top = 440.0 +offset_right = 810.0 +offset_bottom = 490.0 +rotation = 4.71239 +texture_normal = ExtResource("7_cbnuf") +texture_pressed = ExtResource("7_cbnuf") +texture_hover = ExtResource("7_cbnuf") +texture_disabled = ExtResource("7_cbnuf") +texture_focused = ExtResource("7_cbnuf") [node name="DefaultMiddleRow" parent="." instance=ExtResource("5_ek8wa")] -offset_left = 461.0 -offset_top = 437.0 -offset_right = 661.0 -offset_bottom = 637.0 +offset_left = 610.0 +offset_top = 640.0 +offset_right = 810.0 +offset_bottom = 690.0 +rotation = 4.71239 +texture_normal = ExtResource("7_cbnuf") +texture_pressed = ExtResource("7_cbnuf") +texture_hover = ExtResource("7_cbnuf") +texture_disabled = ExtResource("7_cbnuf") +texture_focused = ExtResource("7_cbnuf") [node name="DefaultBottomRow" parent="." instance=ExtResource("5_ek8wa")] -offset_left = 458.0 -offset_top = 637.0 -offset_right = 658.0 -offset_bottom = 837.0 +offset_left = 610.0 +offset_top = 840.0 +offset_right = 810.0 +offset_bottom = 890.0 +rotation = 4.71239 +texture_normal = ExtResource("7_cbnuf") +texture_pressed = ExtResource("7_cbnuf") +texture_hover = ExtResource("7_cbnuf") +texture_disabled = ExtResource("7_cbnuf") +texture_focused = ExtResource("7_cbnuf") [node name="DefaultLeftColumn" parent="." instance=ExtResource("5_ek8wa")] -offset_left = 665.0 -offset_top = 38.0 -offset_right = 865.0 -offset_bottom = 238.0 +offset_left = 660.0 +offset_top = 190.0 +offset_right = 860.0 +offset_bottom = 240.0 +texture_normal = ExtResource("7_cbnuf") +texture_pressed = ExtResource("7_cbnuf") +texture_hover = ExtResource("7_cbnuf") +texture_disabled = ExtResource("7_cbnuf") +texture_focused = ExtResource("7_cbnuf") [node name="DefaultMiddleColumn" parent="." instance=ExtResource("5_ek8wa")] -offset_left = 863.0 -offset_top = 35.0 -offset_right = 1063.0 -offset_bottom = 235.0 +offset_left = 860.0 +offset_top = 190.0 +offset_right = 1060.0 +offset_bottom = 240.0 +texture_normal = ExtResource("7_cbnuf") +texture_pressed = ExtResource("7_cbnuf") +texture_hover = ExtResource("7_cbnuf") +texture_disabled = ExtResource("7_cbnuf") +texture_focused = ExtResource("7_cbnuf") [node name="DefaultRightColumn" parent="." instance=ExtResource("5_ek8wa")] -offset_left = 1061.0 -offset_top = 41.0 -offset_right = 1261.0 -offset_bottom = 241.0 +offset_left = 1060.0 +offset_top = 190.0 +offset_right = 1260.0 +offset_bottom = 240.0 +texture_normal = ExtResource("7_cbnuf") +texture_pressed = ExtResource("7_cbnuf") +texture_hover = ExtResource("7_cbnuf") +texture_disabled = ExtResource("7_cbnuf") +texture_focused = ExtResource("7_cbnuf") [node name="DefaultDiagonal3To7" parent="." instance=ExtResource("5_ek8wa")] -offset_left = 1264.0 -offset_top = 44.0 -offset_right = 1464.0 -offset_bottom = 244.0 +offset_left = 1310.0 +offset_top = 190.0 +offset_right = 1360.0 +offset_bottom = 240.0 +rotation = 1.5708 +texture_normal = ExtResource("6_ehowo") +texture_pressed = ExtResource("6_ehowo") +texture_hover = ExtResource("6_ehowo") +texture_disabled = ExtResource("6_ehowo") +texture_focused = ExtResource("6_ehowo") [node name="DefaultTopRowAlt" parent="." instance=ExtResource("5_ek8wa")] -offset_left = 1261.0 -offset_top = 236.0 -offset_right = 1461.0 -offset_bottom = 436.0 +offset_left = 1310.0 +offset_top = 240.0 +offset_right = 1510.0 +offset_bottom = 290.0 +rotation = 1.5708 +texture_normal = ExtResource("7_cbnuf") +texture_pressed = ExtResource("7_cbnuf") +texture_hover = ExtResource("7_cbnuf") +texture_disabled = ExtResource("7_cbnuf") +texture_focused = ExtResource("7_cbnuf") [node name="DefaultMiddleRowAlt" parent="." instance=ExtResource("5_ek8wa")] -offset_left = 1255.0 -offset_top = 434.0 -offset_right = 1455.0 -offset_bottom = 634.0 +offset_left = 1310.0 +offset_top = 440.0 +offset_right = 1510.0 +offset_bottom = 490.0 +rotation = 1.5708 +texture_normal = ExtResource("7_cbnuf") +texture_pressed = ExtResource("7_cbnuf") +texture_hover = ExtResource("7_cbnuf") +texture_disabled = ExtResource("7_cbnuf") +texture_focused = ExtResource("7_cbnuf") [node name="DefaultBottomRowAlt" parent="." instance=ExtResource("5_ek8wa")] -offset_left = 1261.0 -offset_top = 628.0 -offset_right = 1461.0 -offset_bottom = 828.0 +offset_left = 1310.0 +offset_top = 640.0 +offset_right = 1510.0 +offset_bottom = 690.0 +rotation = 1.5708 +texture_normal = ExtResource("7_cbnuf") +texture_pressed = ExtResource("7_cbnuf") +texture_hover = ExtResource("7_cbnuf") +texture_disabled = ExtResource("7_cbnuf") +texture_focused = ExtResource("7_cbnuf") [node name="DefaultDiagonal1To9Alt" parent="." instance=ExtResource("5_ek8wa")] -offset_left = 1264.0 -offset_top = 826.0 -offset_right = 1464.0 -offset_bottom = 1026.0 +offset_left = 1310.0 +offset_top = 890.0 +offset_right = 1360.0 +offset_bottom = 940.0 +rotation = 3.14159 +texture_normal = ExtResource("6_ehowo") +texture_pressed = ExtResource("6_ehowo") +texture_hover = ExtResource("6_ehowo") +texture_disabled = ExtResource("6_ehowo") +texture_focused = ExtResource("6_ehowo") [node name="DefaultDiagonal3To7Alt" parent="." instance=ExtResource("5_ek8wa")] -offset_left = 467.0 -offset_top = 829.0 -offset_right = 667.0 -offset_bottom = 1029.0 +offset_left = 610.0 +offset_top = 890.0 +offset_right = 660.0 +offset_bottom = 940.0 +rotation = 4.71239 +texture_normal = ExtResource("6_ehowo") +texture_pressed = ExtResource("6_ehowo") +texture_hover = ExtResource("6_ehowo") +texture_disabled = ExtResource("6_ehowo") +texture_focused = ExtResource("6_ehowo") [node name="DefaultLeftColumnAlt" parent="." instance=ExtResource("5_ek8wa")] -offset_left = 665.0 -offset_top = 838.0 -offset_right = 865.0 -offset_bottom = 1038.0 +offset_left = 860.0 +offset_top = 890.0 +offset_right = 1060.0 +offset_bottom = 940.0 +rotation = 3.14159 +texture_normal = ExtResource("7_cbnuf") +texture_pressed = ExtResource("7_cbnuf") +texture_hover = ExtResource("7_cbnuf") +texture_disabled = ExtResource("7_cbnuf") +texture_focused = ExtResource("7_cbnuf") [node name="DefaultMiddleColumnAlt" parent="." instance=ExtResource("5_ek8wa")] -offset_left = 869.0 -offset_top = 838.0 -offset_right = 1069.0 -offset_bottom = 1038.0 +offset_left = 1062.0 +offset_top = 889.0 +offset_right = 1262.0 +offset_bottom = 939.0 +rotation = 3.14159 +texture_normal = ExtResource("7_cbnuf") +texture_pressed = ExtResource("7_cbnuf") +texture_hover = ExtResource("7_cbnuf") +texture_disabled = ExtResource("7_cbnuf") +texture_focused = ExtResource("7_cbnuf") [node name="DefaultRightColumnAlt" parent="." instance=ExtResource("5_ek8wa")] -offset_left = 1064.0 -offset_top = 838.0 -offset_right = 1264.0 -offset_bottom = 1038.0 +offset_left = 1260.0 +offset_top = 890.0 +offset_right = 1460.0 +offset_bottom = 940.0 +rotation = 3.14159 +texture_normal = ExtResource("7_cbnuf") +texture_pressed = ExtResource("7_cbnuf") +texture_hover = ExtResource("7_cbnuf") +texture_disabled = ExtResource("7_cbnuf") +texture_focused = ExtResource("7_cbnuf") [node name="BusDebug" type="RichTextLabel" parent="."] offset_top = 276.0 diff --git a/Player.cs b/Player.cs index 5b85234..5c3e9a1 100644 --- a/Player.cs +++ b/Player.cs @@ -72,6 +72,16 @@ public partial class Player : Actor _businessCards.ForEach(b=>b.CheckGoal()); } + public void RunLost() + { + _debug.Text = "YOU LOSE!!"; + } + + public void RunWon() + { + _debug.Text = "YOU WIN!!"; + } + // public bool CheckWin(List CELLS) // { // foreach (Goal.GoalName cond in _goal._eligibleGoals)