Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/arcade input ui #42

Merged
merged 3 commits into from
Aug 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion QPong-Unity-Version/Assets/Prefabs/Gate.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ SpriteRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: bbd9df16fa05943e08ec6aca6091b232, type: 3}
m_Sprite: {fileID: 21300000, guid: 03332da93d4254e82b8c19208cbe5dd6, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
Expand Down
244 changes: 243 additions & 1 deletion QPong-Unity-Version/Assets/Scenes/Game.unity
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,85 @@ Transform:
m_Father: {fileID: 1606482232}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &266898880
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 266898881}
- component: {fileID: 266898882}
m_Layer: 0
m_Name: q[0]
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &266898881
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 266898880}
m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068}
m_LocalPosition: {x: 0.001, y: 0.0946, z: 0}
m_LocalScale: {x: 0.005505937, y: 0.026984854, z: 1}
m_Children: []
m_Father: {fileID: 507773451}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &266898882
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 266898880}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: c61a8ffc1b567451bb083834b52f7c6b, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 2.45, y: 1.14}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &447822108
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -269,6 +348,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
gameHUD: {fileID: 447822110}
winScore: 7
showGameOverTime: 5
--- !u!114 &447822110
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -438,7 +518,10 @@ Transform:
m_LocalRotation: {x: -0, y: -0, z: 0.7071068, w: 0.7071068}
m_LocalPosition: {x: 0, y: -61, z: 0}
m_LocalScale: {x: 70.00003, y: 320.00012, z: 1}
m_Children: []
m_Children:
- {fileID: 1532643415}
- {fileID: 1363937773}
- {fileID: 266898881}
m_Father: {fileID: 1606482232}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
Expand All @@ -464,6 +547,7 @@ MonoBehaviour:
rowHeight: 8
xOffset: -30
yOffset: -61
spacer: 10
gateArray: []
selectedGate: {fileID: 0}
selectedRowNum: 0
Expand Down Expand Up @@ -499,6 +583,85 @@ MonoBehaviour:
circuitDepth: 0
stateNumber: 0
paddleArray: []
--- !u!1 &1363937772
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1363937773}
- component: {fileID: 1363937774}
m_Layer: 0
m_Name: q[1]
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1363937773
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1363937772}
m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068}
m_LocalPosition: {x: -0.0033, y: 0.0346, z: 0}
m_LocalScale: {x: 0.005505937, y: 0.02698485, z: 1}
m_Children: []
m_Father: {fileID: 507773451}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &1363937774
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1363937772}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 20bd3c4817dca47c9bd3bc1f0c489731, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 3.5, y: 1.6285714}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &1419376954
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -698,6 +861,85 @@ Transform:
m_Father: {fileID: 1606482232}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
--- !u!1 &1532643414
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1532643415}
- component: {fileID: 1532643416}
m_Layer: 0
m_Name: q[2]
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1532643415
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1532643414}
m_LocalRotation: {x: -0, y: -0, z: -0.7071068, w: 0.7071068}
m_LocalPosition: {x: -0.0025, y: -0.0262, z: 0}
m_LocalScale: {x: 0.005505937, y: 0.02698485, z: 1}
m_Children: []
m_Father: {fileID: 507773451}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &1532643416
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1532643414}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: f117a51179f524a0bbba071366721b45, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 3.5, y: 1.6285714}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &1606482231
GameObject:
m_ObjectHideFlags: 0
Expand Down
13 changes: 13 additions & 0 deletions QPong-Unity-Version/Assets/Scenes/MainMenu.unity
Original file line number Diff line number Diff line change
Expand Up @@ -597,13 +597,26 @@ GameObject:
m_Component:
- component: {fileID: 1838897482}
- component: {fileID: 1838897481}
- component: {fileID: 1838897480}
m_Layer: 0
m_Name: GameController
m_TagString: GameController
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1838897480
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1838897479}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 38c26591c543142d28bf0e7aaf6d62aa, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1838897481
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down
1 change: 1 addition & 0 deletions QPong-Unity-Version/Assets/Scripts/Definitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

// Game enums
public enum Scenes { MainMenu = 0, Game, Ranking, Credits};
public enum ArcadeButtonGates { None, iz, zi, ih, hi, ix, xi, cz };
Copy link
Collaborator

@filemaster filemaster Aug 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this time the game buttons are only for H & X gates, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes that is true but the buttons will be the same as Hello Quantum so i wanted to include them in the game in case we have a use for them


public class Definitions : MonoBehaviour {
// Static singleton Instance
Expand Down
24 changes: 24 additions & 0 deletions QPong-Unity-Version/Assets/Scripts/Game/ArcadeButtonInput.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;


public class ArcadeButtonInput : MonoBehaviour
{
public ArcadeButtonGates isButtonPressed()
{

foreach (string buttonName in System.Enum.GetNames(typeof(ArcadeButtonGates)))
{
if (buttonName == "None") { continue; }
if (Input.GetButtonDown(buttonName.ToUpper()))
{
ArcadeButtonGates button;
System.Enum.TryParse<ArcadeButtonGates>(buttonName, out button);
return button;
}
}

return ArcadeButtonGates.None;
}
}
11 changes: 11 additions & 0 deletions QPong-Unity-Version/Assets/Scripts/Game/ArcadeButtonInput.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class CircuitGridControl : MonoBehaviour
public int rowHeight = 5;
public float xOffset = -51f;
public float yOffset = -35f;
public float spacer = 10f;

// Variables for gate array
public string[] gateArray; // array of string representing gates
Expand Down Expand Up @@ -57,10 +58,11 @@ void Start()
{
int index = i * circuitDepth + j;
gateArray[index] = "I";
gateObjectArray[index] = (GameObject)Instantiate(emptyGate, new Vector2(xOffset + i * columnHeight, yOffset + -j * rowHeight),
gateObjectArray[index] = (GameObject)Instantiate(emptyGate, new Vector2((xOffset + i * columnHeight)+ spacer, yOffset + -j * rowHeight),
Quaternion.identity);
gateObjectArray[index].name = "gate["+i+"]["+j+"]";
}
spacer += 11;
}
selectedGate = GameObject.Find("gate[0][0]");
cursor = GameObject.Find("Cursor");
Expand Down
Loading