Skip to content

Commit

Permalink
1.0.1
Browse files Browse the repository at this point in the history
Changed comments, removed BackgroundImage
  • Loading branch information
RugbugRedfern committed Jun 7, 2022
1 parent 848f914 commit 4d348ce
Show file tree
Hide file tree
Showing 16 changed files with 143 additions and 182 deletions.
92 changes: 2 additions & 90 deletions Assets/Scenes/Game.unity
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ RectTransform:
- {fileID: 1058458553}
- {fileID: 349139944}
m_Father: {fileID: 1716128836}
m_RootOrder: 1
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
Expand Down Expand Up @@ -983,92 +983,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 948965529}
m_CullTransparentMesh: 1
--- !u!1 &970415716
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 970415717}
- component: {fileID: 970415719}
- component: {fileID: 970415718}
- component: {fileID: 970415720}
m_Layer: 5
m_Name: BackgroundImage
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &970415717
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 970415716}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1716128836}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &970415718
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 970415716}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 0}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
--- !u!222 &970415719
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 970415716}
m_CullTransparentMesh: 1
--- !u!114 &970415720
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 970415716}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c337eac6b9fd2ab44b3f305c52c07cbf, type: 3}
m_Name:
m_EditorClassIdentifier:
rawImage: {fileID: 970415718}
--- !u!1 &1004586247
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -2598,7 +2512,6 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 970415717}
- {fileID: 931885379}
- {fileID: 1924515355}
m_Father: {fileID: 0}
Expand Down Expand Up @@ -2898,7 +2811,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3d3fbe337bfa95945a2f79e080012c3b, type: 3}
m_Name:
m_EditorClassIdentifier:
time: 300
timerText: {fileID: 2110031176}
fillImage: {fileID: 948965531}
--- !u!1 &1804704519
Expand Down Expand Up @@ -3103,7 +3015,7 @@ RectTransform:
m_Children:
- {fileID: 1629749210}
m_Father: {fileID: 1716128836}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
Expand Down
40 changes: 0 additions & 40 deletions Assets/Scripts/BackgroundImage.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Assets/Scripts/BackgroundImage.cs.meta

This file was deleted.

10 changes: 9 additions & 1 deletion Assets/Scripts/EndScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
using UnityEngine;
using UnityEngine.SceneManagement;

// handles the screen that displays at the end of the game
/// <summary>
/// Handles the screen that displays at the end of the game
/// </summary>
public class EndScreen : MonoBehaviour
{
[SerializeField] GameObject gameScreen;
Expand All @@ -25,13 +27,19 @@ void Start()
endScreen.SetActive(false);
}

/// <summary>
/// Hide the game and show the end screen, and prepare for the user to restart
/// </summary>
void OnTimeExpired()
{
gameScreen.SetActive(false);
endScreen.SetActive(true);
InputManager.OnSubmit += OnSubmit;
}

/// <summary>
/// Called when the user presses enter while the end screen is open. Restarts the game
/// </summary>
void OnSubmit()
{
InputManager.OnSubmit -= OnSubmit;
Expand Down
4 changes: 3 additions & 1 deletion Assets/Scripts/InputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
using System.Collections.Generic;
using UnityEngine;

// handle any keyboard input for the entire game
/// <summary>
/// Handle player input for the entire game
/// </summary>
public class InputManager : MonoBehaviour
{
KeyCode[] letters = new KeyCode[] { KeyCode.A, KeyCode.B, KeyCode.C, KeyCode.D, KeyCode.E, KeyCode.F, KeyCode.G, KeyCode.H, KeyCode.I, KeyCode.J, KeyCode.K, KeyCode.L, KeyCode.M, KeyCode.N, KeyCode.O, KeyCode.P, KeyCode.Q, KeyCode.R, KeyCode.S, KeyCode.T, KeyCode.U, KeyCode.V, KeyCode.W, KeyCode.X, KeyCode.Y, KeyCode.Z };
Expand Down
12 changes: 9 additions & 3 deletions Assets/Scripts/Keyboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
using System.Collections.Generic;
using UnityEngine;

// a keyboard which displays missing keys
/// <summary>
/// An in-game keyboard which displays missing keys
/// </summary>
public class Keyboard : MonoBehaviour
{
public static Keyboard Instance;
Expand All @@ -27,7 +29,9 @@ void Start()
Generate();
}

// clear all the keys on the keyboard and generate a new one
/// <summary>
/// Clear all the keys on the keyboard and generate a new one
/// </summary>
public void Clear()
{
foreach(var row in rows)
Expand All @@ -41,7 +45,9 @@ public void Clear()
Generate();
}

// generate the keys on the keyboard
/// <summary>
/// Generate the keys on the keyboard
/// </summary>
void Generate()
{
for(int i = 0; i < layout.Length; i++)
Expand Down
11 changes: 10 additions & 1 deletion Assets/Scripts/KeyboardKeyBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@
using UnityEngine;
using UnityEngine.UI;

// an individual key on the keyboard, which will turn gray when it's found missing
/// <summary>
/// An individual key on the in-game keyboard, which will turn gray when it's found missing
/// </summary>
public class KeyboardKeyBox : MonoBehaviour
{
[SerializeField] TMP_Text text;
[SerializeField] Image background;

char key;

/// <summary>
/// Construct the KeyboardKeyBox
/// </summary>
/// <param name="key">The key for the key box to represent on the keyboard</param>
public void Initialize(char key)
{
this.key = key;
Expand All @@ -29,6 +35,9 @@ void OnDisable()
Row.OnSubmit -= OnSubmit;
}

/// <summary>
/// Called when enter is pressed. Update the visuals based on the missing letters
/// </summary>
void OnSubmit()
{
if(Wordle.ConfirmedMissingLetters.Contains(key))
Expand Down
Loading

0 comments on commit 4d348ce

Please sign in to comment.