diff --git a/namedropper/Assets/CardDataDrawer.cs b/namedropper/Assets/CardDataDrawer.cs index c7ff233..143daae 100644 --- a/namedropper/Assets/CardDataDrawer.cs +++ b/namedropper/Assets/CardDataDrawer.cs @@ -7,6 +7,8 @@ public class CardDataDrawer : MonoBehaviour { [SerializeField] GameObject[] _shapeSprites; public CardData _cardData; + [SerializeField] bool _generateStars = false; + public int _numStarGenerators; // Start is called before the first frame update void Start() @@ -25,9 +27,31 @@ public class CardDataDrawer : MonoBehaviour public void Redraw() { + _numStarGenerators = 0; + + foreach (Category category in GameObject.FindObjectsOfType()) + { + if (category.IsStarGenerator() && category._color == GetComponent()?._team && _generateStars) + _numStarGenerators++; + } + + for (int i = 0; i < _shapeSprites.Length; i++) { - _shapeSprites[i].GetComponent().sprite = _cardData.GetSprite(i); + Sprite sprite; + if (i < _numStarGenerators) + { + string filename = "shapes/wild"; + sprite = Resources.Load(filename); + _shapeSprites[i].GetComponent().color = Color.yellow; + } + else + { + _shapeSprites[i].GetComponent().color = Color.white; + sprite = _cardData.GetSprite(i); + } + + _shapeSprites[i].GetComponent().sprite = sprite; if (_cardData._shapes[i] == CardData.Shape.NONE) _shapeSprites[i].SetActive(false); diff --git a/namedropper/Assets/Prefabs/Category Prefab.prefab b/namedropper/Assets/Prefabs/Category Prefab.prefab index 1a83b80..589ed89 100644 --- a/namedropper/Assets/Prefabs/Category Prefab.prefab +++ b/namedropper/Assets/Prefabs/Category Prefab.prefab @@ -227,6 +227,7 @@ MonoBehaviour: _feedbackBad: {fileID: 3551932467328341787} _streak: {fileID: 1565607471538169626} _shieldsText: {fileID: 3173673145629268070} + _color: 2 --- !u!61 &1085594869219034861 BoxCollider2D: m_ObjectHideFlags: 0 @@ -269,6 +270,8 @@ MonoBehaviour: - {fileID: 4698135363407727744} - {fileID: 1925658209779528050} - {fileID: 7294958316878599169} + _generateStars: 0 + _numStarGenerators: 0 --- !u!1 &1499098757547953155 GameObject: m_ObjectHideFlags: 0 @@ -449,7 +452,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &1499098758628412651 Transform: m_ObjectHideFlags: 0 diff --git a/namedropper/Assets/Resources/shapes/diamond.png b/namedropper/Assets/Resources/shapes/diamond.png index fe1dcbe..966891d 100644 Binary files a/namedropper/Assets/Resources/shapes/diamond.png and b/namedropper/Assets/Resources/shapes/diamond.png differ diff --git a/namedropper/Assets/Resources/shapes/wild.png b/namedropper/Assets/Resources/shapes/wild.png new file mode 100644 index 0000000..c493d5c Binary files /dev/null and b/namedropper/Assets/Resources/shapes/wild.png differ diff --git a/namedropper/Assets/Resources/shapes/wild.png.meta b/namedropper/Assets/Resources/shapes/wild.png.meta new file mode 100644 index 0000000..30bb393 --- /dev/null +++ b/namedropper/Assets/Resources/shapes/wild.png.meta @@ -0,0 +1,123 @@ +fileFormatVersion: 2 +guid: a9a84387ccd6bba4aa1bee072bcd3127 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/namedropper/Assets/Scenes/Game.unity b/namedropper/Assets/Scenes/Game.unity index e58b51a..058ec89 100644 --- a/namedropper/Assets/Scenes/Game.unity +++ b/namedropper/Assets/Scenes/Game.unity @@ -140,7 +140,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &23665175 RectTransform: m_ObjectHideFlags: 0 @@ -360,6 +360,10 @@ PrefabInstance: propertyPath: m_fontColor32.rgba value: 4294967295 objectReference: {fileID: 0} + - target: {fileID: 8866676399730726846, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} + propertyPath: _generateStars + value: 1 + objectReference: {fileID: 0} - target: {fileID: 9049015333299688696, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_Text value: Josh @@ -1238,6 +1242,10 @@ PrefabInstance: propertyPath: m_fontColor32.rgba value: 4278190080 objectReference: {fileID: 0} + - target: {fileID: 8866676399730726846, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} + propertyPath: _generateStars + value: 1 + objectReference: {fileID: 0} - target: {fileID: 9049015333349338377, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: _team value: 0 @@ -2086,7 +2094,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 1499098758628412650, guid: f3f23d9506e39c54cbd07779c62329a3, type: 3} propertyPath: m_IsActive - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 1499098758628412651, guid: f3f23d9506e39c54cbd07779c62329a3, type: 3} propertyPath: m_LocalScale.x @@ -3184,9 +3192,11 @@ MonoBehaviour: m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 1 - m_VerticalOverflow: 0 + m_VerticalOverflow: 1 m_LineSpacing: 1 - m_Text: D&D Monsters + m_Text: 'match as many + + sas psdsd' --- !u!222 &1415156233 CanvasRenderer: m_ObjectHideFlags: 0 @@ -3231,7 +3241,7 @@ Camera: m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 1 - m_BackGroundColor: {r: 0.026343895, g: 0.09431403, b: 0.1509434, a: 0} + m_BackGroundColor: {r: 0.103773594, g: 0.103773594, b: 0.103773594, a: 0} m_projectionMatrixMode: 1 m_GateFitMode: 2 m_FOVAxisMode: 0 @@ -4653,6 +4663,10 @@ PrefabInstance: propertyPath: m_fontColor32.rgba value: 4294967295 objectReference: {fileID: 0} + - target: {fileID: 8866676399730726846, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} + propertyPath: _generateStars + value: 1 + objectReference: {fileID: 0} - target: {fileID: 9049015333299688696, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: m_Text value: Josh @@ -5098,6 +5112,10 @@ PrefabInstance: propertyPath: m_fontColor32.rgba value: 4278190080 objectReference: {fileID: 0} + - target: {fileID: 8866676399730726846, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} + propertyPath: _generateStars + value: 1 + objectReference: {fileID: 0} - target: {fileID: 9049015333349338377, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} propertyPath: _team value: 1 diff --git a/namedropper/Assets/Scripts/CardData.cs b/namedropper/Assets/Scripts/CardData.cs index ce7eb82..23db09d 100644 --- a/namedropper/Assets/Scripts/CardData.cs +++ b/namedropper/Assets/Scripts/CardData.cs @@ -14,16 +14,16 @@ public class CardData DIAMOND, //HEART, HOURGLASS, - //SPADE, + SPADE, //SQUARE, - STAR, + //STAR, TRIANGLE, X } public Shape[] _shapes; - public int CompareMatches(CardData otherCardData) + public int CompareMatches(int numStars, CardData otherCardData) { int score = 0; Shape[] tempOtherShapes = new Shape[otherCardData._shapes.Length]; @@ -37,6 +37,12 @@ public class CardData { for (int j = 0; j < tempOtherShapes.Length; j++) { + if (i < numStars) + { + score++; + break; + } + if (_shapes[i] == tempOtherShapes[j]) { score++; @@ -51,6 +57,7 @@ public class CardData public void Randomize(int count) { + _shapes = new Shape[count]; var rnd = new System.Random(Guid.NewGuid().GetHashCode()); @@ -58,10 +65,12 @@ public class CardData { do { - _shapes[i] = (Shape)rnd.Next(Enum.GetNames(typeof(Shape)).Length); + _shapes[i] = (Shape)rnd.Next(Enum.GetNames(typeof(Shape)).Length); } while (_shapes[i] == Shape.NONE); } + + } public Sprite GetSprite(int i) diff --git a/namedropper/Assets/Scripts/Category.cs b/namedropper/Assets/Scripts/Category.cs index b3e51a4..b2ee1b2 100644 --- a/namedropper/Assets/Scripts/Category.cs +++ b/namedropper/Assets/Scripts/Category.cs @@ -16,8 +16,9 @@ public class Category : MonoBehaviour [SerializeField] GameObject _streak; [SerializeField] TMPro.TMP_Text _shieldsText; - Player.Team _color = Player.Team.NEUTRAL; + public Player.Team _color = Player.Team.NEUTRAL; int _shields = 0; + const int NUM_SHIELDS_FOR_GENERATOR = 4; private void Awake() { @@ -60,6 +61,11 @@ public class Category : MonoBehaviour return 0; } + public bool IsStarGenerator() + { + return _shields >= NUM_SHIELDS_FOR_GENERATOR; + } + public void AddScore(int score, Player.Team team) { if (score <= 0) @@ -86,6 +92,16 @@ public class Category : MonoBehaviour _shieldsText.text += "O"; } + if (IsStarGenerator()) + { + _shieldsText.text = "STAR "; + + for (int i = 0; i < _shields - NUM_SHIELDS_FOR_GENERATOR; i++) + { + _shieldsText.text += "O"; + } + } + Color newColor = Color.white; if (_color == Player.Team.GREEN) { diff --git a/namedropper/Assets/Scripts/GameOverScreen.cs b/namedropper/Assets/Scripts/GameOverScreen.cs index d339fd3..21226c5 100644 --- a/namedropper/Assets/Scripts/GameOverScreen.cs +++ b/namedropper/Assets/Scripts/GameOverScreen.cs @@ -10,6 +10,9 @@ public class GameOverScreen : Level void Start() { + _gameOverMessage.text = "GAME OVER\n\nPress R\nto play again"; + return; + if (GameManager.Instance.NumTeams == 1) { int score = GameManager.Instance.Score1 + GameManager.Instance.Score2 + GameManager.Instance.Score3 + GameManager.Instance.Score4; diff --git a/namedropper/Assets/Scripts/Level.cs b/namedropper/Assets/Scripts/Level.cs index 1bb55db..f970301 100644 --- a/namedropper/Assets/Scripts/Level.cs +++ b/namedropper/Assets/Scripts/Level.cs @@ -56,13 +56,18 @@ public class Level : MonoBehaviour IEnumerator StartupProcess() { ActivatePlayers(false); + Topic.color = Color.white; + RoundNumber.color = Color.blue; if (Topic != null) Topic.gameObject.SetActive(false); yield return new WaitForSeconds(1f); - //if (Topic != null) - //Topic.gameObject.SetActive(true); - //yield return new WaitForSeconds(2f); - RoundNumber.text = ""; + if (Topic != null) + Topic.gameObject.SetActive(true); + + Topic.text = "Match as many shapes\nas you can!"; + yield return new WaitForSeconds(2f); + if (RoundNumber != null) + RoundNumber.text = ""; if (Topic != null) { Topic.text = "GO!"; @@ -111,7 +116,7 @@ public class Level : MonoBehaviour if (GameManager.Instance.PlayerJoined[player.GetComponent()._playerNumber] == true || SceneManager.GetActiveScene().name == "Title" || SceneManager.GetActiveScene().name == "Ontology" || - SceneManager.GetActiveScene().name == "Game" + SceneManager.GetActiveScene().name == "GameX" ) { player.SetActive(true); diff --git a/namedropper/Assets/Scripts/Player.cs b/namedropper/Assets/Scripts/Player.cs index 759c811..33866e4 100644 --- a/namedropper/Assets/Scripts/Player.cs +++ b/namedropper/Assets/Scripts/Player.cs @@ -13,7 +13,7 @@ public class Player : MonoBehaviour [SerializeField] KeyCode _keyRight; [SerializeField] KeyCode _keyDown; [SerializeField] KeyCode _keyDrop; - [SerializeField] Team _team; + public Team _team; [SerializeField] TMPro.TextMeshProUGUI _text; [SerializeField] List _longFonts = new List(); [SerializeField] List _shortFonts = new List(); @@ -254,7 +254,7 @@ public class Player : MonoBehaviour return; } - CardData categoryCardData = collision.gameObject.GetComponent()._cardData; + CardData categoryCardData = collision.gameObject.GetComponent()?._cardData; if (categoryCardData != null) @@ -262,7 +262,7 @@ public class Player : MonoBehaviour int score = 0; string message = ""; CardData myCardData = GetComponent()._cardData; - score = myCardData.CompareMatches(categoryCardData); + score = myCardData.CompareMatches(GetComponent()._numStarGenerators, categoryCardData); collision.gameObject.GetComponent().Redraw(); /* if (categoryCardData._shape == myCardData._shape) { @@ -288,7 +288,7 @@ public class Player : MonoBehaviour category.AddScore(score, _team); this.gameObject.SetActive(false); - Invoke("Respawn", 1f); + Invoke("Respawn", 1.5f); } /*