commit e2b7d6616a7cf4100bac489bb28036740f8e8eb6 Author: cojoedmo Date: Mon Jan 19 17:44:00 2026 -0500 first commit diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f28239b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +root = true + +[*] +charset = utf-8 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0af181c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Godot 4+ specific ignores +.godot/ +/android/ diff --git a/Art/Tic-tac-toe.png b/Art/Tic-tac-toe.png new file mode 100644 index 0000000..5dfe8ad Binary files /dev/null and b/Art/Tic-tac-toe.png differ diff --git a/Art/Tic-tac-toe.png.import b/Art/Tic-tac-toe.png.import new file mode 100644 index 0000000..c63fd2b --- /dev/null +++ b/Art/Tic-tac-toe.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cbi83mc26qju5" +path="res://.godot/imported/Tic-tac-toe.png-124c283de8ae3fec6b00fa460f45b890.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Art/Tic-tac-toe.png" +dest_files=["res://.godot/imported/Tic-tac-toe.png-124c283de8ae3fec6b00fa460f45b890.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/blanksquare.jpg b/Art/blanksquare.jpg new file mode 100644 index 0000000..6185139 Binary files /dev/null and b/Art/blanksquare.jpg differ diff --git a/Art/blanksquare.jpg.import b/Art/blanksquare.jpg.import new file mode 100644 index 0000000..d26ccb3 --- /dev/null +++ b/Art/blanksquare.jpg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://g6ikqlh8yccy" +path="res://.godot/imported/blanksquare.jpg-074e223996abdade08f7c7e2077f162b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Art/blanksquare.jpg" +dest_files=["res://.godot/imported/blanksquare.jpg-074e223996abdade08f7c7e2077f162b.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/capsule-fill.svg b/Art/capsule-fill.svg new file mode 100644 index 0000000..189471c --- /dev/null +++ b/Art/capsule-fill.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Art/capsule-fill.svg.import b/Art/capsule-fill.svg.import new file mode 100644 index 0000000..4c31edb --- /dev/null +++ b/Art/capsule-fill.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://4hculjnuw6ha" +path="res://.godot/imported/capsule-fill.svg-687ac6d9d63ced250c1ffed0514dfe5a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Art/capsule-fill.svg" +dest_files=["res://.godot/imported/capsule-fill.svg-687ac6d9d63ced250c1ffed0514dfe5a.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 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/Art/o.png b/Art/o.png new file mode 100644 index 0000000..14f6907 Binary files /dev/null and b/Art/o.png differ diff --git a/Art/o.png.import b/Art/o.png.import new file mode 100644 index 0000000..6fa7f92 --- /dev/null +++ b/Art/o.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c66iv1bte8b4e" +path="res://.godot/imported/o.png-afa2cd026f8e3ea6ed9073b821f7348f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Art/o.png" +dest_files=["res://.godot/imported/o.png-afa2cd026f8e3ea6ed9073b821f7348f.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/phone.png b/Art/phone.png new file mode 100644 index 0000000..8760dce Binary files /dev/null and b/Art/phone.png differ diff --git a/Art/phone.png.import b/Art/phone.png.import new file mode 100644 index 0000000..b772bd8 --- /dev/null +++ b/Art/phone.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://buee5y051op2" +path="res://.godot/imported/phone.png-4c40ee9da2ebfbc855946257b18d24f6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Art/phone.png" +dest_files=["res://.godot/imported/phone.png-4c40ee9da2ebfbc855946257b18d24f6.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/x.png b/Art/x.png new file mode 100644 index 0000000..be7426f Binary files /dev/null and b/Art/x.png differ diff --git a/Art/x.png.import b/Art/x.png.import new file mode 100644 index 0000000..590a79d --- /dev/null +++ b/Art/x.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c51oi06i4yrvv" +path="res://.godot/imported/x.png-b81db823f0c10cab833de01227d2dba8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Art/x.png" +dest_files=["res://.godot/imported/x.png-b81db823f0c10cab833de01227d2dba8.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 new file mode 100644 index 0000000..8ffb0ea --- /dev/null +++ b/Gameplay/Actor.cs @@ -0,0 +1,40 @@ +using Godot; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Cryptography.X509Certificates; + +public partial class Actor : Sprite2D +{ + public Sprite2D _markNormal, _markPressed, _markHovered, _markDisabled, _markFocused; + public Goal _goal; + public Board _board; + public override void _Ready() + { + _markNormal = GetNode("MarkNormal"); + _markPressed = GetNode("MarkPressed"); + _markHovered = GetNode("MarkHovered"); + _markDisabled = GetNode("MarkDisabled"); + _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); + + // 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; + // } + +} diff --git a/Gameplay/Actor.cs.uid b/Gameplay/Actor.cs.uid new file mode 100644 index 0000000..d74c343 --- /dev/null +++ b/Gameplay/Actor.cs.uid @@ -0,0 +1 @@ +uid://bfmn75cttwhto diff --git a/Gameplay/Board.cs b/Gameplay/Board.cs new file mode 100644 index 0000000..31ad11a --- /dev/null +++ b/Gameplay/Board.cs @@ -0,0 +1,112 @@ +using Godot; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Runtime.Serialization; + +public partial class Board : Sprite2D +{ + public bool _active = false, _moveMade = false, _won = false; + public List _cells = new(); + public Enemy _owner; + public Actor _winner = null; + public GoalName _winningPattern; + public override void _Ready() + { + _cells = GetChildren().Where(c=>c is Cell).Cast().ToList(); + for (int i = 0; i < _cells.Count; i++) + { + _cells[i]._address = i+1; + } + } + + + public override void _Process(double DELTA_) + { + + } + + public void Activate() + { + Disable(false); + } + + public Actor CheckForWinner() + { + // List> playerGoalsMet = _owner._playerOpponent.CheckGoals(); + // List> ownerGoalsMet = _owner.CheckGoals(); + // _winner = playerGoalsMet.Count>0 ? _owner._playerOpponent : ownerGoalsMet.Count>0 ? _owner : null; + // _won = _winner != null; + + return _winner; + } + + public void ClaimOwnership(Enemy OWNER) + { + _owner = OWNER; + _cells.ForEach(c=>c._owner = OWNER); + _cells.ForEach(c=>c._board = this); + } + + public void ClearBoard(){ + foreach (Cell cell in _cells) + { + cell.Clear(); + } + } + + public void Deactivate() + { + Disable(true); + } + + public Cell GetCellByTenant(Enemy TENANT) + { + return _cells.Single(c=>c._tenant == TENANT); + } + + public Cell GetCellByAddress(int ADDRESS) + { + return _cells.Single(c=>c._address == ADDRESS); + } + + public List GetCellsByOwner(Player PLAYER) + { + return _cells.Where(c=>c._marker == PLAYER).ToList(); + } + + //THIS SHOULD BE MOVED INTO ACTION LOGIC + // public void RotateBoard(int DEGREES, int REPEAT) + // { + // for (int i = 0; i < REPEAT; i++) + // { + // Rotation += DEGREES * ((float)Math.PI / 180); + // RenumberCells(); + // } + // } + + public void RenumberCells() + { + _cells.OrderBy(c => c.Position.X).ThenBy(c => c.Position.Y).ToList(); + for (int i = 0; i < _cells.Count; i++) + { + Cell cell = _cells[i]; + cell._address = i; + } + } + + public void Start() + { + ClearBoard(); + // _player._isTurn = true; + } + + public void Disable(bool DISABLED) + { + _active = !DISABLED; + Visible = !DISABLED; + SetProcess(!DISABLED); + _cells.ForEach(c=>c.Disable(DISABLED)); + } +} diff --git a/Gameplay/Board.cs.uid b/Gameplay/Board.cs.uid new file mode 100644 index 0000000..0522435 --- /dev/null +++ b/Gameplay/Board.cs.uid @@ -0,0 +1 @@ +uid://decakbqo4jfdi diff --git a/Gameplay/Boss.cs b/Gameplay/Boss.cs new file mode 100644 index 0000000..f46db13 --- /dev/null +++ b/Gameplay/Boss.cs @@ -0,0 +1,34 @@ +using Godot; +using System; +using System.Collections.Generic; +using System.Linq; + +public partial class Boss : Enemy +{ + public List _dragons; + + public override void _Ready() + { + base._Ready(); + _number = 1; + _dragons = GetChildren().Where(c=>c is Dragon).Cast().ToList(); + for (int i = 0; i < _dragons.Count; i++) + { + _dragons[i]._owner = this; + _dragons[i]._number = _board._cells[i]._address; + _board._cells[i]._tenant = _dragons[i]; + } + } + + public override void PassPlayer(Player PLAYER) + { + base.PassPlayer(PLAYER); + _dragons.ForEach(d=>d.PassPlayer(PLAYER)); + } + + public override void ClickCell(Cell CLICKEDCELL) + { + _playerOpponent.Challenge(CLICKEDCELL._tenant); + } + +} diff --git a/Gameplay/Boss.cs.uid b/Gameplay/Boss.cs.uid new file mode 100644 index 0000000..887f886 --- /dev/null +++ b/Gameplay/Boss.cs.uid @@ -0,0 +1 @@ +uid://d3e55f3sbmjfm diff --git a/Gameplay/BusinessCard.cs b/Gameplay/BusinessCard.cs new file mode 100644 index 0000000..a5113bd --- /dev/null +++ b/Gameplay/BusinessCard.cs @@ -0,0 +1,47 @@ +using Godot; +using System; +using System.Collections.Generic; +using System.Linq; + +public partial class BusinessCard : TextureButton +{ + public Player _player; + public Goal _goal; + public GoalName _goalName; + public bool _goalMet = false; + + public override void _Ready() + { + base._Ready(); + _goal = GetNode("Goal"); + } + + public override void _Pressed() + { + base._Pressed(); + GD.Print("Pressed"); + _player._activeEnemy.Defeat(_goalName); + _player.Challenge(_player._activeEnemy._owner._board._owner); + } + + public void AssignGoal(GoalName GOALNAME) + { + _goalName = GOALNAME; + } + + public void CheckGoal() + { + List ownedCells = _player._board.GetCellsByOwner(_player); + List addresses = _goal.GetAddresses(_goalName); + _goalMet = addresses.All(a=>ownedCells.Select(c=>c._address).ToList().IndexOf(a)>-1); + GD.Print(_goalMet); + Disabled = !_goalMet; + GD.Print(Disabled); + } + + public void PassPlayer(Player PLAYER) + { + _player = PLAYER; + } + +} \ No newline at end of file diff --git a/Gameplay/BusinessCard.cs.uid b/Gameplay/BusinessCard.cs.uid new file mode 100644 index 0000000..2f964a1 --- /dev/null +++ b/Gameplay/BusinessCard.cs.uid @@ -0,0 +1 @@ +uid://dtcalmvwievft diff --git a/Gameplay/Cell.cs b/Gameplay/Cell.cs new file mode 100644 index 0000000..886fab3 --- /dev/null +++ b/Gameplay/Cell.cs @@ -0,0 +1,53 @@ +using Godot; +using System; +using System.Diagnostics; +using System.Runtime.CompilerServices; + +public partial class Cell : TextureButton +{ + public bool _isHovered = false, _isPressed = false, _isDisabled = false, _isFocused = false, _locked = false, _destroyed = false; + public int _address; + public Enemy _owner, _tenant; + public Actor _marker; + public Sprite2D _defaultMark; + public Board _board; + + public override void _Ready() + { + _defaultMark = GetNode("DefaultMark"); + } + + public override void _Pressed() + { + base._Pressed(); + // GD.Print(_tenant.GetType().ToString() + " " + _tenant._number + " Pressed"); + // GD.Print(_board._owner.GetType().ToString() + " " + _board._owner._number + " Pressed"); + _owner.ClickCell(this); + } + + public override void _Process(double DELTA) + { + base._Process(DELTA); + } + + public void Disable(bool DISABLED) + { + SetProcess(!DISABLED); + } + + public void Mark(Actor MARKER) + { + _marker = MARKER; + TextureNormal = MARKER._markNormal.Texture; + TexturePressed = MARKER._markPressed.Texture; + TextureHover = MARKER._markHovered.Texture; + TextureDisabled = MARKER._markDisabled.Texture; + TextureFocused = MARKER._markFocused.Texture; + } + + public void Clear() + { + _marker = null; + TextureNormal = TexturePressed = TextureHover = TextureDisabled = TextureFocused = _defaultMark.Texture; + } +} diff --git a/Gameplay/Cell.cs.uid b/Gameplay/Cell.cs.uid new file mode 100644 index 0000000..78115c7 --- /dev/null +++ b/Gameplay/Cell.cs.uid @@ -0,0 +1 @@ +uid://pg7mpir3ewhw diff --git a/Gameplay/Contact.cs b/Gameplay/Contact.cs new file mode 100644 index 0000000..685a5d1 --- /dev/null +++ b/Gameplay/Contact.cs @@ -0,0 +1,23 @@ +using Godot; +using System; + +public partial class Contact : Sprite2D +{ + public Player _player; + public int _number; + + public override void _Ready() + { + + } + + public void PassNumber(int NUMBER) + { + _number = NUMBER; + } + public void PassPlayer(Player PLAYER) + { + _player = PLAYER; + } + +} diff --git a/Gameplay/Contact.cs.uid b/Gameplay/Contact.cs.uid new file mode 100644 index 0000000..5a24325 --- /dev/null +++ b/Gameplay/Contact.cs.uid @@ -0,0 +1 @@ +uid://bgj2cuqdq0b6l diff --git a/Gameplay/Dragon.cs b/Gameplay/Dragon.cs new file mode 100644 index 0000000..dc4bae1 --- /dev/null +++ b/Gameplay/Dragon.cs @@ -0,0 +1,42 @@ +using Godot; +using System; +using System.Collections.Generic; +using System.Linq; + +public partial class Dragon : Enemy +{ + // public int _number; + // public Board _board; + public List _mooks; + // public Player _playerOpponent; + // public Cell _cell; + + public override void _Ready() + { + base._Ready(); + _mooks = GetChildren().Where(c=>c is Mook).Cast().ToList(); + for (int i = 0; i < _mooks.Count; i++) + { + _mooks[i]._owner = this; + _mooks[i]._number = _board._cells[i]._address; + _board._cells[i]._tenant = _mooks[i]; + } + } + + public void Challenge() + { + _playerOpponent.Challenge(this); + } + + public override void PassPlayer(Player PLAYER) + { + base.PassPlayer(PLAYER); + _mooks.ForEach(m=>m.PassPlayer(PLAYER)); + + } + + public override void ClickCell(Cell CLICKEDCELL) + { + _playerOpponent.Challenge(CLICKEDCELL._tenant); + } +} diff --git a/Gameplay/Dragon.cs.uid b/Gameplay/Dragon.cs.uid new file mode 100644 index 0000000..b0a5813 --- /dev/null +++ b/Gameplay/Dragon.cs.uid @@ -0,0 +1 @@ +uid://ctsffebttempt diff --git a/Gameplay/Enemy.cs b/Gameplay/Enemy.cs new file mode 100644 index 0000000..4c2cfb3 --- /dev/null +++ b/Gameplay/Enemy.cs @@ -0,0 +1,40 @@ +using Godot; +using System; + +public partial class Enemy : Actor +{ + public int _number; + public Player _playerOpponent; + public Cell _cell; + public Enemy _owner; + + public override void _Ready() + { + base._Ready(); + _board = GetNode("Board"); + _board.ClaimOwnership(this); + _board.Disable(true); + } + + public virtual void PassPlayer(Player PLAYER) + { + _playerOpponent = PLAYER; + } + + public virtual void ClickCell(Cell CLICKEDCELL) + { + + } + + public void Defeat(GoalName WINNINGPATTERN) + { + _board._winningPattern = WINNINGPATTERN; + _owner._board.GetCellByTenant(this).Mark(_playerOpponent); + } + + public void Victory(GoalName WINNINGPATTERN) + { + _board._winningPattern = WINNINGPATTERN; + _owner._board.GetCellByTenant(this).Mark(this); + } +} diff --git a/Gameplay/Enemy.cs.uid b/Gameplay/Enemy.cs.uid new file mode 100644 index 0000000..bcd87ae --- /dev/null +++ b/Gameplay/Enemy.cs.uid @@ -0,0 +1 @@ +uid://ctxj1kcqu8v78 diff --git a/Gameplay/Goal.cs b/Gameplay/Goal.cs new file mode 100644 index 0000000..f24b663 --- /dev/null +++ b/Gameplay/Goal.cs @@ -0,0 +1,71 @@ +using Godot; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; + +public partial class Goal : Node +{ + public Dictionary> _conditions = new() + { + {GoalName.TopRow, new (){1,2,3}}, + {GoalName.MiddleRow, new (){4,5,6}}, + {GoalName.BottomRow, new (){7,8,9}}, + {GoalName.LeftColumn, new (){1,4,7}}, + {GoalName.MiddleColumn, new (){2,5,8}}, + {GoalName.RightColumn, new (){3,6,9}}, + {GoalName.ForwardDiagonal, new (){3,5,7}}, + {GoalName.BackwardDiagonal, new (){1,5,9}}, + {GoalName.Number1, new (){1,2,5,7,8,9}}, + {GoalName.Number2, new (){1,2,4,5,8,9}}, + {GoalName.Number3, new (){1,2,5,6,7,8}}, + {GoalName.Number4, new (){1,3,4,5,6,9}}, + {GoalName.Number5, new (){2,3,4,5,7,8}}, + {GoalName.Number6, new (){1,4,5,6,7,8,9}}, + {GoalName.Number7, new (){1,2,3,6,9}}, + {GoalName.Number8, new (){2,3,4,5,6,7,8}}, + {GoalName.Number9, new (){1,2,3,4,5,6,8,9}}, + {GoalName.Number0, new (){2,3,4,6,7,8}}, + {GoalName.LetterA, new (){2,4,5,6,7,9}}, + {GoalName.LetterB, new (){1,2,4,5,6,7,8,9}}, + {GoalName.LetterC, new (){1,2,3,4,7,8,9}}, + {GoalName.LetterD, new (){1,2,4,6,7,8}}, + {GoalName.LetterE, new (){1,2,3,4,5,7,8,9}}, + {GoalName.LetterF, new (){1,2,3,4,5,7}}, + {GoalName.LetterG, new (){1,2,4,6,7,8,9}}, + {GoalName.LetterH, new (){1,3,4,5,6,7,9}}, + {GoalName.LetterI, new (){1,2,3,5,7,8,9}}, + {GoalName.LetterJ, new (){1,2,3,5,7,8}}, + {GoalName.LetterK, new (){1,3,4,5,7,9}}, + {GoalName.LetterL, new (){3,5,7,8,9}}, + {GoalName.LetterM, new (){1,2,3,4,5,6,7,9}}, + {GoalName.LetterN, new (){1,2,3,4,6,7,9}}, + {GoalName.LetterO, new (){1,2,3,4,6,7,8,9}}, + {GoalName.LetterP, new (){1,2,3,4,5,6,7}}, + {GoalName.LetterQ, new (){1,2,3,4,6,7,8}}, + {GoalName.LetterR, new (){1,2,3,4,5,7,9}}, + {GoalName.LetterS, new (){2,3,5,7,8}}, + {GoalName.LetterT, new (){1,2,3,5,8}}, + {GoalName.LetterU, new (){1,3,4,6,7,8,9}}, + {GoalName.LetterV, new (){1,3,4,6,8}}, + {GoalName.LetterW, new (){1,3,4,5,6,7,8,9}}, + {GoalName.LetterX, new (){1,3,5,7,9}}, + {GoalName.LetterY, new (){1,3,5,8}}, + {GoalName.LetterZ, new (){1,2,5,8,9}}, + {GoalName.LongRightAngleAt1, new (){1,2,3,4,7}}, + {GoalName.LongRightAngleAt3, new (){1,2,3,6,9}}, + {GoalName.LongRightAngleAt7, new (){1,4,7,8,9}}, + {GoalName.LongRightAngleAt9, new (){3,6,7,8,9}}, + {GoalName.ShortRightAngleAt1, new (){1,2,4}}, + {GoalName.ShortRightAngleAt3, new (){2,3,6}}, + {GoalName.ShortRightAngleAt7, new (){4,7,8}}, + {GoalName.ShortRightAngleAt9, new (){6,8,9}}, + {GoalName.Corners, new (){1,4,7,9}}, + {GoalName.Diamond, new (){2,4,6,8}}, + }; + + public List GetAddresses(GoalName NAME) + { + return _conditions[NAME]; + } +} diff --git a/Gameplay/Goal.cs.uid b/Gameplay/Goal.cs.uid new file mode 100644 index 0000000..f0e893e --- /dev/null +++ b/Gameplay/Goal.cs.uid @@ -0,0 +1 @@ +uid://c08tnhx0minta diff --git a/Gameplay/GoalName.cs b/Gameplay/GoalName.cs new file mode 100644 index 0000000..a5c03c6 --- /dev/null +++ b/Gameplay/GoalName.cs @@ -0,0 +1,58 @@ +public enum GoalName + { + TopRow, + MiddleRow, + BottomRow, + LeftColumn, + MiddleColumn, + RightColumn, + ForwardDiagonal, + BackwardDiagonal, + Number1, + Number2, + Number3, + Number4, + Number5, + Number6, + Number7, + Number8, + Number9, + Number0, + LetterA, + LetterB, + LetterC, + LetterD, + LetterE, + LetterF, + LetterG, + LetterH, + LetterI, + LetterJ, + LetterK, + LetterL, + LetterM, + LetterN, + LetterO, + LetterP, + LetterQ, + LetterR, + LetterS, + LetterT, + LetterU, + LetterV, + LetterW, + LetterX, + LetterY, + LetterZ, + LongRightAngleAt1, + LongRightAngleAt3, + LongRightAngleAt7, + LongRightAngleAt9, + ShortRightAngleAt1, + ShortRightAngleAt3, + ShortRightAngleAt7, + ShortRightAngleAt9, + Corners, + Diamond, + Plus + } \ No newline at end of file diff --git a/Gameplay/GoalName.cs.uid b/Gameplay/GoalName.cs.uid new file mode 100644 index 0000000..09d3843 --- /dev/null +++ b/Gameplay/GoalName.cs.uid @@ -0,0 +1 @@ +uid://dmmb241f4ma6c diff --git a/Gameplay/Mook.cs b/Gameplay/Mook.cs new file mode 100644 index 0000000..f3436f7 --- /dev/null +++ b/Gameplay/Mook.cs @@ -0,0 +1,20 @@ +using Godot; +using System; +using System.Collections.Generic; +using System.Linq; + +public partial class Mook : Enemy +{ + + public override void _Ready() + { + base._Ready(); + + } + + public override void ClickCell(Cell CLICKEDCELL) + { + CLICKEDCELL.Mark(_playerOpponent); + _playerOpponent.CheckBusinessCards(); + } +} diff --git a/Gameplay/Mook.cs.uid b/Gameplay/Mook.cs.uid new file mode 100644 index 0000000..2e9f429 --- /dev/null +++ b/Gameplay/Mook.cs.uid @@ -0,0 +1 @@ +uid://clatml6wkypfe diff --git a/Gameplay/Opponent.cs b/Gameplay/Opponent.cs new file mode 100644 index 0000000..7a959f4 --- /dev/null +++ b/Gameplay/Opponent.cs @@ -0,0 +1,13 @@ +using Godot; +using System; +using System.Collections.Generic; +using System.Linq; + +public partial class Opponent : Player +{ + + public void MakeMove() + { + // CREATE CODE TO MAKE ENEMY MOVES + } +} diff --git a/Gameplay/Opponent.cs.uid b/Gameplay/Opponent.cs.uid new file mode 100644 index 0000000..60c85a7 --- /dev/null +++ b/Gameplay/Opponent.cs.uid @@ -0,0 +1 @@ +uid://631085nn2jpc diff --git a/Gameplay/Phone.cs b/Gameplay/Phone.cs new file mode 100644 index 0000000..386b599 --- /dev/null +++ b/Gameplay/Phone.cs @@ -0,0 +1,37 @@ +using Godot; +using System; +using System.Collections.Generic; +using System.Linq; + +public partial class Phone : Sprite2D +{ + public PhoneButton _hoveredButton; + public List _phoneButtons = new(); + public Player _player; + public override void _Ready() + { + _phoneButtons = GetChildren().Where(c=>c is PhoneButton).Cast().ToList(); + for (int i = 0; i < _phoneButtons.Count; i++) + { + _phoneButtons[i]._phone = this; + } + } + + public override void _Process(double DELTA_) + { + // _hoveredButton = _phoneButtons.FirstOrDefault(c => c._isHovered, null); + + + } + + public void PassPlayer(Player PLAYER) + { + _player = PLAYER; + for (int i = 0; i < _phoneButtons.Count; i++) + { + _phoneButtons[i]._phone = this; + _phoneButtons[i]._contact.PassPlayer(PLAYER); + _phoneButtons[i]._contact.PassNumber((i+1)%10); + } + } +} diff --git a/Gameplay/Phone.cs.uid b/Gameplay/Phone.cs.uid new file mode 100644 index 0000000..2b37a4d --- /dev/null +++ b/Gameplay/Phone.cs.uid @@ -0,0 +1 @@ +uid://dgmkhlit1vnf3 diff --git a/Gameplay/PhoneButton.cs b/Gameplay/PhoneButton.cs new file mode 100644 index 0000000..0dafe91 --- /dev/null +++ b/Gameplay/PhoneButton.cs @@ -0,0 +1,30 @@ +using Godot; +using System; + +public partial class PhoneButton : TextureButton +{ + // [Signal] + // public delegate void HoverEventHandler(Cell THISCELL, bool ISHOVERED); + public bool _isHovered = false; + public Phone _phone; + public Contact _contact; + + public override void _Ready() + { + base._Ready(); + _contact = GetNode("Contact"); + } + + + // private void OnMouseEntered() + // { + // _isHovered = true; + // EmitSignal(SignalName.Hover, this, _isHovered); + // } + + // private void OnMouseExited() + // { + // _isHovered = false; + // EmitSignal(SignalName.Hover, this, _isHovered); + // } +} diff --git a/Gameplay/PhoneButton.cs.uid b/Gameplay/PhoneButton.cs.uid new file mode 100644 index 0000000..8ca729c --- /dev/null +++ b/Gameplay/PhoneButton.cs.uid @@ -0,0 +1 @@ +uid://cd1nniv27ef2f diff --git a/Gameplay/actor.tscn b/Gameplay/actor.tscn new file mode 100644 index 0000000..f0d7eb7 --- /dev/null +++ b/Gameplay/actor.tscn @@ -0,0 +1,27 @@ +[gd_scene load_steps=3 format=3 uid="uid://cxgydksjaasxt"] + +[ext_resource type="Script" uid="uid://bfmn75cttwhto" path="res://Gameplay/Actor.cs" id="1_2b8tl"] +[ext_resource type="Texture2D" uid="uid://c51oi06i4yrvv" path="res://Art/x.png" id="2_6kc7q"] + +[node name="Actor" type="Sprite2D"] +script = ExtResource("1_2b8tl") + +[node name="MarkNormal" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("2_6kc7q") + +[node name="MarkPressed" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("2_6kc7q") + +[node name="MarkHovered" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("2_6kc7q") + +[node name="MarkDisabled" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("2_6kc7q") + +[node name="MarkFocused" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("2_6kc7q") diff --git a/Gameplay/board.tscn b/Gameplay/board.tscn new file mode 100644 index 0000000..f599c32 --- /dev/null +++ b/Gameplay/board.tscn @@ -0,0 +1,63 @@ +[gd_scene load_steps=4 format=3 uid="uid://jkmo1fb2ohv4"] + +[ext_resource type="Texture2D" uid="uid://cbi83mc26qju5" path="res://Art/Tic-tac-toe.png" id="1_iqk8r"] +[ext_resource type="Script" uid="uid://decakbqo4jfdi" path="res://Gameplay/Board.cs" id="2_ucn0m"] +[ext_resource type="PackedScene" uid="uid://0vj01cjcpibt" path="res://Gameplay/cell.tscn" id="3_s74v7"] + +[node name="Board" type="Sprite2D"] +texture = ExtResource("1_iqk8r") +script = ExtResource("2_ucn0m") + +[node name="Cell1" parent="." instance=ExtResource("3_s74v7")] +offset_left = -300.0 +offset_top = -301.0 +offset_right = -100.0 +offset_bottom = -101.0 + +[node name="Cell2" parent="." instance=ExtResource("3_s74v7")] +offset_left = -100.0 +offset_top = -300.0 +offset_right = 100.0 +offset_bottom = -100.0 + +[node name="Cell3" parent="." instance=ExtResource("3_s74v7")] +offset_left = 100.0 +offset_top = -300.0 +offset_right = 300.0 +offset_bottom = -100.0 + +[node name="Cell4" parent="." instance=ExtResource("3_s74v7")] +offset_left = -300.0 +offset_top = -100.0 +offset_right = -100.0 +offset_bottom = 100.0 + +[node name="Cell5" parent="." instance=ExtResource("3_s74v7")] +offset_left = -100.0 +offset_top = -100.0 +offset_right = 100.0 +offset_bottom = 100.0 + +[node name="Cell6" parent="." instance=ExtResource("3_s74v7")] +offset_left = 100.0 +offset_top = -100.0 +offset_right = 300.0 +offset_bottom = 100.0 + +[node name="Cell7" parent="." instance=ExtResource("3_s74v7")] +offset_left = -300.0 +offset_top = 100.0 +offset_right = -100.0 +offset_bottom = 300.0 + +[node name="Cell8" parent="." instance=ExtResource("3_s74v7")] +offset_left = -100.0 +offset_top = 100.0 +offset_right = 100.0 +offset_bottom = 300.0 + +[node name="Cell9" parent="." instance=ExtResource("3_s74v7")] +offset_left = 100.0 +offset_top = 100.0 +offset_right = 300.0 +offset_bottom = 300.0 diff --git a/Gameplay/boss.tscn b/Gameplay/boss.tscn new file mode 100644 index 0000000..1a4eeb5 --- /dev/null +++ b/Gameplay/boss.tscn @@ -0,0 +1,49 @@ +[gd_scene load_steps=5 format=3 uid="uid://bmy783a4c0tal"] + +[ext_resource type="Script" uid="uid://d3e55f3sbmjfm" path="res://Gameplay/Boss.cs" id="1_2o0wi"] +[ext_resource type="PackedScene" uid="uid://jkmo1fb2ohv4" path="res://Gameplay/board.tscn" id="1_clmtu"] +[ext_resource type="PackedScene" uid="uid://cvys1ievove7k" path="res://Gameplay/dragon.tscn" id="2_2o0wi"] +[ext_resource type="Texture2D" uid="uid://c51oi06i4yrvv" path="res://Art/x.png" id="4_r1ck7"] + +[node name="Boss" type="Sprite2D"] +script = ExtResource("1_2o0wi") + +[node name="Board" parent="." instance=ExtResource("1_clmtu")] + +[node name="Dragon1" parent="." instance=ExtResource("2_2o0wi")] + +[node name="Dragon2" parent="." instance=ExtResource("2_2o0wi")] + +[node name="Dragon3" parent="." instance=ExtResource("2_2o0wi")] + +[node name="Dragon4" parent="." instance=ExtResource("2_2o0wi")] + +[node name="Dragon5" parent="." instance=ExtResource("2_2o0wi")] + +[node name="Dragon6" parent="." instance=ExtResource("2_2o0wi")] + +[node name="Dragon7" parent="." instance=ExtResource("2_2o0wi")] + +[node name="Dragon8" parent="." instance=ExtResource("2_2o0wi")] + +[node name="Dragon9" parent="." instance=ExtResource("2_2o0wi")] + +[node name="MarkNormal" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("4_r1ck7") + +[node name="MarkPressed" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("4_r1ck7") + +[node name="MarkHovered" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("4_r1ck7") + +[node name="MarkDisabled" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("4_r1ck7") + +[node name="MarkFocused" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("4_r1ck7") diff --git a/Gameplay/business_card.tscn b/Gameplay/business_card.tscn new file mode 100644 index 0000000..b0f9ba2 --- /dev/null +++ b/Gameplay/business_card.tscn @@ -0,0 +1,17 @@ +[gd_scene load_steps=4 format=3 uid="uid://b0ks34m6smjfd"] + +[ext_resource type="Texture2D" uid="uid://g6ikqlh8yccy" path="res://Art/blanksquare.jpg" id="1_8xr8s"] +[ext_resource type="Script" uid="uid://dtcalmvwievft" path="res://Gameplay/BusinessCard.cs" id="2_rhxm0"] +[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) +disabled = true +texture_normal = ExtResource("1_8xr8s") +texture_pressed = ExtResource("1_8xr8s") +texture_hover = ExtResource("1_8xr8s") +texture_disabled = ExtResource("1_8xr8s") +texture_focused = ExtResource("1_8xr8s") +script = ExtResource("2_rhxm0") + +[node name="Goal" parent="." instance=ExtResource("3_ejro6")] diff --git a/Gameplay/cell.tscn b/Gameplay/cell.tscn new file mode 100644 index 0000000..6b627de --- /dev/null +++ b/Gameplay/cell.tscn @@ -0,0 +1,17 @@ +[gd_scene load_steps=3 format=3 uid="uid://0vj01cjcpibt"] + +[ext_resource type="Script" uid="uid://pg7mpir3ewhw" path="res://Gameplay/Cell.cs" id="1_lehgd"] +[ext_resource type="Texture2D" uid="uid://g6ikqlh8yccy" path="res://Art/blanksquare.jpg" id="2_mxyjk"] + +[node name="Cell" type="TextureButton"] +modulate = Color(1, 1, 1, 0.2) +offset_right = 200.0 +offset_bottom = 200.0 +texture_normal = ExtResource("2_mxyjk") +texture_pressed = ExtResource("2_mxyjk") +texture_hover = ExtResource("2_mxyjk") +texture_disabled = ExtResource("2_mxyjk") +texture_focused = ExtResource("2_mxyjk") +script = ExtResource("1_lehgd") + +[node name="DefaultMark" type="Sprite2D" parent="."] diff --git a/Gameplay/contact.tscn b/Gameplay/contact.tscn new file mode 100644 index 0000000..1a29102 --- /dev/null +++ b/Gameplay/contact.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://if21pf73w7by"] + +[ext_resource type="Script" uid="uid://bgj2cuqdq0b6l" path="res://Gameplay/Contact.cs" id="1_basqx"] + +[node name="Contact" type="Sprite2D"] +script = ExtResource("1_basqx") diff --git a/Gameplay/dragon.tscn b/Gameplay/dragon.tscn new file mode 100644 index 0000000..caabdae --- /dev/null +++ b/Gameplay/dragon.tscn @@ -0,0 +1,50 @@ +[gd_scene load_steps=5 format=3 uid="uid://cvys1ievove7k"] + +[ext_resource type="PackedScene" uid="uid://jkmo1fb2ohv4" path="res://Gameplay/board.tscn" id="1_3o6ty"] +[ext_resource type="Script" uid="uid://ctsffebttempt" path="res://Gameplay/Dragon.cs" id="1_rebub"] +[ext_resource type="PackedScene" uid="uid://bti3pxehphc5m" path="res://Gameplay/mook.tscn" id="2_70jbw"] +[ext_resource type="Texture2D" uid="uid://c51oi06i4yrvv" path="res://Art/x.png" id="4_1okyd"] + +[node name="Dragon" type="Sprite2D"] +script = ExtResource("1_rebub") + +[node name="Board" parent="." instance=ExtResource("1_3o6ty")] +visible = false + +[node name="Mook1" parent="." instance=ExtResource("2_70jbw")] + +[node name="Mook2" parent="." instance=ExtResource("2_70jbw")] + +[node name="Mook3" parent="." instance=ExtResource("2_70jbw")] + +[node name="Mook4" parent="." instance=ExtResource("2_70jbw")] + +[node name="Mook5" parent="." instance=ExtResource("2_70jbw")] + +[node name="Mook6" parent="." instance=ExtResource("2_70jbw")] + +[node name="Mook7" parent="." instance=ExtResource("2_70jbw")] + +[node name="Mook8" parent="." instance=ExtResource("2_70jbw")] + +[node name="Mook9" parent="." instance=ExtResource("2_70jbw")] + +[node name="MarkNormal" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("4_1okyd") + +[node name="MarkPressed" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("4_1okyd") + +[node name="MarkHovered" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("4_1okyd") + +[node name="MarkDisabled" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("4_1okyd") + +[node name="MarkFocused" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("4_1okyd") diff --git a/Gameplay/enemy.tscn b/Gameplay/enemy.tscn new file mode 100644 index 0000000..358928d --- /dev/null +++ b/Gameplay/enemy.tscn @@ -0,0 +1,30 @@ +[gd_scene load_steps=4 format=3 uid="uid://bsfchgfdky43e"] + +[ext_resource type="Script" uid="uid://ctxj1kcqu8v78" path="res://Gameplay/Enemy.cs" id="1_4gyqm"] +[ext_resource type="PackedScene" uid="uid://jkmo1fb2ohv4" path="res://Gameplay/board.tscn" id="1_7k104"] +[ext_resource type="Texture2D" uid="uid://c51oi06i4yrvv" path="res://Art/x.png" id="3_rgfr3"] + +[node name="Enemy" type="Sprite2D"] +script = ExtResource("1_4gyqm") + +[node name="Board" parent="." instance=ExtResource("1_7k104")] + +[node name="MarkNormal" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("3_rgfr3") + +[node name="MarkPressed" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("3_rgfr3") + +[node name="MarkHovered" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("3_rgfr3") + +[node name="MarkDisabled" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("3_rgfr3") + +[node name="MarkFocused" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("3_rgfr3") diff --git a/Gameplay/goal.tscn b/Gameplay/goal.tscn new file mode 100644 index 0000000..6f876ba --- /dev/null +++ b/Gameplay/goal.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://tk7fjdvu5c0u"] + +[ext_resource type="Script" uid="uid://c08tnhx0minta" path="res://Gameplay/Goal.cs" id="1_cmwnn"] + +[node name="Goal" type="Node"] +script = ExtResource("1_cmwnn") diff --git a/Gameplay/mook.tscn b/Gameplay/mook.tscn new file mode 100644 index 0000000..6c6007b --- /dev/null +++ b/Gameplay/mook.tscn @@ -0,0 +1,31 @@ +[gd_scene load_steps=4 format=3 uid="uid://bti3pxehphc5m"] + +[ext_resource type="PackedScene" uid="uid://jkmo1fb2ohv4" path="res://Gameplay/board.tscn" id="1_ndne4"] +[ext_resource type="Script" uid="uid://clatml6wkypfe" path="res://Gameplay/Mook.cs" id="1_ujoso"] +[ext_resource type="Texture2D" uid="uid://c51oi06i4yrvv" path="res://Art/x.png" id="3_2cl80"] + +[node name="Mook" type="Sprite2D"] +script = ExtResource("1_ujoso") + +[node name="Board" parent="." instance=ExtResource("1_ndne4")] +visible = false + +[node name="MarkNormal" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("3_2cl80") + +[node name="MarkPressed" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("3_2cl80") + +[node name="MarkHovered" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("3_2cl80") + +[node name="MarkDisabled" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("3_2cl80") + +[node name="MarkFocused" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("3_2cl80") diff --git a/Gameplay/opponent.tscn b/Gameplay/opponent.tscn new file mode 100644 index 0000000..0205397 --- /dev/null +++ b/Gameplay/opponent.tscn @@ -0,0 +1,13 @@ +[gd_scene load_steps=3 format=3 uid="uid://12dh7l7eucb4"] + +[ext_resource type="Script" uid="uid://631085nn2jpc" path="res://Gameplay/Opponent.cs" id="1_h046w"] +[ext_resource type="Texture2D" uid="uid://c51oi06i4yrvv" path="res://Art/x.png" id="2_7tesw"] + +[node name="Opponent" type="Node2D"] +script = ExtResource("1_h046w") + +[node name="Mark" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("2_7tesw") + +[node name="Sprite" type="Sprite2D" parent="."] diff --git a/Gameplay/phone.tscn b/Gameplay/phone.tscn new file mode 100644 index 0000000..10c621a --- /dev/null +++ b/Gameplay/phone.tscn @@ -0,0 +1,79 @@ +[gd_scene load_steps=4 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"] + +[node name="Phone" type="Sprite2D"] +texture = ExtResource("1_lrxfg") +script = ExtResource("2_ujt17") + +[node name="PhoneButton1" parent="." instance=ExtResource("2_pr3bu")] +offset_left = -228.0 +offset_top = 230.0 +offset_right = 572.0 +offset_bottom = 1030.0 +scale = Vector2(0.13, 0.13) + +[node name="PhoneButton2" parent="." instance=ExtResource("2_pr3bu")] +offset_left = -41.0 +offset_top = 254.0 +offset_right = 759.0 +offset_bottom = 1054.0 +scale = Vector2(0.13, 0.13) + +[node name="PhoneButton3" parent="." instance=ExtResource("2_pr3bu")] +offset_left = 150.0 +offset_top = 225.0 +offset_right = 950.0 +offset_bottom = 1025.0 +scale = Vector2(0.13, 0.13) + +[node name="PhoneButton4" parent="." instance=ExtResource("2_pr3bu")] +offset_left = -228.0 +offset_top = 339.0 +offset_right = 572.0 +offset_bottom = 1139.0 +scale = Vector2(0.13, 0.13) + +[node name="PhoneButton5" parent="." instance=ExtResource("2_pr3bu")] +offset_left = -38.0 +offset_top = 361.0 +offset_right = 762.0 +offset_bottom = 1161.0 +scale = Vector2(0.13, 0.13) + +[node name="PhoneButton6" parent="." instance=ExtResource("2_pr3bu")] +offset_left = 140.0 +offset_top = 336.0 +offset_right = 940.0 +offset_bottom = 1136.0 +scale = Vector2(0.13, 0.13) + +[node name="PhoneButton7" parent="." instance=ExtResource("2_pr3bu")] +offset_left = -222.0 +offset_top = 447.0 +offset_right = 578.0 +offset_bottom = 1247.0 +scale = Vector2(0.13, 0.13) + +[node name="PhoneButton8" parent="." instance=ExtResource("2_pr3bu")] +offset_left = -39.0 +offset_top = 466.0 +offset_right = 761.0 +offset_bottom = 1266.0 +scale = Vector2(0.13, 0.13) + +[node name="PhoneButton9" parent="." instance=ExtResource("2_pr3bu")] +offset_left = 137.0 +offset_top = 437.0 +offset_right = 937.0 +offset_bottom = 1237.0 +scale = Vector2(0.13, 0.13) + +[node name="PhoneButton0" parent="." instance=ExtResource("2_pr3bu")] +offset_left = -41.0 +offset_top = 565.0 +offset_right = 759.0 +offset_bottom = 1365.0 +scale = Vector2(0.13, 0.13) diff --git a/Gameplay/phone_button.tscn b/Gameplay/phone_button.tscn new file mode 100644 index 0000000..3afe9ee --- /dev/null +++ b/Gameplay/phone_button.tscn @@ -0,0 +1,20 @@ +[gd_scene load_steps=4 format=3 uid="uid://dj6cr426bn30b"] + +[ext_resource type="Texture2D" uid="uid://4hculjnuw6ha" path="res://Art/capsule-fill.svg" id="1_6ytam"] +[ext_resource type="Script" uid="uid://cd1nniv27ef2f" path="res://Gameplay/PhoneButton.cs" id="1_d1byk"] +[ext_resource type="PackedScene" uid="uid://if21pf73w7by" path="res://Gameplay/contact.tscn" id="3_3os1s"] + +[node name="PhoneButton" type="TextureButton"] +modulate = Color(1, 1, 1, 0.2) +offset_right = 800.0 +offset_bottom = 800.0 +texture_normal = ExtResource("1_6ytam") +texture_pressed = ExtResource("1_6ytam") +texture_hover = ExtResource("1_6ytam") +texture_disabled = ExtResource("1_6ytam") +texture_focused = ExtResource("1_6ytam") +script = ExtResource("1_d1byk") + +[node name="Contact" parent="." instance=ExtResource("3_3os1s")] +position = Vector2(-228, 230) +scale = Vector2(0.13, 0.13) diff --git a/Gameplay/player.tscn b/Gameplay/player.tscn new file mode 100644 index 0000000..562dd2e --- /dev/null +++ b/Gameplay/player.tscn @@ -0,0 +1,51 @@ +[gd_scene load_steps=6 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"] + +[node name="Player" type="Sprite2D"] +script = ExtResource("1_enp12") + +[node name="Phone" parent="." instance=ExtResource("4_1d6nn")] +position = Vector2(1600, 540) +scale = Vector2(0.5, 0.5) + +[node name="Boss" parent="." instance=ExtResource("5_lfxdo")] +position = Vector2(960, 540) + +[node name="MarkNormal" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("1_c6108") + +[node name="MarkPressed" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("1_c6108") + +[node name="MarkHovered" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("1_c6108") + +[node name="MarkDisabled" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("1_c6108") + +[node name="MarkFocused" type="Sprite2D" parent="."] +visible = false +texture = ExtResource("1_c6108") + +[node name="Debug" type="RichTextLabel" parent="."] +offset_right = 322.0 +offset_bottom = 153.0 +theme_override_font_sizes/normal_font_size = 32 +text = "DEBUG" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="BusinessCard" parent="." instance=ExtResource("5_ek8wa")] +offset_left = 98.0 +offset_top = 769.0 +offset_right = 298.0 +offset_bottom = 969.0 diff --git a/Main.cs b/Main.cs new file mode 100644 index 0000000..7abe9a3 --- /dev/null +++ b/Main.cs @@ -0,0 +1,23 @@ +using Godot; +using System; + +public partial class Main : Node2D +{ + Player _player; + public override void _Ready() + { + _player = GetNode("Player"); + _player._name = "X"; + + } + + public override void _Process(double DELTA_) + { + if (Input.IsActionJustReleased("quit_game")) + { + + GetTree().Quit(); + } + } + +} diff --git a/Main.cs.uid b/Main.cs.uid new file mode 100644 index 0000000..12dcf4f --- /dev/null +++ b/Main.cs.uid @@ -0,0 +1 @@ +uid://i1ujfd2xwd82 diff --git a/Player.cs b/Player.cs new file mode 100644 index 0000000..1d105b5 --- /dev/null +++ b/Player.cs @@ -0,0 +1,95 @@ +using Godot; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; + +public partial class Player : Actor +{ + public bool _isTurn = false; + public string _name; + public Phone _phone; + public Boss _boss; + public Enemy _activeEnemy; + public RichTextLabel _debug; + public List _businessCards; + + public override void _Ready() + { + base._Ready(); + + _debug = GetNode("Debug"); + + _phone = GetNode("Phone"); + _phone.PassPlayer(this); + + _boss = GetNode("Boss"); + _boss.PassPlayer(this); + + _businessCards = GetChildren().Where(c=>c is BusinessCard).Cast().ToList(); + for (int i = 0; i < _businessCards.Count; i++) + { + _businessCards[i].PassPlayer(this); + _businessCards[i].AssignGoal(GoalName.MiddleColumn); + } + + + Challenge(_boss); + } + + public void Challenge(Enemy ENEMY) + { + _board?.Deactivate(); + ENEMY._board.Activate(); + _board = ENEMY._board; + _activeEnemy = ENEMY; + + string text = ""; + if (_activeEnemy is Mook) + { + text = "dragon " + _activeEnemy._owner._number + "\nmook " + _activeEnemy._number; + } + else if (_activeEnemy is Dragon) + { + text = "dragon " + _activeEnemy._number; + } + _debug.Text = text; + } + + public void CheckBusinessCards() + { + _businessCards.ForEach(b=>b.CheckGoal()); + } + + // public bool CheckWin(List CELLS) + // { + // foreach (Goal.GoalName cond in _goal._eligibleGoals) + // { + // foreach (List condList in _goal._conditions[cond]) + // { + // // if (condList.All(a=>CELLS.FirstOrDefault(c=>c._address == a, null)?._owner == this)) + // // { + // // return true; + // // } + // } + // } + // return false; + // } + // public void MarkCell(Cell CELL) + // { + // CELL._mark.Texture = _mark.Texture; + // // CELL._owner = this; + // } + + public override void _Process(double delta) + { + if (Input.IsActionJustReleased("backspace")) + { + if (_board._owner._owner != null) + { + Challenge(_board._owner._owner); + } + } + } + +} diff --git a/Player.cs.uid b/Player.cs.uid new file mode 100644 index 0000000..5e1ba14 --- /dev/null +++ b/Player.cs.uid @@ -0,0 +1 @@ +uid://dth2vcgkp7iq0 diff --git a/Tic Tac Toe.csproj b/Tic Tac Toe.csproj new file mode 100644 index 0000000..6bba03d --- /dev/null +++ b/Tic Tac Toe.csproj @@ -0,0 +1,7 @@ + + + net8.0 + true + TicTacToe + + \ No newline at end of file diff --git a/Tic Tac Toe.sln b/Tic Tac Toe.sln new file mode 100644 index 0000000..c17868d --- /dev/null +++ b/Tic Tac Toe.sln @@ -0,0 +1,19 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tic Tac Toe", "Tic Tac Toe.csproj", "{CB4332CD-DFB8-472B-BCE3-CEDB07FD33C1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + ExportDebug|Any CPU = ExportDebug|Any CPU + ExportRelease|Any CPU = ExportRelease|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CB4332CD-DFB8-472B-BCE3-CEDB07FD33C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CB4332CD-DFB8-472B-BCE3-CEDB07FD33C1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CB4332CD-DFB8-472B-BCE3-CEDB07FD33C1}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU + {CB4332CD-DFB8-472B-BCE3-CEDB07FD33C1}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU + {CB4332CD-DFB8-472B-BCE3-CEDB07FD33C1}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU + {CB4332CD-DFB8-472B-BCE3-CEDB07FD33C1}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU + EndGlobalSection +EndGlobal diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..9d8b7fa --- /dev/null +++ b/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icon.svg.import b/icon.svg.import new file mode 100644 index 0000000..73aea43 --- /dev/null +++ b/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://clvvqpa4brpxt" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.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 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/main.tscn b/main.tscn new file mode 100644 index 0000000..d71c955 --- /dev/null +++ b/main.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=3 format=3 uid="uid://bvhlmavxrih1m"] + +[ext_resource type="Script" uid="uid://i1ujfd2xwd82" path="res://Main.cs" id="1_ig7tw"] +[ext_resource type="PackedScene" uid="uid://b7vhq2dkltsv" path="res://Gameplay/player.tscn" id="3_1bvp3"] + +[node name="Main" type="Node2D"] +script = ExtResource("1_ig7tw") + +[node name="Player" parent="." instance=ExtResource("3_1bvp3")] diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..c394302 --- /dev/null +++ b/project.godot @@ -0,0 +1,104 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="Tic Tac Toe" +run/main_scene="uid://bvhlmavxrih1m" +config/features=PackedStringArray("4.4", "C#", "Forward Plus") +config/icon="res://icon.svg" + +[display] + +window/size/viewport_width=1920 +window/size/viewport_height=1080 +window/size/mode=3 + +[dotnet] + +project/assembly_name="Tic Tac Toe" + +[input] + +quit_game={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +left_mouse={ +"deadzone": 0.2, +"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) +] +} +rotate={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":82,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +numpad1={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194439,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +numpad2={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194440,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +numpad3={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194441,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +numpad4={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194442,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +numpad5={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194443,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +numpad6={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194444,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +numpad7={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194445,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +numpad8={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194446,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +numpad9={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194447,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +numpad0={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194438,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} +debug_board_reset={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":61,"key_label":0,"unicode":61,"location":0,"echo":false,"script":null) +] +} +backspace={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194308,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +}