From 0388505767a2095883935be203c6f37ab0af37c4 Mon Sep 17 00:00:00 2001 From: dantayy Date: Mon, 14 Oct 2019 19:01:05 -0400 Subject: [PATCH 01/17] Created structural folders for holding our assets, added manager game object to hold the manager script in, and added a rudimentary timing system to that manager script --- GDDImagineGame/Assets/Team2/prefabs.meta | 8 + GDDImagineGame/Assets/Team2/scenes.meta | 8 + .../Team2/scenes/PennyPinchersMainScene.unity | 339 ++++++++++++++++++ .../scenes/PennyPinchersMainScene.unity.meta | 7 + GDDImagineGame/Assets/Team2/scripts.meta | 8 + .../Assets/Team2/scripts/manager.cs | 37 ++ .../Assets/Team2/scripts/manager.cs.meta | 11 + 7 files changed, 418 insertions(+) create mode 100644 GDDImagineGame/Assets/Team2/prefabs.meta create mode 100644 GDDImagineGame/Assets/Team2/scenes.meta create mode 100644 GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity create mode 100644 GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity.meta create mode 100644 GDDImagineGame/Assets/Team2/scripts.meta create mode 100644 GDDImagineGame/Assets/Team2/scripts/manager.cs create mode 100644 GDDImagineGame/Assets/Team2/scripts/manager.cs.meta diff --git a/GDDImagineGame/Assets/Team2/prefabs.meta b/GDDImagineGame/Assets/Team2/prefabs.meta new file mode 100644 index 0000000..337c810 --- /dev/null +++ b/GDDImagineGame/Assets/Team2/prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4bbd5872d13810b4aa87a11a0d508e09 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/GDDImagineGame/Assets/Team2/scenes.meta b/GDDImagineGame/Assets/Team2/scenes.meta new file mode 100644 index 0000000..827ba17 --- /dev/null +++ b/GDDImagineGame/Assets/Team2/scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c10af02c6360be24fbd4266c6d07ae98 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity new file mode 100644 index 0000000..4d4f679 --- /dev/null +++ b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity @@ -0,0 +1,339 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &181728746 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 181728749} + - component: {fileID: 181728748} + - component: {fileID: 181728747} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &181728747 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 181728746} + m_Enabled: 1 +--- !u!20 &181728748 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 181728746} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &181728749 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 181728746} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &428008810 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 428008812} + - component: {fileID: 428008811} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &428008811 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 428008810} + m_Enabled: 1 + serializedVersion: 9 + m_Type: 1 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &428008812 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 428008810} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &1082955454 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1082955456} + - component: {fileID: 1082955455} + m_Layer: 0 + m_Name: Manager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1082955455 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1082955454} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 10e384338ca4fe843882191cb4960a3a, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &1082955456 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1082955454} + 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: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity.meta b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity.meta new file mode 100644 index 0000000..ff102ac --- /dev/null +++ b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 55fb805a56f917f4ba2ac5b852b0d9e8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/GDDImagineGame/Assets/Team2/scripts.meta b/GDDImagineGame/Assets/Team2/scripts.meta new file mode 100644 index 0000000..96810ea --- /dev/null +++ b/GDDImagineGame/Assets/Team2/scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 26f6cc606bd3cb04994839b968a08177 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/GDDImagineGame/Assets/Team2/scripts/manager.cs b/GDDImagineGame/Assets/Team2/scripts/manager.cs new file mode 100644 index 0000000..1293c87 --- /dev/null +++ b/GDDImagineGame/Assets/Team2/scripts/manager.cs @@ -0,0 +1,37 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class manager : MonoBehaviour +{ + + //private var for keeping track of the time + private float timer = 0.0f; + + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + //check to see if time is up for picking an action + if (timer >= 5.0f) + { + timer = 0.0f; + //Resolve player choices here + //After resolving choices and updating scores, check to see if the game would end here + } + else //default case, increment + { + timer += Time.deltaTime; + /* + Code for listening to player input and preventing them from making another choice would go here + Use public game objects that can be set to specific object instances in the unity editor + to set the variables that would be checked here + */ + } + } +} diff --git a/GDDImagineGame/Assets/Team2/scripts/manager.cs.meta b/GDDImagineGame/Assets/Team2/scripts/manager.cs.meta new file mode 100644 index 0000000..a98d372 --- /dev/null +++ b/GDDImagineGame/Assets/Team2/scripts/manager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 10e384338ca4fe843882191cb4960a3a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From ef1f5da35675e7dc1aea6c248ab62d9507afa7f2 Mon Sep 17 00:00:00 2001 From: Nicholas V Mercadante Date: Mon, 21 Oct 2019 13:12:16 -0400 Subject: [PATCH 02/17] Update manager.cs Added public var to easily change how long decision making rounds are on the fly in the editor --- GDDImagineGame/Assets/Team2/scripts/manager.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/GDDImagineGame/Assets/Team2/scripts/manager.cs b/GDDImagineGame/Assets/Team2/scripts/manager.cs index 1293c87..d91aa5f 100644 --- a/GDDImagineGame/Assets/Team2/scripts/manager.cs +++ b/GDDImagineGame/Assets/Team2/scripts/manager.cs @@ -7,7 +7,9 @@ public class manager : MonoBehaviour //private var for keeping track of the time private float timer = 0.0f; - + //public var for how long a "round" should be (time when players can choose an action) + public float timeToChoose = 0.0f; + // Start is called before the first frame update void Start() { @@ -18,7 +20,7 @@ void Start() void Update() { //check to see if time is up for picking an action - if (timer >= 5.0f) + if (timer >= timeToChoose) { timer = 0.0f; //Resolve player choices here From a91e7b9530fc0a93fa28543c1dbf6a4498ba1995 Mon Sep 17 00:00:00 2001 From: Cavan Vince Date: Mon, 21 Oct 2019 17:33:53 -0400 Subject: [PATCH 03/17] Implemented a basic coin and player prefab. --- GDDImagineGame/Assets/Team2/Material.meta | 8 ++ .../Assets/Team2/Material/Coin Material.mat | 77 +++++++++++++++ .../Team2/Material/Coin Material.mat.meta | 8 ++ .../Assets/Team2/Material/Player Material.mat | 77 +++++++++++++++ .../Team2/Material/Player Material.mat.meta | 8 ++ .../Assets/Team2/Prefabs/Coin.prefab | 94 +++++++++++++++++++ .../Assets/Team2/Prefabs/Coin.prefab.meta | 7 ++ .../Assets/Team2/Prefabs/Player.prefab | 94 +++++++++++++++++++ .../Assets/Team2/Prefabs/Player.prefab.meta | 7 ++ GDDImagineGame/Assets/Team2/prefabs.meta | 2 +- .../Team2/scenes/PennyPinchersMainScene.unity | 1 + 11 files changed, 382 insertions(+), 1 deletion(-) create mode 100644 GDDImagineGame/Assets/Team2/Material.meta create mode 100644 GDDImagineGame/Assets/Team2/Material/Coin Material.mat create mode 100644 GDDImagineGame/Assets/Team2/Material/Coin Material.mat.meta create mode 100644 GDDImagineGame/Assets/Team2/Material/Player Material.mat create mode 100644 GDDImagineGame/Assets/Team2/Material/Player Material.mat.meta create mode 100644 GDDImagineGame/Assets/Team2/Prefabs/Coin.prefab create mode 100644 GDDImagineGame/Assets/Team2/Prefabs/Coin.prefab.meta create mode 100644 GDDImagineGame/Assets/Team2/Prefabs/Player.prefab create mode 100644 GDDImagineGame/Assets/Team2/Prefabs/Player.prefab.meta diff --git a/GDDImagineGame/Assets/Team2/Material.meta b/GDDImagineGame/Assets/Team2/Material.meta new file mode 100644 index 0000000..c1e2427 --- /dev/null +++ b/GDDImagineGame/Assets/Team2/Material.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 57644ab78d89fa347914cca967be049c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/GDDImagineGame/Assets/Team2/Material/Coin Material.mat b/GDDImagineGame/Assets/Team2/Material/Coin Material.mat new file mode 100644 index 0000000..3f70645 --- /dev/null +++ b/GDDImagineGame/Assets/Team2/Material/Coin Material.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Coin Material + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 0.95848835, b: 0, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/GDDImagineGame/Assets/Team2/Material/Coin Material.mat.meta b/GDDImagineGame/Assets/Team2/Material/Coin Material.mat.meta new file mode 100644 index 0000000..5905ae6 --- /dev/null +++ b/GDDImagineGame/Assets/Team2/Material/Coin Material.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 04dbdd18b4f35d24d9eec55f01d0479c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/GDDImagineGame/Assets/Team2/Material/Player Material.mat b/GDDImagineGame/Assets/Team2/Material/Player Material.mat new file mode 100644 index 0000000..9dbbbc3 --- /dev/null +++ b/GDDImagineGame/Assets/Team2/Material/Player Material.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Player Material + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0, g: 1, b: 0.16466069, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/GDDImagineGame/Assets/Team2/Material/Player Material.mat.meta b/GDDImagineGame/Assets/Team2/Material/Player Material.mat.meta new file mode 100644 index 0000000..a61a9d9 --- /dev/null +++ b/GDDImagineGame/Assets/Team2/Material/Player Material.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 200c5bd3164b0c54fa3e9bbc6edebaa9 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/GDDImagineGame/Assets/Team2/Prefabs/Coin.prefab b/GDDImagineGame/Assets/Team2/Prefabs/Coin.prefab new file mode 100644 index 0000000..6e66ca4 --- /dev/null +++ b/GDDImagineGame/Assets/Team2/Prefabs/Coin.prefab @@ -0,0 +1,94 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1813527851782636589 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 338036885544786708} + - component: {fileID: 7857606696315734856} + - component: {fileID: 3279890082606961912} + - component: {fileID: 4555479259353167844} + m_Layer: 0 + m_Name: Coin + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &338036885544786708 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1813527851782636589} + 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: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &7857606696315734856 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1813527851782636589} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &3279890082606961912 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1813527851782636589} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 04dbdd18b4f35d24d9eec55f01d0479c, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!135 &4555479259353167844 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1813527851782636589} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} diff --git a/GDDImagineGame/Assets/Team2/Prefabs/Coin.prefab.meta b/GDDImagineGame/Assets/Team2/Prefabs/Coin.prefab.meta new file mode 100644 index 0000000..35b81e6 --- /dev/null +++ b/GDDImagineGame/Assets/Team2/Prefabs/Coin.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ec1f48a9c17540640a22691bf211467c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/GDDImagineGame/Assets/Team2/Prefabs/Player.prefab b/GDDImagineGame/Assets/Team2/Prefabs/Player.prefab new file mode 100644 index 0000000..0b2b825 --- /dev/null +++ b/GDDImagineGame/Assets/Team2/Prefabs/Player.prefab @@ -0,0 +1,94 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3450864664022239381 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3433337596703189776} + - component: {fileID: 3843486313076265647} + - component: {fileID: 2848838135613030650} + - component: {fileID: 4930160925161552117} + m_Layer: 0 + m_Name: Player + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3433337596703189776 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3450864664022239381} + 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: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &3843486313076265647 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3450864664022239381} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &2848838135613030650 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3450864664022239381} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 200c5bd3164b0c54fa3e9bbc6edebaa9, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!65 &4930160925161552117 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3450864664022239381} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} diff --git a/GDDImagineGame/Assets/Team2/Prefabs/Player.prefab.meta b/GDDImagineGame/Assets/Team2/Prefabs/Player.prefab.meta new file mode 100644 index 0000000..c660289 --- /dev/null +++ b/GDDImagineGame/Assets/Team2/Prefabs/Player.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 82734d121651e644081af68b67e6b645 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/GDDImagineGame/Assets/Team2/prefabs.meta b/GDDImagineGame/Assets/Team2/prefabs.meta index 337c810..24bed7e 100644 --- a/GDDImagineGame/Assets/Team2/prefabs.meta +++ b/GDDImagineGame/Assets/Team2/prefabs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4bbd5872d13810b4aa87a11a0d508e09 +guid: 33c893748f13bc64884c68a2d87bd44c folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity index 4d4f679..cd156b6 100644 --- a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity +++ b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity @@ -323,6 +323,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 10e384338ca4fe843882191cb4960a3a, type: 3} m_Name: m_EditorClassIdentifier: + timeToChoose: 0 --- !u!4 &1082955456 Transform: m_ObjectHideFlags: 0 From 6282062c53ed9a30b8aaf3ba98976d18281db177 Mon Sep 17 00:00:00 2001 From: Cavan Vince Date: Mon, 21 Oct 2019 21:49:49 -0400 Subject: [PATCH 04/17] Added a Player Controller script that checks for one of three button presses to determine the player's action. --- .../Assets/Team2/Prefabs/Player.prefab | 13 +++++++ .../Assets/Team2/scripts/PlayerController.cs | 37 +++++++++++++++++++ .../Team2/scripts/PlayerController.cs.meta | 11 ++++++ 3 files changed, 61 insertions(+) create mode 100644 GDDImagineGame/Assets/Team2/scripts/PlayerController.cs create mode 100644 GDDImagineGame/Assets/Team2/scripts/PlayerController.cs.meta diff --git a/GDDImagineGame/Assets/Team2/Prefabs/Player.prefab b/GDDImagineGame/Assets/Team2/Prefabs/Player.prefab index 0b2b825..90d0d64 100644 --- a/GDDImagineGame/Assets/Team2/Prefabs/Player.prefab +++ b/GDDImagineGame/Assets/Team2/Prefabs/Player.prefab @@ -12,6 +12,7 @@ GameObject: - component: {fileID: 3843486313076265647} - component: {fileID: 2848838135613030650} - component: {fileID: 4930160925161552117} + - component: {fileID: -3222763401902802492} m_Layer: 0 m_Name: Player m_TagString: Untagged @@ -92,3 +93,15 @@ BoxCollider: serializedVersion: 2 m_Size: {x: 1, y: 1, z: 1} m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &-3222763401902802492 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3450864664022239381} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6443632a6d5aeba4c96a823bed9abb34, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs b/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs new file mode 100644 index 0000000..0fa5942 --- /dev/null +++ b/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs @@ -0,0 +1,37 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class PlayerController : MonoBehaviour +{ + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + PlayerAction(); + } + + /// + /// Check for user input and print a message on the console that corresponds with the key that the user pressed + /// + public void PlayerAction() + { + if (Input.GetKeyDown(KeyCode.Alpha1)) + { + Debug.Log("Go For Main Pot"); + } + else if (Input.GetKeyDown(KeyCode.Alpha2)) + { + Debug.Log("Steal"); + } + else if (Input.GetKeyDown(KeyCode.Alpha3)) + { + Debug.Log("Block"); + } + } +} diff --git a/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs.meta b/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs.meta new file mode 100644 index 0000000..07b1938 --- /dev/null +++ b/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6443632a6d5aeba4c96a823bed9abb34 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 3b4f0e216fb8579a2f2bcffc14572e3c48fba7f4 Mon Sep 17 00:00:00 2001 From: Cavan Vince Date: Mon, 21 Oct 2019 21:53:59 -0400 Subject: [PATCH 05/17] Added a very basic "table" (background) for the player and coins to sit on. --- .../Assets/Team2/Material/Table.mat | 77 +++++++++++++++ .../Assets/Team2/Material/Table.mat.meta | 8 ++ .../Team2/scenes/PennyPinchersMainScene.unity | 98 ++++++++++++++++++- 3 files changed, 180 insertions(+), 3 deletions(-) create mode 100644 GDDImagineGame/Assets/Team2/Material/Table.mat create mode 100644 GDDImagineGame/Assets/Team2/Material/Table.mat.meta diff --git a/GDDImagineGame/Assets/Team2/Material/Table.mat b/GDDImagineGame/Assets/Team2/Material/Table.mat new file mode 100644 index 0000000..41c2fc8 --- /dev/null +++ b/GDDImagineGame/Assets/Team2/Material/Table.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Table + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.49056602, g: 0.40741608, b: 0.3216447, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/GDDImagineGame/Assets/Team2/Material/Table.mat.meta b/GDDImagineGame/Assets/Team2/Material/Table.mat.meta new file mode 100644 index 0000000..45a8740 --- /dev/null +++ b/GDDImagineGame/Assets/Team2/Material/Table.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dd1ca873c3597f2439546c4337d381f4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity index cd156b6..9c0a618 100644 --- a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity +++ b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity @@ -120,6 +120,98 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &141720462 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 141720466} + - component: {fileID: 141720465} + - component: {fileID: 141720464} + - component: {fileID: 141720463} + m_Layer: 0 + m_Name: Table (Background) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &141720463 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 141720462} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &141720464 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 141720462} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: dd1ca873c3597f2439546c4337d381f4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &141720465 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 141720462} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &141720466 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 141720462} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 25, y: 1, z: 25} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &181728746 GameObject: m_ObjectHideFlags: 0 @@ -196,13 +288,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 181728746} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 25, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} --- !u!1 &428008810 GameObject: m_ObjectHideFlags: 0 From cb24950619cfec75a9cd1306d8bc7daa10a35675 Mon Sep 17 00:00:00 2001 From: Ricky Guerin Date: Sun, 3 Nov 2019 20:26:58 -0500 Subject: [PATCH 06/17] Move camera and add game objects --- .../Team2/scenes/PennyPinchersMainScene.unity | 409 +++++++++++++++++- 1 file changed, 406 insertions(+), 3 deletions(-) diff --git a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity index 9c0a618..d7bbea9 100644 --- a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity +++ b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity @@ -288,13 +288,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 181728746} - m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 25, z: 0} + m_LocalRotation: {x: 0.2588191, y: 0, z: 0, w: 0.9659258} + m_LocalPosition: {x: 0, y: 10, z: -13.64} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 30, y: 0, z: 0} --- !u!1 &428008810 GameObject: m_ObjectHideFlags: 0 @@ -386,6 +386,156 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1001 &741822260 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1603494478} + m_Modifications: + - target: {fileID: 3450864664022239381, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_Name + value: Player Three + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalPosition.x + value: 1.75 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 82734d121651e644081af68b67e6b645, type: 3} +--- !u!4 &741822261 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + m_PrefabInstance: {fileID: 741822260} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &821587121 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1603494478} + m_Modifications: + - target: {fileID: 3450864664022239381, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_Name + value: Player Four + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalPosition.x + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 82734d121651e644081af68b67e6b645, type: 3} +--- !u!4 &821587122 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + m_PrefabInstance: {fileID: 821587121} + m_PrefabAsset: {fileID: 0} --- !u!1 &1082955454 GameObject: m_ObjectHideFlags: 0 @@ -430,3 +580,256 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1446843446 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1603494478} + m_Modifications: + - target: {fileID: 3450864664022239381, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_Name + value: Player Two + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalPosition.x + value: -1.75 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 82734d121651e644081af68b67e6b645, type: 3} +--- !u!4 &1446843447 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + m_PrefabInstance: {fileID: 1446843446} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &1603432931 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1603494478} + m_Modifications: + - target: {fileID: 3450864664022239381, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_Name + value: Player One + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalPosition.x + value: -5 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 82734d121651e644081af68b67e6b645, type: 3} +--- !u!4 &1603432932 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, + type: 3} + m_PrefabInstance: {fileID: 1603432931} + m_PrefabAsset: {fileID: 0} +--- !u!1 &1603494477 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1603494478} + m_Layer: 0 + m_Name: Players + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1603494478 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1603494477} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -5} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1603432932} + - {fileID: 1446843447} + - {fileID: 741822261} + - {fileID: 821587122} + m_Father: {fileID: 0} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &2088653255 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1813527851782636589, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_Name + value: Coin + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalPosition.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalPosition.z + value: 1.5 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_RootOrder + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: ec1f48a9c17540640a22691bf211467c, type: 3} From e7a557b8f6a4875d0c23cc791f4ebc06323769ef Mon Sep 17 00:00:00 2001 From: dantayy Date: Sun, 3 Nov 2019 22:26:54 -0500 Subject: [PATCH 07/17] Added public gameobject variables to the manager script and dropped the player prefabs in the scene into them so the manager can mess with them during the game loop --- .../Team2/scenes/PennyPinchersMainScene.unity | 28 +++++++++++++++++++ .../Assets/Team2/scripts/manager.cs | 7 ++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity index d7bbea9..802d2a3 100644 --- a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity +++ b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity @@ -120,6 +120,12 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &64169714 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 3450864664022239381, guid: 82734d121651e644081af68b67e6b645, + type: 3} + m_PrefabInstance: {fileID: 821587121} + m_PrefabAsset: {fileID: 0} --- !u!1 &141720462 GameObject: m_ObjectHideFlags: 0 @@ -566,6 +572,10 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: timeToChoose: 0 + player1: {fileID: 2026101235} + player2: {fileID: 1522733016} + player3: {fileID: 1175170418} + player4: {fileID: 64169714} --- !u!4 &1082955456 Transform: m_ObjectHideFlags: 0 @@ -580,6 +590,12 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1175170418 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 3450864664022239381, guid: 82734d121651e644081af68b67e6b645, + type: 3} + m_PrefabInstance: {fileID: 741822260} + m_PrefabAsset: {fileID: 0} --- !u!1001 &1446843446 PrefabInstance: m_ObjectHideFlags: 0 @@ -655,6 +671,12 @@ Transform: type: 3} m_PrefabInstance: {fileID: 1446843446} m_PrefabAsset: {fileID: 0} +--- !u!1 &1522733016 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 3450864664022239381, guid: 82734d121651e644081af68b67e6b645, + type: 3} + m_PrefabInstance: {fileID: 1446843446} + m_PrefabAsset: {fileID: 0} --- !u!1001 &1603432931 PrefabInstance: m_ObjectHideFlags: 0 @@ -764,6 +786,12 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2026101235 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 3450864664022239381, guid: 82734d121651e644081af68b67e6b645, + type: 3} + m_PrefabInstance: {fileID: 1603432931} + m_PrefabAsset: {fileID: 0} --- !u!1001 &2088653255 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/GDDImagineGame/Assets/Team2/scripts/manager.cs b/GDDImagineGame/Assets/Team2/scripts/manager.cs index d91aa5f..252885d 100644 --- a/GDDImagineGame/Assets/Team2/scripts/manager.cs +++ b/GDDImagineGame/Assets/Team2/scripts/manager.cs @@ -9,7 +9,12 @@ public class manager : MonoBehaviour private float timer = 0.0f; //public var for how long a "round" should be (time when players can choose an action) public float timeToChoose = 0.0f; - + //public vars for managing the 4 players + public GameObject player1; + public GameObject player2; + public GameObject player3; + public GameObject player4; + // Start is called before the first frame update void Start() { From d27f8e96f14c7221889cb9c3c00b4247fee61ee8 Mon Sep 17 00:00:00 2001 From: Dantayy Date: Fri, 8 Nov 2019 20:32:25 -0500 Subject: [PATCH 08/17] Implemented rudimentary game loop with debug logs denoting player actions and score updates --- .../Team2/scenes/PennyPinchersMainScene.unity | 20 ++++- .../Assets/Team2/scripts/PlayerController.cs | 44 +++++++--- .../Assets/Team2/scripts/manager.cs | 83 ++++++++++++++++++- 3 files changed, 133 insertions(+), 14 deletions(-) diff --git a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity index 802d2a3..3885fd9 100644 --- a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity +++ b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity @@ -571,11 +571,14 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 10e384338ca4fe843882191cb4960a3a, type: 3} m_Name: m_EditorClassIdentifier: - timeToChoose: 0 + timeToChoose: 5 player1: {fileID: 2026101235} player2: {fileID: 1522733016} player3: {fileID: 1175170418} player4: {fileID: 64169714} + potValue: 10 + potIncrease: 5 + numRounds: 5 --- !u!4 &1082955456 Transform: m_ObjectHideFlags: 0 @@ -744,6 +747,21 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: potButton + value: 113 + objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: stealButton + value: 119 + objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: blockButton + value: 101 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 82734d121651e644081af68b67e6b645, type: 3} --- !u!4 &1603432932 stripped diff --git a/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs b/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs index 0fa5942..01968a5 100644 --- a/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs +++ b/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs @@ -2,12 +2,28 @@ using System.Collections.Generic; using UnityEngine; +public enum Choice +{ + pot, + steal, + block, + none +} + public class PlayerController : MonoBehaviour { + + public int score; + public Choice choice; + public KeyCode potButton; + public KeyCode stealButton; + public KeyCode blockButton; + // Start is called before the first frame update void Start() { - + score = 0; + choice = Choice.none; } // Update is called once per frame @@ -21,17 +37,23 @@ void Update() /// public void PlayerAction() { - if (Input.GetKeyDown(KeyCode.Alpha1)) - { - Debug.Log("Go For Main Pot"); - } - else if (Input.GetKeyDown(KeyCode.Alpha2)) - { - Debug.Log("Steal"); - } - else if (Input.GetKeyDown(KeyCode.Alpha3)) + if (choice == Choice.none) { - Debug.Log("Block"); + if (Input.GetKeyDown(potButton)) + { + Debug.Log(name + " is going for main pot"); + choice = Choice.pot; + } + else if (Input.GetKeyDown(stealButton)) + { + Debug.Log(name + " is stealing"); + choice = Choice.steal; + } + else if (Input.GetKeyDown(blockButton)) + { + Debug.Log(name + " is going for blocking"); + choice = Choice.block; + } } } } diff --git a/GDDImagineGame/Assets/Team2/scripts/manager.cs b/GDDImagineGame/Assets/Team2/scripts/manager.cs index 252885d..79a10ec 100644 --- a/GDDImagineGame/Assets/Team2/scripts/manager.cs +++ b/GDDImagineGame/Assets/Team2/scripts/manager.cs @@ -15,21 +15,100 @@ public class manager : MonoBehaviour public GameObject player3; public GameObject player4; + //public var for the pot value + public int potValue; + public int potIncrease; + + //vars for rounds + public int numRounds; + private int roundNum; + private bool gameOver; + + private PlayerController [] players; + // Start is called before the first frame update void Start() { - + players = new PlayerController[] { player1.GetComponent(), player2.GetComponent(), player3.GetComponent(), player4.GetComponent() }; + roundNum = 1; + gameOver = false; } // Update is called once per frame void Update() { //check to see if time is up for picking an action - if (timer >= timeToChoose) + if (timer >= timeToChoose && !gameOver) { + //reset timer timer = 0.0f; //Resolve player choices here + + //condense players choices for checks + Choice[] choices = { players[0].choice, players[1].choice, players[2].choice, players[3].choice }; + + //temp vars for checking who is going to pot + int potNum = 0; + int potPlayerNum = -1; + + //check players choices + for (int i = 0; i < choices.Length; i++) + { + //if pot, increase pot num and assign player + if (choices[i] == Choice.pot) + { + potNum++; + potPlayerNum = i; + } + //handle steals + else if (choices[i] == Choice.steal) + { + //ignore if the next player over is blocking, otherwise give half of score to player stealing + if(choices[(i + 1) % 4] != Choice.block) + { + int half = (int)Mathf.Ceil(players[(i + 1) % 4].score / 2); + players[i].score += half; + players[(i + 1) % 4].score -= half; + } + } + } + //if only 1 going for pot, give them pot value + if(potNum == 1) + { + players[potPlayerNum].score += potValue; + } + //After resolving choices and updating scores, check to see if the game would end here + //reset players choices and give them some pity money + foreach(PlayerController pc in players) + { + pc.choice = Choice.none; + pc.score += 1; + Debug.Log(pc.name + "'s score is: " + pc.score); + } + //increase pots value + potValue += potIncrease; + + //increase round number + roundNum++; + + //ends the game if max rounds reached + if(roundNum >= numRounds) + { + int highScorePlayer = -1; + int highScore = 0; + for (int i = 0; i < players.Length; i++) + { + if(players[i].score > highScore) + { + highScore = players[i].score; + highScorePlayer = i; + } + } + + Debug.Log("The winner is player " + (highScorePlayer + 1) + " with a score of " + highScore); + gameOver = true; + } } else //default case, increment { From 01a12e7e6eda65a6f49e7327943b9943d34f3f14 Mon Sep 17 00:00:00 2001 From: Dantayy Date: Fri, 8 Nov 2019 23:30:22 -0500 Subject: [PATCH 09/17] Began implementing functionality for player animation and UI --- .../Team2/scenes/PennyPinchersMainScene.unity | 378 +++++++++++++++++- .../Assets/Team2/scripts/PlayerController.cs | 80 +++- .../Assets/Team2/scripts/manager.cs | 91 ++++- 3 files changed, 509 insertions(+), 40 deletions(-) diff --git a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity index 3885fd9..d0c43ab 100644 --- a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity +++ b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity @@ -126,6 +126,105 @@ GameObject: type: 3} m_PrefabInstance: {fileID: 821587121} m_PrefabAsset: {fileID: 0} +--- !u!1 &115035822 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 115035826} + - component: {fileID: 115035825} + - component: {fileID: 115035824} + - component: {fileID: 115035823} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &115035823 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 115035822} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &115035824 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 115035822} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!223 &115035825 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 115035822} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &115035826 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 115035822} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 459929872} + m_Father: {fileID: 0} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} --- !u!1 &141720462 GameObject: m_ObjectHideFlags: 0 @@ -392,6 +491,229 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &447834208 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 447834211} + - component: {fileID: 447834210} + - component: {fileID: 447834209} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &447834209 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 447834208} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &447834210 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 447834208} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &447834211 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 447834208} + 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: 0} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &459929871 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 459929872} + - component: {fileID: 459929874} + - component: {fileID: 459929873} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &459929872 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 459929871} + 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: 115035826} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 171, y: -73} + m_SizeDelta: {x: 200, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &459929873 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 459929871} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_text: 'Timer:' + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_outlineColor: + serializedVersion: 2 + rgba: 4278190080 + m_fontSize: 36 + m_fontSizeBase: 36 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_textAlignment: 257 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 0 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_firstOverflowCharacterIndex: -1 + m_linkedTextComponent: {fileID: 0} + m_isLinkedTextComponent: 0 + m_isTextTruncated: 0 + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_ignoreRectMaskCulling: 0 + m_ignoreCulling: 1 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_VertexBufferAutoSizeReduction: 1 + m_firstVisibleCharacter: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: -157.81519, w: 0} + m_textInfo: + textComponent: {fileID: 459929873} + characterCount: 6 + spriteCount: 0 + spaceCount: 0 + wordCount: 1 + linkCount: 0 + lineCount: 1 + pageCount: 1 + materialCount: 1 + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_spriteAnimator: {fileID: 0} + m_hasFontAssetChanged: 0 + m_subTextObjects: + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &459929874 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 459929871} + m_CullTransparentMesh: 0 --- !u!1001 &741822260 PrefabInstance: m_ObjectHideFlags: 0 @@ -407,7 +729,7 @@ PrefabInstance: - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalPosition.x - value: 1.75 + value: 5 objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} @@ -422,12 +744,12 @@ PrefabInstance: - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalRotation.y - value: -0 + value: 0.7071068 objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} @@ -437,7 +759,7 @@ PrefabInstance: - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalRotation.w - value: 1 + value: -0.7071068 objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} @@ -452,7 +774,7 @@ PrefabInstance: - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalEulerAnglesHint.y - value: 0 + value: 270 objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} @@ -482,7 +804,7 @@ PrefabInstance: - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalPosition.x - value: 5 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} @@ -492,7 +814,7 @@ PrefabInstance: - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalPosition.z - value: 0 + value: -5 objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} @@ -571,6 +893,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 10e384338ca4fe843882191cb4960a3a, type: 3} m_Name: m_EditorClassIdentifier: + timer: 0 + timerText: {fileID: 0} + textObject: {fileID: 459929871} timeToChoose: 5 player1: {fileID: 2026101235} player2: {fileID: 1522733016} @@ -614,7 +939,7 @@ PrefabInstance: - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalPosition.x - value: -1.75 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} @@ -624,27 +949,27 @@ PrefabInstance: - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalPosition.z - value: 0 + value: 5 objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalRotation.y - value: -0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalRotation.z - value: -0 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalRotation.w - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} @@ -659,7 +984,7 @@ PrefabInstance: - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalEulerAnglesHint.y - value: 0 + value: 180 objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} @@ -715,7 +1040,7 @@ PrefabInstance: - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: 0.7071068 objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} @@ -725,7 +1050,7 @@ PrefabInstance: - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalRotation.w - value: 1 + value: 0.7071068 objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} @@ -740,7 +1065,7 @@ PrefabInstance: - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalEulerAnglesHint.y - value: 0 + value: 90 objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} @@ -762,6 +1087,21 @@ PrefabInstance: propertyPath: blockButton value: 101 objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: stealLeft + value: 276 + objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: stealAcross + value: 273 + objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: stealRight + value: 275 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 82734d121651e644081af68b67e6b645, type: 3} --- !u!4 &1603432932 stripped @@ -794,7 +1134,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1603494477} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: -5} + m_LocalPosition: {x: 0, y: 1, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1603432932} @@ -835,7 +1175,7 @@ PrefabInstance: - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, type: 3} propertyPath: m_LocalPosition.z - value: 1.5 + value: 0 objectReference: {fileID: 0} - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, type: 3} diff --git a/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs b/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs index 01968a5..809a872 100644 --- a/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs +++ b/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs @@ -2,10 +2,13 @@ using System.Collections.Generic; using UnityEngine; +//enum for choices a player can make public enum Choice { pot, - steal, + stealLeft, + stealAcross, + stealRight, block, none } @@ -13,16 +16,25 @@ public enum Choice public class PlayerController : MonoBehaviour { + //vars for players public int score; + //public bool animating; + //public bool firstHalf; public Choice choice; public KeyCode potButton; public KeyCode stealButton; public KeyCode blockButton; + public KeyCode stealLeft; + public KeyCode stealAcross; + public KeyCode stealRight; // Start is called before the first frame update void Start() { + //initialize some vars score = 0; + //animating = false; + //firstHalf = true; choice = Choice.none; } @@ -30,6 +42,17 @@ void Start() void Update() { PlayerAction(); + //if (animating) + //{ + // if (firstHalf) + // { + + // } + // else + // { + + // } + //} } /// @@ -37,18 +60,35 @@ void Update() /// public void PlayerAction() { + //only let player make choice if none have been made yet if (choice == Choice.none) { + //player wants to go for pot if (Input.GetKeyDown(potButton)) { Debug.Log(name + " is going for main pot"); choice = Choice.pot; } - else if (Input.GetKeyDown(stealButton)) + //player wants to go for a steal, handle who they're trying to steal from + else if (Input.GetKey(stealButton)) { - Debug.Log(name + " is stealing"); - choice = Choice.steal; + if (Input.GetKeyDown(stealLeft)) + { + Debug.Log(name + " is stealing from the player to the left of them"); + choice = Choice.stealLeft; + } + else if (Input.GetKeyDown(stealAcross)) + { + Debug.Log(name + " is stealing from the player across from them"); + choice = Choice.stealAcross; + } + else if (Input.GetKeyDown(stealRight)) + { + Debug.Log(name + " is stealing from the player to the right of them"); + choice = Choice.stealRight; + } } + //player wants to block else if (Input.GetKeyDown(blockButton)) { Debug.Log(name + " is going for blocking"); @@ -56,4 +96,36 @@ public void PlayerAction() } } } + + ////helper function for a successful pot steal animation + //public void PlayerMoveToPotSuccessFul() + //{ + // animating = true; + //} + + ////helper function for a unsuccessful pot steal animation + //public void PlayerMoveToPotUnsuccessFul() + //{ + // animating = true; + //} + + ////helper function for a unsuccessful pot steal animation + //public void PlayerMoveToStealSuccessFul(float degreesToRotate) + //{ + // animating = true; + + //} + + ////helper function for a unsuccessful pot steal animation + //public void PlayerMoveToStealUnsuccessFul(float degreesToRotate) + //{ + // animating = true; + //} + + ////helper function for a block animation + //public void PlayerMoveToBlock() + //{ + // animating = true; + + //} } diff --git a/GDDImagineGame/Assets/Team2/scripts/manager.cs b/GDDImagineGame/Assets/Team2/scripts/manager.cs index 79a10ec..cf70160 100644 --- a/GDDImagineGame/Assets/Team2/scripts/manager.cs +++ b/GDDImagineGame/Assets/Team2/scripts/manager.cs @@ -1,14 +1,20 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using TMPro; public class manager : MonoBehaviour { //private var for keeping track of the time - private float timer = 0.0f; + public float timer = 0.0f; + + //vars for updating the timer UI + //public TextMeshProUGUI timerText; + //public GameObject textObject; + //public var for how long a "round" should be (time when players can choose an action) - public float timeToChoose = 0.0f; + public float timeToChoose; //public vars for managing the 4 players public GameObject player1; public GameObject player2; @@ -24,19 +30,29 @@ public class manager : MonoBehaviour private int roundNum; private bool gameOver; - private PlayerController [] players; + //var for checking if players are animating after a round has been calculated + private bool playersAnimating; + + private PlayerController[] players; // Start is called before the first frame update void Start() { + //initialize some vars players = new PlayerController[] { player1.GetComponent(), player2.GetComponent(), player3.GetComponent(), player4.GetComponent() }; roundNum = 1; gameOver = false; + playersAnimating = false; + //timerText = textObject.GetComponent(); + //timerText.SetText("Timer: " + timeToChoose); } // Update is called once per frame void Update() { + ////make sure animations aren't happening at the moment + //if (!players[0].animating && !players[1].animating && !players[2].animating && !players[3].animating) + //{ //check to see if time is up for picking an action if (timer >= timeToChoose && !gameOver) { @@ -61,26 +77,70 @@ void Update() potPlayerNum = i; } //handle steals - else if (choices[i] == Choice.steal) + else if (choices[i] == Choice.stealLeft || choices[i] == Choice.stealAcross || choices[i] == Choice.stealRight) { - //ignore if the next player over is blocking, otherwise give half of score to player stealing - if(choices[(i + 1) % 4] != Choice.block) + int target = -1; + float degreesToRotate = 0; + switch (choices[i]) + { + case Choice.stealLeft: + target = (i - 1) % 4; + degreesToRotate = -90; + break; + case Choice.stealAcross: + target = (i + 2) % 4; + degreesToRotate = 180; + break; + case Choice.stealRight: + target = (i + 1) % 4; + degreesToRotate = 90; + break; + default: + break; + } + //ignore if the chosen player is blocking, otherwise give half of score to player stealing + if (choices[target] != Choice.block) { - int half = (int)Mathf.Ceil(players[(i + 1) % 4].score / 2); + int half = (int)Mathf.Ceil(players[target].score / 2); + //players[i].PlayerMoveToStealSuccessFul(degreesToRotate); players[i].score += half; - players[(i + 1) % 4].score -= half; + players[target].score -= half; + } + else + { + //players[i].PlayerMoveToStealUnsuccessFul(degreesToRotate); } } } //if only 1 going for pot, give them pot value - if(potNum == 1) + if (potNum == 1) { + //players[potPlayerNum].PlayerMoveToPotSuccessFul(); + //players[potPlayerNum].animating = true; players[potPlayerNum].score += potValue; } + else if (potNum > 1) + { + foreach (PlayerController pc in players) + { + if (pc.choice == Choice.pot) + { + //pc.PlayerMoveToPotUnsuccessFul(); + } + } + } + + foreach (PlayerController pc in players) + { + if (pc.choice == Choice.block) + { + //pc.PlayerMoveToBlock(); + } + } //After resolving choices and updating scores, check to see if the game would end here //reset players choices and give them some pity money - foreach(PlayerController pc in players) + foreach (PlayerController pc in players) { pc.choice = Choice.none; pc.score += 1; @@ -93,13 +153,13 @@ void Update() roundNum++; //ends the game if max rounds reached - if(roundNum >= numRounds) + if (roundNum >= numRounds) { int highScorePlayer = -1; int highScore = 0; for (int i = 0; i < players.Length; i++) { - if(players[i].score > highScore) + if (players[i].score > highScore) { highScore = players[i].score; highScorePlayer = i; @@ -113,11 +173,8 @@ void Update() else //default case, increment { timer += Time.deltaTime; - /* - Code for listening to player input and preventing them from making another choice would go here - Use public game objects that can be set to specific object instances in the unity editor - to set the variables that would be checked here - */ + //timerText.SetText("Timer: " + Mathf.Round((timeToChoose - timer)*100)/100); } + //} } } From 36df6cdcb1c2d2839ca26f79f64a9c2389e60292 Mon Sep 17 00:00:00 2001 From: Ricky Guerin Date: Sat, 9 Nov 2019 13:30:36 -0500 Subject: [PATCH 10/17] Replaced TextMeshPro with basic Text --- .../Team2/scenes/PennyPinchersMainScene.unity | 241 ++++++------------ .../Assets/Team2/scripts/manager.cs | 14 +- 2 files changed, 87 insertions(+), 168 deletions(-) diff --git a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity index d0c43ab..c37c28e 100644 --- a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity +++ b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity @@ -216,7 +216,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} m_Children: - - {fileID: 459929872} + - {fileID: 1805040154} m_Father: {fileID: 0} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -557,163 +557,6 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &459929871 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 459929872} - - component: {fileID: 459929874} - - component: {fileID: 459929873} - m_Layer: 5 - m_Name: Text (TMP) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &459929872 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 459929871} - 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: 115035826} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 171, y: -73} - m_SizeDelta: {x: 200, y: 50} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &459929873 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 459929871} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_text: 'Timer:' - m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_fontSharedMaterials: [] - m_fontMaterial: {fileID: 0} - m_fontMaterials: [] - m_fontColor32: - serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} - m_enableVertexGradient: 0 - m_colorMode: 3 - m_fontColorGradient: - topLeft: {r: 1, g: 1, b: 1, a: 1} - topRight: {r: 1, g: 1, b: 1, a: 1} - bottomLeft: {r: 1, g: 1, b: 1, a: 1} - bottomRight: {r: 1, g: 1, b: 1, a: 1} - m_fontColorGradientPreset: {fileID: 0} - m_spriteAsset: {fileID: 0} - m_tintAllSprites: 0 - m_overrideHtmlColors: 0 - m_faceColor: - serializedVersion: 2 - rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 - m_fontSize: 36 - m_fontSizeBase: 36 - m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 18 - m_fontSizeMax: 72 - m_fontStyle: 0 - m_textAlignment: 257 - m_characterSpacing: 0 - m_wordSpacing: 0 - m_lineSpacing: 0 - m_lineSpacingMax: 0 - m_paragraphSpacing: 0 - m_charWidthMaxAdj: 0 - m_enableWordWrapping: 0 - m_wordWrappingRatios: 0.4 - m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 - m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 - m_enableKerning: 1 - m_enableExtraPadding: 0 - checkPaddingRequired: 0 - m_isRichText: 1 - m_parseCtrlCharacters: 1 - m_isOrthographic: 1 - m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 - m_horizontalMapping: 0 - m_verticalMapping: 0 - m_uvLineOffset: 0 - m_geometrySortingOrder: 0 - m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 - m_useMaxVisibleDescender: 1 - m_pageToDisplay: 1 - m_margin: {x: 0, y: 0, z: -157.81519, w: 0} - m_textInfo: - textComponent: {fileID: 459929873} - characterCount: 6 - spriteCount: 0 - spaceCount: 0 - wordCount: 1 - linkCount: 0 - lineCount: 1 - pageCount: 1 - materialCount: 1 - m_isUsingLegacyAnimationComponent: 0 - m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} - m_hasFontAssetChanged: 0 - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - m_baseMaterial: {fileID: 0} - m_maskOffset: {x: 0, y: 0, z: 0, w: 0} ---- !u!222 &459929874 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 459929871} - m_CullTransparentMesh: 0 --- !u!1001 &741822260 PrefabInstance: m_ObjectHideFlags: 0 @@ -894,8 +737,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: timer: 0 - timerText: {fileID: 0} - textObject: {fileID: 459929871} + timerText: {fileID: 1805040155} timeToChoose: 5 player1: {fileID: 2026101235} player2: {fileID: 1522733016} @@ -1144,6 +986,85 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1805040153 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1805040154} + - component: {fileID: 1805040156} + - component: {fileID: 1805040155} + m_Layer: 5 + m_Name: Timer Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1805040154 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1805040153} + 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: 115035826} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 104, y: -44} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1805040155 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1805040153} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 69 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 85 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: 'Timer:' +--- !u!222 &1805040156 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1805040153} + m_CullTransparentMesh: 0 --- !u!1 &2026101235 stripped GameObject: m_CorrespondingSourceObject: {fileID: 3450864664022239381, guid: 82734d121651e644081af68b67e6b645, diff --git a/GDDImagineGame/Assets/Team2/scripts/manager.cs b/GDDImagineGame/Assets/Team2/scripts/manager.cs index cf70160..a5245af 100644 --- a/GDDImagineGame/Assets/Team2/scripts/manager.cs +++ b/GDDImagineGame/Assets/Team2/scripts/manager.cs @@ -1,20 +1,20 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; -using TMPro; +using UnityEngine.UI; -public class manager : MonoBehaviour +public class Manager : MonoBehaviour { //private var for keeping track of the time public float timer = 0.0f; - //vars for updating the timer UI - //public TextMeshProUGUI timerText; - //public GameObject textObject; + // The Text object that displays the time remaining in the round + public Text timerText; //public var for how long a "round" should be (time when players can choose an action) public float timeToChoose; + //public vars for managing the 4 players public GameObject player1; public GameObject player2; @@ -43,8 +43,6 @@ void Start() roundNum = 1; gameOver = false; playersAnimating = false; - //timerText = textObject.GetComponent(); - //timerText.SetText("Timer: " + timeToChoose); } // Update is called once per frame @@ -173,7 +171,7 @@ void Update() else //default case, increment { timer += Time.deltaTime; - //timerText.SetText("Timer: " + Mathf.Round((timeToChoose - timer)*100)/100); + timerText.text = "Timer: " + Mathf.Round((timeToChoose - timer) * 100) / 100; } //} } From 9d95a3306a0da2d6ccc1404dd0119ef64964e021 Mon Sep 17 00:00:00 2001 From: Ricky Guerin Date: Sat, 9 Nov 2019 15:04:21 -0500 Subject: [PATCH 11/17] General clean up --- .../Assets/Team2/Material/Table.mat | 2 +- .../Team2/scenes/PennyPinchersMainScene.unity | 72 +++-- .../Assets/Team2/scripts/PlayerController.cs | 96 ++---- .../Assets/Team2/scripts/manager.cs | 277 ++++++++---------- 4 files changed, 200 insertions(+), 247 deletions(-) diff --git a/GDDImagineGame/Assets/Team2/Material/Table.mat b/GDDImagineGame/Assets/Team2/Material/Table.mat index 41c2fc8..01a3e2d 100644 --- a/GDDImagineGame/Assets/Team2/Material/Table.mat +++ b/GDDImagineGame/Assets/Team2/Material/Table.mat @@ -73,5 +73,5 @@ Material: - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 0.49056602, g: 0.40741608, b: 0.3216447, a: 1} + - _Color: {r: 1, g: 0.1704009, b: 0.0990566, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity index c37c28e..18f5210 100644 --- a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity +++ b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity @@ -120,12 +120,18 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!1 &64169714 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 3450864664022239381, guid: 82734d121651e644081af68b67e6b645, +--- !u!114 &64169715 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, type: 3} m_PrefabInstance: {fileID: 821587121} m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6443632a6d5aeba4c96a823bed9abb34, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &115035822 GameObject: m_ObjectHideFlags: 0 @@ -238,7 +244,7 @@ GameObject: - component: {fileID: 141720464} - component: {fileID: 141720463} m_Layer: 0 - m_Name: Table (Background) + m_Name: Table m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -312,7 +318,7 @@ Transform: m_GameObject: {fileID: 141720462} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 25, y: 1, z: 25} + m_LocalScale: {x: 30, y: 1, z: 30} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 3 @@ -352,8 +358,8 @@ Camera: m_GameObject: {fileID: 181728746} m_Enabled: 1 serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.2956123, g: 0.63491637, b: 0.8584906, a: 0} m_projectionMatrixMode: 1 m_GateFitMode: 2 m_FOVAxisMode: 0 @@ -393,13 +399,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 181728746} - m_LocalRotation: {x: 0.2588191, y: 0, z: 0, w: 0.9659258} - m_LocalPosition: {x: 0, y: 10, z: -13.64} + m_LocalRotation: {x: 0.5, y: 0, z: 0, w: 0.8660254} + m_LocalPosition: {x: 0, y: 15, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 30, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 60, y: 0, z: 0} --- !u!1 &428008810 GameObject: m_ObjectHideFlags: 0 @@ -736,13 +742,13 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 10e384338ca4fe843882191cb4960a3a, type: 3} m_Name: m_EditorClassIdentifier: - timer: 0 + players: + - {fileID: 2026101236} + - {fileID: 1522733017} + - {fileID: 1175170419} + - {fileID: 64169715} timerText: {fileID: 1805040155} timeToChoose: 5 - player1: {fileID: 2026101235} - player2: {fileID: 1522733016} - player3: {fileID: 1175170418} - player4: {fileID: 64169714} potValue: 10 potIncrease: 5 numRounds: 5 @@ -760,12 +766,18 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1175170418 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 3450864664022239381, guid: 82734d121651e644081af68b67e6b645, +--- !u!114 &1175170419 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, type: 3} m_PrefabInstance: {fileID: 741822260} m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6443632a6d5aeba4c96a823bed9abb34, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1001 &1446843446 PrefabInstance: m_ObjectHideFlags: 0 @@ -841,12 +853,18 @@ Transform: type: 3} m_PrefabInstance: {fileID: 1446843446} m_PrefabAsset: {fileID: 0} ---- !u!1 &1522733016 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 3450864664022239381, guid: 82734d121651e644081af68b67e6b645, +--- !u!114 &1522733017 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, type: 3} m_PrefabInstance: {fileID: 1446843446} m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6443632a6d5aeba4c96a823bed9abb34, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1001 &1603432931 PrefabInstance: m_ObjectHideFlags: 0 @@ -1065,12 +1083,18 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1805040153} m_CullTransparentMesh: 0 ---- !u!1 &2026101235 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 3450864664022239381, guid: 82734d121651e644081af68b67e6b645, +--- !u!114 &2026101236 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, type: 3} m_PrefabInstance: {fileID: 1603432931} m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6443632a6d5aeba4c96a823bed9abb34, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1001 &2088653255 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs b/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs index 809a872..e3ce0ac 100644 --- a/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs +++ b/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs @@ -1,26 +1,25 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; +using UnityEngine; -//enum for choices a player can make +// Enumeration of the actions a player can take in a round public enum Choice { - pot, - stealLeft, - stealAcross, - stealRight, - block, - none + Pot, + StealLeft, + StealAcross, + StealRight, + Block, + None } public class PlayerController : MonoBehaviour { - - //vars for players + // Player's current score public int score; - //public bool animating; - //public bool firstHalf; + + // Player's action for this round public Choice choice; + + // The keys this player must press to perform various actions public KeyCode potButton; public KeyCode stealButton; public KeyCode blockButton; @@ -28,46 +27,31 @@ public class PlayerController : MonoBehaviour public KeyCode stealAcross; public KeyCode stealRight; - // Start is called before the first frame update void Start() { //initialize some vars score = 0; - //animating = false; - //firstHalf = true; - choice = Choice.none; + choice = Choice.None; } - // Update is called once per frame void Update() { PlayerAction(); - //if (animating) - //{ - // if (firstHalf) - // { - - // } - // else - // { - - // } - //} } - /// - /// Check for user input and print a message on the console that corresponds with the key that the user pressed - /// - public void PlayerAction() + /// + /// Check for user input and print a message on the console that corresponds with the key that the user pressed + /// + public void PlayerAction() { //only let player make choice if none have been made yet - if (choice == Choice.none) + if (choice == Choice.None) { //player wants to go for pot if (Input.GetKeyDown(potButton)) { Debug.Log(name + " is going for main pot"); - choice = Choice.pot; + choice = Choice.Pot; } //player wants to go for a steal, handle who they're trying to steal from else if (Input.GetKey(stealButton)) @@ -75,57 +59,25 @@ public void PlayerAction() if (Input.GetKeyDown(stealLeft)) { Debug.Log(name + " is stealing from the player to the left of them"); - choice = Choice.stealLeft; + choice = Choice.StealLeft; } else if (Input.GetKeyDown(stealAcross)) { Debug.Log(name + " is stealing from the player across from them"); - choice = Choice.stealAcross; + choice = Choice.StealAcross; } else if (Input.GetKeyDown(stealRight)) { Debug.Log(name + " is stealing from the player to the right of them"); - choice = Choice.stealRight; + choice = Choice.StealRight; } } //player wants to block else if (Input.GetKeyDown(blockButton)) { Debug.Log(name + " is going for blocking"); - choice = Choice.block; + choice = Choice.Block; } } } - - ////helper function for a successful pot steal animation - //public void PlayerMoveToPotSuccessFul() - //{ - // animating = true; - //} - - ////helper function for a unsuccessful pot steal animation - //public void PlayerMoveToPotUnsuccessFul() - //{ - // animating = true; - //} - - ////helper function for a unsuccessful pot steal animation - //public void PlayerMoveToStealSuccessFul(float degreesToRotate) - //{ - // animating = true; - - //} - - ////helper function for a unsuccessful pot steal animation - //public void PlayerMoveToStealUnsuccessFul(float degreesToRotate) - //{ - // animating = true; - //} - - ////helper function for a block animation - //public void PlayerMoveToBlock() - //{ - // animating = true; - - //} } diff --git a/GDDImagineGame/Assets/Team2/scripts/manager.cs b/GDDImagineGame/Assets/Team2/scripts/manager.cs index a5245af..855b91b 100644 --- a/GDDImagineGame/Assets/Team2/scripts/manager.cs +++ b/GDDImagineGame/Assets/Team2/scripts/manager.cs @@ -1,178 +1,155 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; +using UnityEngine; using UnityEngine.UI; public class Manager : MonoBehaviour { - - //private var for keeping track of the time - public float timer = 0.0f; + // Provides access to all four players + public PlayerController[] players; // The Text object that displays the time remaining in the round public Text timerText; - //public var for how long a "round" should be (time when players can choose an action) + // Duration in seconds of one game round public float timeToChoose; - //public vars for managing the 4 players - public GameObject player1; - public GameObject player2; - public GameObject player3; - public GameObject player4; + // The current value of the pot + public int potValue; - //public var for the pot value - public int potValue; + // The amount by which the pot increases value after each round public int potIncrease; - //vars for rounds + // The total number of rounds in the game public int numRounds; - private int roundNum; - private bool gameOver; - //var for checking if players are animating after a round has been calculated - private bool playersAnimating; + // The current round number + private int roundNum; - private PlayerController[] players; + // If the game is over, prevent Update() from happening + private bool gameOver; - // Start is called before the first frame update + // Keeps track of elapsed game time + private float timer; + void Start() { - //initialize some vars - players = new PlayerController[] { player1.GetComponent(), player2.GetComponent(), player3.GetComponent(), player4.GetComponent() }; + timer = 0; roundNum = 1; gameOver = false; - playersAnimating = false; } - // Update is called once per frame void Update() { - ////make sure animations aren't happening at the moment - //if (!players[0].animating && !players[1].animating && !players[2].animating && !players[3].animating) - //{ - //check to see if time is up for picking an action - if (timer >= timeToChoose && !gameOver) - { - //reset timer - timer = 0.0f; - //Resolve player choices here - - //condense players choices for checks - Choice[] choices = { players[0].choice, players[1].choice, players[2].choice, players[3].choice }; - - //temp vars for checking who is going to pot - int potNum = 0; - int potPlayerNum = -1; - - //check players choices - for (int i = 0; i < choices.Length; i++) - { - //if pot, increase pot num and assign player - if (choices[i] == Choice.pot) - { - potNum++; - potPlayerNum = i; - } - //handle steals - else if (choices[i] == Choice.stealLeft || choices[i] == Choice.stealAcross || choices[i] == Choice.stealRight) - { - int target = -1; - float degreesToRotate = 0; - switch (choices[i]) - { - case Choice.stealLeft: - target = (i - 1) % 4; - degreesToRotate = -90; - break; - case Choice.stealAcross: - target = (i + 2) % 4; - degreesToRotate = 180; - break; - case Choice.stealRight: - target = (i + 1) % 4; - degreesToRotate = 90; - break; - default: - break; - } - //ignore if the chosen player is blocking, otherwise give half of score to player stealing - if (choices[target] != Choice.block) - { - int half = (int)Mathf.Ceil(players[target].score / 2); - //players[i].PlayerMoveToStealSuccessFul(degreesToRotate); - players[i].score += half; - players[target].score -= half; - } - else - { - //players[i].PlayerMoveToStealUnsuccessFul(degreesToRotate); - } - } - } - //if only 1 going for pot, give them pot value - if (potNum == 1) - { - //players[potPlayerNum].PlayerMoveToPotSuccessFul(); - //players[potPlayerNum].animating = true; - players[potPlayerNum].score += potValue; - } - else if (potNum > 1) - { - foreach (PlayerController pc in players) - { - if (pc.choice == Choice.pot) - { - //pc.PlayerMoveToPotUnsuccessFul(); - } - } - } - - foreach (PlayerController pc in players) - { - if (pc.choice == Choice.block) - { - //pc.PlayerMoveToBlock(); - } - } - - //After resolving choices and updating scores, check to see if the game would end here - //reset players choices and give them some pity money - foreach (PlayerController pc in players) - { - pc.choice = Choice.none; - pc.score += 1; - Debug.Log(pc.name + "'s score is: " + pc.score); - } - //increase pots value - potValue += potIncrease; - - //increase round number - roundNum++; - - //ends the game if max rounds reached - if (roundNum >= numRounds) - { - int highScorePlayer = -1; - int highScore = 0; - for (int i = 0; i < players.Length; i++) - { - if (players[i].score > highScore) - { - highScore = players[i].score; - highScorePlayer = i; - } - } - - Debug.Log("The winner is player " + (highScorePlayer + 1) + " with a score of " + highScore); - gameOver = true; - } - } - else //default case, increment - { - timer += Time.deltaTime; + // Prevent Update() when the game has ended + if (gameOver) return; + + // Increase timer + if (timer < timeToChoose) + { + timer += Time.deltaTime; timerText.text = "Timer: " + Mathf.Round((timeToChoose - timer) * 100) / 100; - } - //} + } + + // Once timer has reached timeToChoose, handle choices + else + { + // Collect Player choices + Choice[] choices = { players[0].choice, players[1].choice, players[2].choice, players[3].choice }; + + // Number of players who went for the pot + int potNum = 0; + + // ID of player who went for the pot + int potPlayerNum = -1; + + // Handle each choice + for (int i = 0; i < choices.Length; i++) + { + // Player went for the pot + if (choices[i] == Choice.Pot) + { + potNum++; + potPlayerNum = i; + } + + // Player chose to steal + else if (choices[i] == Choice.StealLeft || choices[i] == Choice.StealAcross || choices[i] == Choice.StealRight) + { + int target = -1; + + switch (choices[i]) + { + case Choice.StealLeft: + target = (i - 1) % 4; + break; + case Choice.StealAcross: + target = (i + 2) % 4; + break; + case Choice.StealRight: + target = (i + 1) % 4; + break; + } + + //ignore if the chosen player is blocking, otherwise give half of score to player stealing + if (choices[target] != Choice.Block) + { + int half = (int)Mathf.Ceil(players[target].score / 2); + players[i].score += half; + players[target].score -= half; + } + } + } + + // Only one player went for the pot, give them pot value + if (potNum == 1) + { + players[potPlayerNum].score += potValue; + } + + //After resolving choices and updating scores, check to see if the game would end here + //reset players choices and give them some pity money + foreach (PlayerController pc in players) + { + pc.choice = Choice.None; + pc.score += 1; + Debug.Log(pc.name + "'s score is: " + pc.score); + } + + // Increase round number + roundNum++; + + // End game if round number is greater than number of rounds + if (roundNum > numRounds) + { + GameOver(); + return; + } + + // Increase pot value + potValue += potIncrease; + + // Reset timer + timer = 0.0f; + } } + + /// + /// When the game has ended, show results + /// + private void GameOver() + { + int highScorePlayer = -1; + int highScore = 0; + for (int i = 0; i < players.Length; i++) + { + if (players[i].score > highScore) + { + highScore = players[i].score; + highScorePlayer = i; + } + } + + timerText.text = "Game Over!"; + Debug.Log("The winner is player " + (highScorePlayer + 1) + " with a score of " + highScore); + gameOver = true; + } } From a3ef55d4b79b5b9ed7a84482868806649bb0acbe Mon Sep 17 00:00:00 2001 From: dantayy Date: Sat, 9 Nov 2019 17:21:40 -0500 Subject: [PATCH 12/17] Implemented scaling coin "piles" for all of the players as well as the main pot to indicate generally who's winning visually --- .../Assets/Team2/Prefabs/Player.prefab | 8 + .../Team2/scenes/PennyPinchersMainScene.unity | 494 ++++++++++++++++-- .../Assets/Team2/scripts/PlayerController.cs | 14 +- .../Assets/Team2/scripts/manager.cs | 53 +- 4 files changed, 511 insertions(+), 58 deletions(-) diff --git a/GDDImagineGame/Assets/Team2/Prefabs/Player.prefab b/GDDImagineGame/Assets/Team2/Prefabs/Player.prefab index 90d0d64..3fe4cf6 100644 --- a/GDDImagineGame/Assets/Team2/Prefabs/Player.prefab +++ b/GDDImagineGame/Assets/Team2/Prefabs/Player.prefab @@ -105,3 +105,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 6443632a6d5aeba4c96a823bed9abb34, type: 3} m_Name: m_EditorClassIdentifier: + score: 0 + choice: 5 + potButton: 0 + stealButton: 0 + blockButton: 0 + stealLeft: 0 + stealAcross: 0 + stealRight: 0 diff --git a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity index 18f5210..d258ca5 100644 --- a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity +++ b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity @@ -224,7 +224,7 @@ RectTransform: m_Children: - {fileID: 1805040154} m_Father: {fileID: 0} - m_RootOrder: 6 + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -406,6 +406,136 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 60, y: 0, z: 0} +--- !u!1 &312272805 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 312272806} + m_Layer: 0 + m_Name: PlayerPiles + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &312272806 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 312272805} + 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: + - {fileID: 1659346374} + - {fileID: 685567538} + - {fileID: 340912541} + - {fileID: 651593479} + m_Father: {fileID: 0} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &340912540 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 312272806} + m_Modifications: + - target: {fileID: 1813527851782636589, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_Name + value: Player Three Pile + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalPosition.x + value: 7 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalPosition.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalScale.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalScale.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalScale.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: ec1f48a9c17540640a22691bf211467c, type: 3} +--- !u!4 &340912541 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + m_PrefabInstance: {fileID: 340912540} + m_PrefabAsset: {fileID: 0} +--- !u!1 &340912542 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1813527851782636589, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + m_PrefabInstance: {fileID: 340912540} + m_PrefabAsset: {fileID: 0} --- !u!1 &428008810 GameObject: m_ObjectHideFlags: 0 @@ -563,6 +693,198 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &651593478 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 312272806} + m_Modifications: + - target: {fileID: 1813527851782636589, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_Name + value: Player Four Pile + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalPosition.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalPosition.z + value: -7 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalScale.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalScale.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalScale.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: ec1f48a9c17540640a22691bf211467c, type: 3} +--- !u!4 &651593479 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + m_PrefabInstance: {fileID: 651593478} + m_PrefabAsset: {fileID: 0} +--- !u!1 &651593480 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1813527851782636589, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + m_PrefabInstance: {fileID: 651593478} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &685567537 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 312272806} + m_Modifications: + - target: {fileID: 1813527851782636589, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_Name + value: Player Two Pile + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalPosition.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalPosition.z + value: 7 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalScale.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalScale.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalScale.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: ec1f48a9c17540640a22691bf211467c, type: 3} +--- !u!4 &685567538 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + m_PrefabInstance: {fileID: 685567537} + m_PrefabAsset: {fileID: 0} +--- !u!1 &685567539 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1813527851782636589, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + m_PrefabInstance: {fileID: 685567537} + m_PrefabAsset: {fileID: 0} --- !u!1001 &741822260 PrefabInstance: m_ObjectHideFlags: 0 @@ -747,6 +1069,12 @@ MonoBehaviour: - {fileID: 1522733017} - {fileID: 1175170419} - {fileID: 64169715} + coinPiles: + - {fileID: 1659346375} + - {fileID: 685567539} + - {fileID: 340912542} + - {fileID: 651593480} + pot: {fileID: 2042638233} timerText: {fileID: 1805040155} timeToChoose: 5 potValue: 10 @@ -877,6 +1205,36 @@ PrefabInstance: propertyPath: m_Name value: Player One objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: potButton + value: 113 + objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: stealButton + value: 119 + objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: blockButton + value: 101 + objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: stealLeft + value: 276 + objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: stealAcross + value: 273 + objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: stealRight + value: 275 + objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalPosition.x @@ -932,36 +1290,6 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, - type: 3} - propertyPath: potButton - value: 113 - objectReference: {fileID: 0} - - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, - type: 3} - propertyPath: stealButton - value: 119 - objectReference: {fileID: 0} - - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, - type: 3} - propertyPath: blockButton - value: 101 - objectReference: {fileID: 0} - - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, - type: 3} - propertyPath: stealLeft - value: 276 - objectReference: {fileID: 0} - - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, - type: 3} - propertyPath: stealAcross - value: 273 - objectReference: {fileID: 0} - - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, - type: 3} - propertyPath: stealRight - value: 275 - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 82734d121651e644081af68b67e6b645, type: 3} --- !u!4 &1603432932 stripped @@ -1004,6 +1332,102 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1659346373 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 312272806} + m_Modifications: + - target: {fileID: 1813527851782636589, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_Name + value: Player One Pile + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalPosition.x + value: -7 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalPosition.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalScale.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalScale.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + propertyPath: m_LocalScale.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: ec1f48a9c17540640a22691bf211467c, type: 3} +--- !u!4 &1659346374 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + m_PrefabInstance: {fileID: 1659346373} + m_PrefabAsset: {fileID: 0} +--- !u!1 &1659346375 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1813527851782636589, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + m_PrefabInstance: {fileID: 1659346373} + m_PrefabAsset: {fileID: 0} --- !u!1 &1805040153 GameObject: m_ObjectHideFlags: 0 @@ -1095,6 +1519,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 6443632a6d5aeba4c96a823bed9abb34, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1 &2042638233 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 1813527851782636589, guid: ec1f48a9c17540640a22691bf211467c, + type: 3} + m_PrefabInstance: {fileID: 2088653255} + m_PrefabAsset: {fileID: 0} --- !u!1001 &2088653255 PrefabInstance: m_ObjectHideFlags: 0 @@ -1105,7 +1535,7 @@ PrefabInstance: - target: {fileID: 1813527851782636589, guid: ec1f48a9c17540640a22691bf211467c, type: 3} propertyPath: m_Name - value: Coin + value: Dragon's Horde objectReference: {fileID: 0} - target: {fileID: 338036885544786708, guid: ec1f48a9c17540640a22691bf211467c, type: 3} diff --git a/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs b/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs index e3ce0ac..59fbe8f 100644 --- a/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs +++ b/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs @@ -16,7 +16,7 @@ public class PlayerController : MonoBehaviour // Player's current score public int score; - // Player's action for this round + // Player's action for any given round public Choice choice; // The keys this player must press to perform various actions @@ -29,7 +29,7 @@ public class PlayerController : MonoBehaviour void Start() { - //initialize some vars + // Initialize player vars score = 0; choice = Choice.None; } @@ -44,16 +44,16 @@ void Update() /// public void PlayerAction() { - //only let player make choice if none have been made yet + // Only let player make choice if none has been made yet if (choice == Choice.None) { - //player wants to go for pot + // Player wants to go for pot if (Input.GetKeyDown(potButton)) { Debug.Log(name + " is going for main pot"); choice = Choice.Pot; } - //player wants to go for a steal, handle who they're trying to steal from + // Player wants to go for a steal, handle who they're trying to steal from else if (Input.GetKey(stealButton)) { if (Input.GetKeyDown(stealLeft)) @@ -72,10 +72,10 @@ public void PlayerAction() choice = Choice.StealRight; } } - //player wants to block + // Player wants to block else if (Input.GetKeyDown(blockButton)) { - Debug.Log(name + " is going for blocking"); + Debug.Log(name + " is blocking"); choice = Choice.Block; } } diff --git a/GDDImagineGame/Assets/Team2/scripts/manager.cs b/GDDImagineGame/Assets/Team2/scripts/manager.cs index 855b91b..b415c82 100644 --- a/GDDImagineGame/Assets/Team2/scripts/manager.cs +++ b/GDDImagineGame/Assets/Team2/scripts/manager.cs @@ -6,6 +6,12 @@ public class Manager : MonoBehaviour // Provides access to all four players public PlayerController[] players; + // Provides access to the coin piles of the four players + public GameObject[] coinPiles; + + // Provides access to the main "pot" (dragon horde, w/e) + public GameObject pot; + // The Text object that displays the time remaining in the round public Text timerText; @@ -29,7 +35,10 @@ public class Manager : MonoBehaviour // Keeps track of elapsed game time private float timer; - + + // Amount to scale a pile by + private float pileScale; + void Start() { timer = 0; @@ -79,39 +88,43 @@ void Update() switch (choices[i]) { case Choice.StealLeft: - target = (i - 1) % 4; + target = ((i - 1) % 4 + 4) % 4; break; case Choice.StealAcross: - target = (i + 2) % 4; + target = ((i + 2) % 4 + 4) % 4; break; case Choice.StealRight: - target = (i + 1) % 4; + target = ((i + 1) % 4 + 4) % 4; break; } - - //ignore if the chosen player is blocking, otherwise give half of score to player stealing + // Ignore if the chosen player is blocking, otherwise give half of score to player stealing if (choices[target] != Choice.Block) { int half = (int)Mathf.Ceil(players[target].score / 2); players[i].score += half; - players[target].score -= half; - } - } + players[target].score -= half; + pileScale = (float)(half * 0.1); + coinPiles[i].transform.localScale += new Vector3(pileScale, pileScale, pileScale); + coinPiles[target].transform.localScale -= new Vector3(pileScale, pileScale, pileScale); + } + } } // Only one player went for the pot, give them pot value if (potNum == 1) { players[potPlayerNum].score += potValue; - } + pileScale = (float)(potValue * 0.1); + coinPiles[potPlayerNum].transform.localScale += new Vector3(pileScale, pileScale, pileScale); + } - //After resolving choices and updating scores, check to see if the game would end here - //reset players choices and give them some pity money - foreach (PlayerController pc in players) + // Reset players choices and give them some pity money + for (int i = 0; i < players.Length; i++) { - pc.choice = Choice.None; - pc.score += 1; - Debug.Log(pc.name + "'s score is: " + pc.score); + players[i].choice = Choice.None; + players[i].score += 1; + coinPiles[i].transform.localScale += new Vector3(0.1f, 0.1f, 0.1f); + Debug.Log(players[i].name + "'s score is: " + players[i].score); } // Increase round number @@ -124,11 +137,13 @@ void Update() return; } - // Increase pot value + // Increase pot value and size potValue += potIncrease; + pileScale = (float)(potIncrease * 0.1); + pot.transform.localScale += new Vector3(pileScale, pileScale, pileScale); - // Reset timer - timer = 0.0f; + // Reset timer + timer = 0.0f; } } From de1f5d8743b28fc7b5dc8aab086f4c6639408efd Mon Sep 17 00:00:00 2001 From: Nicholas V Mercadante Date: Sat, 9 Nov 2019 17:23:52 -0500 Subject: [PATCH 13/17] Rename manager.cs to Manager.cs --- GDDImagineGame/Assets/Team2/scripts/{manager.cs => Manager.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename GDDImagineGame/Assets/Team2/scripts/{manager.cs => Manager.cs} (100%) diff --git a/GDDImagineGame/Assets/Team2/scripts/manager.cs b/GDDImagineGame/Assets/Team2/scripts/Manager.cs similarity index 100% rename from GDDImagineGame/Assets/Team2/scripts/manager.cs rename to GDDImagineGame/Assets/Team2/scripts/Manager.cs From 586443d8a82007f0d299acadad4d350f7b31d83d Mon Sep 17 00:00:00 2001 From: Nicholas V Mercadante Date: Sat, 9 Nov 2019 17:24:13 -0500 Subject: [PATCH 14/17] Rename manager.cs.meta to Manager.cs.meta --- .../Assets/Team2/scripts/{manager.cs.meta => Manager.cs.meta} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename GDDImagineGame/Assets/Team2/scripts/{manager.cs.meta => Manager.cs.meta} (100%) diff --git a/GDDImagineGame/Assets/Team2/scripts/manager.cs.meta b/GDDImagineGame/Assets/Team2/scripts/Manager.cs.meta similarity index 100% rename from GDDImagineGame/Assets/Team2/scripts/manager.cs.meta rename to GDDImagineGame/Assets/Team2/scripts/Manager.cs.meta From 5b96d9c0937a217e680d506e8aa3de4ae0dd68eb Mon Sep 17 00:00:00 2001 From: Cavan Vince Date: Tue, 20 Oct 2020 19:14:53 -0400 Subject: [PATCH 15/17] Implemented Rough UI to Team 2 Game Went through old game logic and cleaned certain parts. Removed the ability to steal from the person across from you. Also implemented a rough UI system for scores. --- .../Team2/scenes/PennyPinchersMainScene.unity | 350 +++++++++++++++++- .../Assets/Team2/scripts/Manager.cs | 247 ++++++------ .../Assets/Team2/scripts/PlayerController.cs | 82 ++-- 3 files changed, 525 insertions(+), 154 deletions(-) diff --git a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity index d258ca5..7389041 100644 --- a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity +++ b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity @@ -120,6 +120,164 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &2579327 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2579328} + - component: {fileID: 2579330} + - component: {fileID: 2579329} + m_Layer: 5 + m_Name: Player Two Score + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2579328 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2579327} + 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: 115035826} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -260, y: -44} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2579329 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2579327} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 69 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 6 + m_MaxSize: 69 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: 'Player 2: 0' +--- !u!222 &2579330 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2579327} + m_CullTransparentMesh: 0 +--- !u!1 &44980531 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 44980532} + - component: {fileID: 44980534} + - component: {fileID: 44980533} + m_Layer: 5 + m_Name: Player Four Score + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &44980532 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 44980531} + 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: 115035826} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: -260, y: 44} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &44980533 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 44980531} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 69 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 6 + m_MaxSize: 69 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: 'Player 4: 0' +--- !u!222 &44980534 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 44980531} + m_CullTransparentMesh: 0 --- !u!114 &64169715 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, @@ -223,6 +381,10 @@ RectTransform: m_LocalScale: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1805040154} + - {fileID: 1696919944} + - {fileID: 2579328} + - {fileID: 1968274022} + - {fileID: 44980532} m_Father: {fileID: 0} m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -1076,7 +1238,12 @@ MonoBehaviour: - {fileID: 651593480} pot: {fileID: 2042638233} timerText: {fileID: 1805040155} - timeToChoose: 5 + playerScores: + - {fileID: 1696919945} + - {fileID: 2579329} + - {fileID: 1968274023} + - {fileID: 44980533} + timeToChoose: 15 potValue: 10 potIncrease: 5 numRounds: 5 @@ -1208,7 +1375,7 @@ PrefabInstance: - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: potButton - value: 113 + value: 119 objectReference: {fileID: 0} - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, type: 3} @@ -1218,12 +1385,12 @@ PrefabInstance: - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: blockButton - value: 101 + value: 115 objectReference: {fileID: 0} - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: stealLeft - value: 276 + value: 97 objectReference: {fileID: 0} - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, type: 3} @@ -1233,7 +1400,12 @@ PrefabInstance: - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: stealRight - value: 275 + value: 100 + objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: score + value: 0 objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} @@ -1428,6 +1600,85 @@ GameObject: type: 3} m_PrefabInstance: {fileID: 1659346373} m_PrefabAsset: {fileID: 0} +--- !u!1 &1696919943 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1696919944} + - component: {fileID: 1696919946} + - component: {fileID: 1696919945} + m_Layer: 5 + m_Name: Player One Score + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1696919944 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1696919943} + 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: 115035826} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 260, y: -44} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1696919945 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1696919943} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 69 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 6 + m_MaxSize: 69 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: 'Player 1: 0' +--- !u!222 &1696919946 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1696919943} + m_CullTransparentMesh: 0 --- !u!1 &1805040153 GameObject: m_ObjectHideFlags: 0 @@ -1460,9 +1711,9 @@ RectTransform: m_Father: {fileID: 115035826} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 104, y: -44} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: -44} m_SizeDelta: {x: 160, y: 30} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1805040155 @@ -1491,8 +1742,8 @@ MonoBehaviour: m_FontStyle: 0 m_BestFit: 0 m_MinSize: 10 - m_MaxSize: 85 - m_Alignment: 0 + m_MaxSize: 100 + m_Alignment: 4 m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 1 @@ -1507,6 +1758,85 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1805040153} m_CullTransparentMesh: 0 +--- !u!1 &1968274021 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1968274022} + - component: {fileID: 1968274024} + - component: {fileID: 1968274023} + m_Layer: 5 + m_Name: Player Three Score + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1968274022 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1968274021} + 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: 115035826} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 260, y: 44} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1968274023 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1968274021} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 69 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 6 + m_MaxSize: 69 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: 'Player 3: 0' +--- !u!222 &1968274024 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1968274021} + m_CullTransparentMesh: 0 --- !u!114 &2026101236 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, diff --git a/GDDImagineGame/Assets/Team2/scripts/Manager.cs b/GDDImagineGame/Assets/Team2/scripts/Manager.cs index b415c82..cacd5a7 100644 --- a/GDDImagineGame/Assets/Team2/scripts/Manager.cs +++ b/GDDImagineGame/Assets/Team2/scripts/Manager.cs @@ -1,10 +1,11 @@ using UnityEngine; using UnityEngine.UI; +using System.Collections.Generic; public class Manager : MonoBehaviour { - // Provides access to all four players - public PlayerController[] players; + // Provides access to all four players + public PlayerController[] players; // Provides access to the coin piles of the four players public GameObject[] coinPiles; @@ -12,159 +13,183 @@ public class Manager : MonoBehaviour // Provides access to the main "pot" (dragon horde, w/e) public GameObject pot; - // The Text object that displays the time remaining in the round - public Text timerText; + // The Text object that displays the time remaining in the round + public Text timerText; + + //Create a list to hold all of the player score text objects + public List playerScores; // Duration in seconds of one game round public float timeToChoose; - // The current value of the pot - public int potValue; + // The current value of the pot + [SerializeField] private int potValue; - // The amount by which the pot increases value after each round - public int potIncrease; + // The amount by which the pot increases value after each round + [SerializeField] private int potIncrease; // The total number of rounds in the game public int numRounds; - // The current round number - private int roundNum; + // The current round number + private int currentRound; - // If the game is over, prevent Update() from happening + // If the game is over, prevent Update() from happening private bool gameOver; - // Keeps track of elapsed game time - private float timer; + // Keeps track of elapsed game time + private float timer; // Amount to scale a pile by private float pileScale; void Start() { - timer = 0; - roundNum = 1; + timer = 0; + currentRound = 1; gameOver = false; } void Update() { - // Prevent Update() when the game has ended - if (gameOver) return; - - // Increase timer - if (timer < timeToChoose) - { - timer += Time.deltaTime; - timerText.text = "Timer: " + Mathf.Round((timeToChoose - timer) * 100) / 100; - } - - // Once timer has reached timeToChoose, handle choices - else - { - // Collect Player choices - Choice[] choices = { players[0].choice, players[1].choice, players[2].choice, players[3].choice }; - - // Number of players who went for the pot - int potNum = 0; - - // ID of player who went for the pot - int potPlayerNum = -1; - - // Handle each choice - for (int i = 0; i < choices.Length; i++) - { - // Player went for the pot - if (choices[i] == Choice.Pot) - { - potNum++; - potPlayerNum = i; - } - - // Player chose to steal - else if (choices[i] == Choice.StealLeft || choices[i] == Choice.StealAcross || choices[i] == Choice.StealRight) - { - int target = -1; - - switch (choices[i]) - { - case Choice.StealLeft: - target = ((i - 1) % 4 + 4) % 4; - break; - case Choice.StealAcross: - target = ((i + 2) % 4 + 4) % 4; - break; - case Choice.StealRight: - target = ((i + 1) % 4 + 4) % 4; - break; - } - // Ignore if the chosen player is blocking, otherwise give half of score to player stealing - if (choices[target] != Choice.Block) - { - int half = (int)Mathf.Ceil(players[target].score / 2); - players[i].score += half; - players[target].score -= half; + // Prevent Update() when the game has ended + if (gameOver) return; + + // Increase timer + if (timer < timeToChoose) + { + timer += Time.deltaTime; + timerText.text = "Timer: " + (int)Mathf.Round((timeToChoose - timer) * 100) / 100; + } + + // Once timer has reached timeToChoose, handle choices + else + { + // Collect Player choices + Choice[] choices = { players[0].Choice, players[1].Choice, players[2].Choice, players[3].Choice }; + + // Number of players who went for the pot + int potNum = 0; + + // ID of player who went for the pot + int potPlayerNum = -1; + + // Handle each choice + for (int i = 0; i < choices.Length; i++) + { + // Player went for the pot + if (choices[i] == Choice.Pot) + { + potNum++; + potPlayerNum = i; + } + + // Player chose to steal + else if (choices[i] == Choice.StealLeft || choices[i] == Choice.StealRight) + { + //Index of object being targeted + int target = -1; + + switch (choices[i]) + { + case Choice.StealLeft: + if (i != 3) + { + target = i + 1; + } + else + { + target = 0; + } + break; + case Choice.StealRight: + if (i != 0) + { + target = i - 1; + } + else + { + target = choices.Length - 1; + } + break; + } + // Ignore if the chosen player is blocking, otherwise give half of score to player stealing + if (choices[target] != Choice.Block) + { + int half = (int)Mathf.Ceil(players[target].Score / 2); + players[i].Score += half; + players[target].Score -= half; pileScale = (float)(half * 0.1); coinPiles[i].transform.localScale += new Vector3(pileScale, pileScale, pileScale); coinPiles[target].transform.localScale -= new Vector3(pileScale, pileScale, pileScale); } } - } + } - // Only one player went for the pot, give them pot value - if (potNum == 1) - { - players[potPlayerNum].score += potValue; + // Only one player went for the pot, give them pot value + if (potNum == 1) + { + players[potPlayerNum].Score += potValue; pileScale = (float)(potValue * 0.1); coinPiles[potPlayerNum].transform.localScale += new Vector3(pileScale, pileScale, pileScale); } // Reset players choices and give them some pity money for (int i = 0; i < players.Length; i++) - { - players[i].choice = Choice.None; - players[i].score += 1; + { + players[i].Choice = Choice.None; + players[i].Score += 1; coinPiles[i].transform.localScale += new Vector3(0.1f, 0.1f, 0.1f); - Debug.Log(players[i].name + "'s score is: " + players[i].score); - } + } - // Increase round number - roundNum++; + // Increase round number + currentRound++; - // End game if round number is greater than number of rounds - if (roundNum > numRounds) - { - GameOver(); - return; - } + // End game if round number is greater than number of rounds + if (currentRound > numRounds) + { + GameOver(); + return; + } - // Increase pot value and size - potValue += potIncrease; + // Increase pot value and size + potValue += potIncrease; pileScale = (float)(potIncrease * 0.1); pot.transform.localScale += new Vector3(pileScale, pileScale, pileScale); + UpdateScores(); + // Reset timer timer = 0.0f; - } + } } - /// - /// When the game has ended, show results - /// - private void GameOver() - { - int highScorePlayer = -1; - int highScore = 0; - for (int i = 0; i < players.Length; i++) - { - if (players[i].score > highScore) - { - highScore = players[i].score; - highScorePlayer = i; - } - } - - timerText.text = "Game Over!"; - Debug.Log("The winner is player " + (highScorePlayer + 1) + " with a score of " + highScore); - gameOver = true; - } + /// + /// When the game has ended, show results + /// + private void GameOver() + { + int highScorePlayer = -1; + int highScore = 0; + for (int i = 0; i < players.Length; i++) + { + if (players[i].Score > highScore) + { + highScore = players[i].Score; + highScorePlayer = i; + } + } + + timerText.text = "Game Over!"; + Debug.Log("The winner is player " + (highScorePlayer + 1) + " with a score of " + highScore); + gameOver = true; + } + + private void UpdateScores() + { + for (int i = 0; i < players.Length; i++) + { + playerScores[i].text = "Player " + (i + 1) + ": " + players[i].Score; + } + } } diff --git a/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs b/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs index 59fbe8f..7ac4944 100644 --- a/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs +++ b/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs @@ -5,7 +5,6 @@ public enum Choice { Pot, StealLeft, - StealAcross, StealRight, Block, None @@ -13,25 +12,49 @@ public enum Choice public class PlayerController : MonoBehaviour { - // Player's current score - public int score; + // Player's current score + [SerializeField] private int score; - // Player's action for any given round - public Choice choice; + // Player's action for any given round + [SerializeField] private Choice choice; - // The keys this player must press to perform various actions + // The keys this player must press to perform various actions public KeyCode potButton; - public KeyCode stealButton; public KeyCode blockButton; public KeyCode stealLeft; - public KeyCode stealAcross; public KeyCode stealRight; + + //Player Properties + public int Score + { + get + { + return score; + } + set + { + score = value; + } + } + public Choice Choice + { + get + { + return choice; + } + set + { + choice = value; + } + } + + void Start() { // Initialize player vars - score = 0; - choice = Choice.None; + Score = 0; + Choice = Choice.None; } void Update() @@ -39,44 +62,37 @@ void Update() PlayerAction(); } - /// - /// Check for user input and print a message on the console that corresponds with the key that the user pressed - /// - public void PlayerAction() + /// + /// Check for user input and print a message on the console that corresponds with the key that the user pressed + /// + public void PlayerAction() { // Only let player make choice if none has been made yet - if (choice == Choice.None) + if (Choice == Choice.None) { // Player wants to go for pot if (Input.GetKeyDown(potButton)) { Debug.Log(name + " is going for main pot"); - choice = Choice.Pot; + Choice = Choice.Pot; } // Player wants to go for a steal, handle who they're trying to steal from - else if (Input.GetKey(stealButton)) + else if (Input.GetKeyDown(stealLeft)) + { + Debug.Log(name + " is stealing from the player to the left of them"); + Choice = Choice.StealLeft; + } + else if (Input.GetKeyDown(stealRight)) { - if (Input.GetKeyDown(stealLeft)) - { - Debug.Log(name + " is stealing from the player to the left of them"); - choice = Choice.StealLeft; - } - else if (Input.GetKeyDown(stealAcross)) - { - Debug.Log(name + " is stealing from the player across from them"); - choice = Choice.StealAcross; - } - else if (Input.GetKeyDown(stealRight)) - { - Debug.Log(name + " is stealing from the player to the right of them"); - choice = Choice.StealRight; - } + Debug.Log(name + " is stealing from the player to the right of them"); + Choice = Choice.StealRight; } + // Player wants to block else if (Input.GetKeyDown(blockButton)) { Debug.Log(name + " is blocking"); - choice = Choice.Block; + Choice = Choice.Block; } } } From 41117e6d9d3a8ec7b595b1f311043b775b035273 Mon Sep 17 00:00:00 2001 From: Cavan Vince Date: Thu, 22 Oct 2020 17:37:57 -0400 Subject: [PATCH 16/17] Gave players a starting score of 10 points. Adjusted player starting score as well as fixed some score calculation logic when stealing. --- .../Team2/scenes/PennyPinchersMainScene.unity | 28 ++++++++++++++++--- .../Assets/Team2/scripts/PlayerController.cs | 2 +- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity index 7389041..2a2a7d0 100644 --- a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity +++ b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity @@ -190,7 +190,7 @@ MonoBehaviour: m_HorizontalOverflow: 1 m_VerticalOverflow: 1 m_LineSpacing: 1 - m_Text: 'Player 2: 0' + m_Text: 'Player 2: 10' --- !u!222 &2579330 CanvasRenderer: m_ObjectHideFlags: 0 @@ -269,7 +269,7 @@ MonoBehaviour: m_HorizontalOverflow: 1 m_VerticalOverflow: 1 m_LineSpacing: 1 - m_Text: 'Player 4: 0' + m_Text: 'Player 4: 10' --- !u!222 &44980534 CanvasRenderer: m_ObjectHideFlags: 0 @@ -1285,6 +1285,26 @@ PrefabInstance: propertyPath: m_Name value: Player Two objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: potButton + value: 273 + objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: blockButton + value: 274 + objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: stealLeft + value: 276 + objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: stealRight + value: 275 + objectReference: {fileID: 0} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalPosition.x @@ -1670,7 +1690,7 @@ MonoBehaviour: m_HorizontalOverflow: 1 m_VerticalOverflow: 1 m_LineSpacing: 1 - m_Text: 'Player 1: 0' + m_Text: 'Player 1: 10' --- !u!222 &1696919946 CanvasRenderer: m_ObjectHideFlags: 0 @@ -1828,7 +1848,7 @@ MonoBehaviour: m_HorizontalOverflow: 1 m_VerticalOverflow: 1 m_LineSpacing: 1 - m_Text: 'Player 3: 0' + m_Text: 'Player 3: 10' --- !u!222 &1968274024 CanvasRenderer: m_ObjectHideFlags: 0 diff --git a/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs b/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs index 7ac4944..4b4138d 100644 --- a/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs +++ b/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs @@ -53,7 +53,7 @@ public Choice Choice void Start() { // Initialize player vars - Score = 0; + Score = 10; Choice = Choice.None; } From 4ad8a45b0b9a6124f71b09337df3a77adcac1086 Mon Sep 17 00:00:00 2001 From: Cavan Vince Date: Thu, 29 Oct 2020 20:02:56 -0400 Subject: [PATCH 17/17] Implemented different game states. Implemented a round number UI and also ready text for a better UX. Still need art for animations and cleaner UI. --- .../Assets/Team2/Prefabs/Player.prefab | 307 +++++++++++++++++- .../Team2/scenes/PennyPinchersMainScene.unity | 160 ++++++++- .../Assets/Team2/scripts/ClampName.cs | 23 ++ .../Assets/Team2/scripts/ClampName.cs.meta | 11 + .../Assets/Team2/scripts/Manager.cs | 261 +++++++++------ .../Assets/Team2/scripts/PlayerController.cs | 19 +- 6 files changed, 681 insertions(+), 100 deletions(-) create mode 100644 GDDImagineGame/Assets/Team2/scripts/ClampName.cs create mode 100644 GDDImagineGame/Assets/Team2/scripts/ClampName.cs.meta diff --git a/GDDImagineGame/Assets/Team2/Prefabs/Player.prefab b/GDDImagineGame/Assets/Team2/Prefabs/Player.prefab index 3fe4cf6..0153c42 100644 --- a/GDDImagineGame/Assets/Team2/Prefabs/Player.prefab +++ b/GDDImagineGame/Assets/Team2/Prefabs/Player.prefab @@ -1,5 +1,305 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!1 &338117314161583170 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6237256901541433624} + - component: {fileID: 601367284808608166} + - component: {fileID: 5849632226987243880} + - component: {fileID: 5130011329531962502} + - component: {fileID: 7516773085881159045} + m_Layer: 0 + m_Name: Selection Text Marker + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6237256901541433624 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 338117314161583170} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.4, z: 1.79} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3433337596703189776} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &601367284808608166 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 338117314161583170} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &5849632226987243880 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 338117314161583170} + m_Enabled: 0 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, 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_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!135 &5130011329531962502 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 338117314161583170} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 0 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &7516773085881159045 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 338117314161583170} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6b7eac65f40598249b68f0cf1a42ab35, type: 3} + m_Name: + m_EditorClassIdentifier: + nameLabel: {fileID: 2627823059853369016} +--- !u!1 &1216182799353795527 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7854029270145741362} + - component: {fileID: 3136032475074850871} + - component: {fileID: 2627823059853369016} + - component: {fileID: 296580215536343968} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7854029270145741362 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1216182799353795527} + 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: 4638804553886083032} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -35} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3136032475074850871 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1216182799353795527} + m_CullTransparentMesh: 0 +--- !u!114 &2627823059853369016 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1216182799353795527} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.26358736, g: 1, b: 0.25, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 1 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: Ready +--- !u!114 &296580215536343968 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1216182799353795527} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cfabb0440166ab443bba8876756fdfa9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 1, y: -1} + m_UseGraphicAlpha: 1 +--- !u!1 &3376061075944110540 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4638804553886083032} + - component: {fileID: 8003168183302817464} + - component: {fileID: 2421428026365290233} + - component: {fileID: 1796267115599762959} + m_Layer: 5 + m_Name: Player Selection + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4638804553886083032 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3376061075944110540} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 7854029270145741362} + m_Father: {fileID: 3433337596703189776} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!223 &8003168183302817464 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3376061075944110540} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &2421428026365290233 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3376061075944110540} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &1796267115599762959 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3376061075944110540} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 --- !u!1 &3450864664022239381 GameObject: m_ObjectHideFlags: 0 @@ -30,7 +330,9 @@ Transform: 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_Children: + - {fileID: 6237256901541433624} + - {fileID: 4638804553886083032} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -108,8 +410,7 @@ MonoBehaviour: score: 0 choice: 5 potButton: 0 - stealButton: 0 blockButton: 0 stealLeft: 0 - stealAcross: 0 stealRight: 0 + readyText: {fileID: 2627823059853369016} diff --git a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity index 2a2a7d0..bc78605 100644 --- a/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity +++ b/GDDImagineGame/Assets/Team2/scenes/PennyPinchersMainScene.unity @@ -303,7 +303,7 @@ GameObject: - component: {fileID: 115035824} - component: {fileID: 115035823} m_Layer: 5 - m_Name: Canvas + m_Name: General UI m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -385,8 +385,9 @@ RectTransform: - {fileID: 2579328} - {fileID: 1968274022} - {fileID: 44980532} + - {fileID: 381598609} m_Father: {fileID: 0} - m_RootOrder: 8 + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -698,6 +699,101 @@ GameObject: type: 3} m_PrefabInstance: {fileID: 340912540} m_PrefabAsset: {fileID: 0} +--- !u!1 &381598608 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 381598609} + - component: {fileID: 381598612} + - component: {fileID: 381598611} + - component: {fileID: 381598610} + m_Layer: 5 + m_Name: Round Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &381598609 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 381598608} + 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: 115035826} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &381598610 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 381598608} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cfabb0440166ab443bba8876756fdfa9, type: 3} + m_Name: + m_EditorClassIdentifier: + m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5} + m_EffectDistance: {x: 9, y: -1} + m_UseGraphicAlpha: 1 +--- !u!114 &381598611 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 381598608} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 150 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 150 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: Round 1 +--- !u!222 &381598612 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 381598608} + m_CullTransparentMesh: 0 --- !u!1 &428008810 GameObject: m_ObjectHideFlags: 0 @@ -853,7 +949,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 7 + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &651593478 PrefabInstance: @@ -1059,6 +1155,11 @@ PrefabInstance: propertyPath: m_Name value: Player Three objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: manager + value: + objectReference: {fileID: 1082955455} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalPosition.x @@ -1114,6 +1215,16 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 6237256901541433624, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6237256901541433624, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalPosition.x + value: 1.79 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 82734d121651e644081af68b67e6b645, type: 3} --- !u!4 &741822261 stripped @@ -1134,6 +1245,11 @@ PrefabInstance: propertyPath: m_Name value: Player Four objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: manager + value: + objectReference: {fileID: 1082955455} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalPosition.x @@ -1189,6 +1305,11 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 4638804553886083032, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 82734d121651e644081af68b67e6b645, type: 3} --- !u!4 &821587122 stripped @@ -1238,6 +1359,7 @@ MonoBehaviour: - {fileID: 651593480} pot: {fileID: 2042638233} timerText: {fileID: 1805040155} + roundText: {fileID: 381598611} playerScores: - {fileID: 1696919945} - {fileID: 2579329} @@ -1305,6 +1427,11 @@ PrefabInstance: propertyPath: stealRight value: 275 objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: manager + value: + objectReference: {fileID: 1082955455} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalPosition.x @@ -1360,6 +1487,16 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 4638804553886083032, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6237256901541433624, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalPosition.z + value: -1.79 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 82734d121651e644081af68b67e6b645, type: 3} --- !u!4 &1446843447 stripped @@ -1427,6 +1564,11 @@ PrefabInstance: propertyPath: score value: 0 objectReference: {fileID: 0} + - target: {fileID: -3222763401902802492, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: manager + value: + objectReference: {fileID: 1082955455} - target: {fileID: 3433337596703189776, guid: 82734d121651e644081af68b67e6b645, type: 3} propertyPath: m_LocalPosition.x @@ -1482,6 +1624,16 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 6237256901541433624, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6237256901541433624, guid: 82734d121651e644081af68b67e6b645, + type: 3} + propertyPath: m_LocalPosition.x + value: -1.79 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 82734d121651e644081af68b67e6b645, type: 3} --- !u!4 &1603432932 stripped @@ -1769,7 +1921,7 @@ MonoBehaviour: m_HorizontalOverflow: 1 m_VerticalOverflow: 1 m_LineSpacing: 1 - m_Text: 'Timer:' + m_Text: 'Timer: 15' --- !u!222 &1805040156 CanvasRenderer: m_ObjectHideFlags: 0 diff --git a/GDDImagineGame/Assets/Team2/scripts/ClampName.cs b/GDDImagineGame/Assets/Team2/scripts/ClampName.cs new file mode 100644 index 0000000..bd5674a --- /dev/null +++ b/GDDImagineGame/Assets/Team2/scripts/ClampName.cs @@ -0,0 +1,23 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + +public class ClampName : MonoBehaviour +{ + public Text nameLabel; + public + + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + Vector3 namePos = Camera.main.WorldToScreenPoint(this.transform.position); + nameLabel.transform.position = namePos; + } +} diff --git a/GDDImagineGame/Assets/Team2/scripts/ClampName.cs.meta b/GDDImagineGame/Assets/Team2/scripts/ClampName.cs.meta new file mode 100644 index 0000000..b148e5b --- /dev/null +++ b/GDDImagineGame/Assets/Team2/scripts/ClampName.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6b7eac65f40598249b68f0cf1a42ab35 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/GDDImagineGame/Assets/Team2/scripts/Manager.cs b/GDDImagineGame/Assets/Team2/scripts/Manager.cs index cacd5a7..1f0e6ee 100644 --- a/GDDImagineGame/Assets/Team2/scripts/Manager.cs +++ b/GDDImagineGame/Assets/Team2/scripts/Manager.cs @@ -2,6 +2,13 @@ using UnityEngine.UI; using System.Collections.Generic; + +public enum GameState +{ + RoundTransition, + PlayerSelection, + AnimatePlayers +} public class Manager : MonoBehaviour { // Provides access to all four players @@ -16,6 +23,13 @@ public class Manager : MonoBehaviour // The Text object that displays the time remaining in the round public Text timerText; + //The text object that displays the round number and a boolean that determines if it is transitioning in or out + public Text roundText; + private bool transitionIn; + + //Integer that tracks the current round number + private int roundNum; + //Create a list to hold all of the player score text objects public List playerScores; @@ -43,11 +57,27 @@ public class Manager : MonoBehaviour // Amount to scale a pile by private float pileScale; + //Variable to hold the game state + private GameState gameState; + + + //PROPERTIES + public float Timer + { + get + { + return timer; + } + } + void Start() { timer = 0; currentRound = 1; gameOver = false; + gameState = GameState.RoundTransition; + transitionIn = false; + roundNum = 1; } void Update() @@ -55,115 +85,162 @@ void Update() // Prevent Update() when the game has ended if (gameOver) return; - // Increase timer - if (timer < timeToChoose) - { - timer += Time.deltaTime; - timerText.text = "Timer: " + (int)Mathf.Round((timeToChoose - timer) * 100) / 100; - } - - // Once timer has reached timeToChoose, handle choices - else + //Determine the current game state + switch (gameState) { - // Collect Player choices - Choice[] choices = { players[0].Choice, players[1].Choice, players[2].Choice, players[3].Choice }; - - // Number of players who went for the pot - int potNum = 0; - - // ID of player who went for the pot - int potPlayerNum = -1; - - // Handle each choice - for (int i = 0; i < choices.Length; i++) - { - // Player went for the pot - if (choices[i] == Choice.Pot) + case GameState.RoundTransition: { - potNum++; - potPlayerNum = i; - } - - // Player chose to steal - else if (choices[i] == Choice.StealLeft || choices[i] == Choice.StealRight) - { - //Index of object being targeted - int target = -1; - - switch (choices[i]) + if (transitionIn) { - case Choice.StealLeft: - if (i != 3) - { - target = i + 1; - } - else - { - target = 0; - } - break; - case Choice.StealRight: - if (i != 0) - { - target = i - 1; - } - else - { - target = choices.Length - 1; - } - break; + float alpha; + alpha = roundText.color.a + .5f * Time.deltaTime; + roundText.color = new Vector4(roundText.color.r, roundText.color.g, roundText.color.b, alpha); + if (alpha >= 1) + { + alpha = 1; + transitionIn = false; + } } - // Ignore if the chosen player is blocking, otherwise give half of score to player stealing - if (choices[target] != Choice.Block) + else { - int half = (int)Mathf.Ceil(players[target].Score / 2); - players[i].Score += half; - players[target].Score -= half; - pileScale = (float)(half * 0.1); - coinPiles[i].transform.localScale += new Vector3(pileScale, pileScale, pileScale); - coinPiles[target].transform.localScale -= new Vector3(pileScale, pileScale, pileScale); + float alpha; + alpha = roundText.color.a - .5f * Time.deltaTime; + roundText.color = new Vector4(roundText.color.r, roundText.color.g, roundText.color.b, alpha); + + if (alpha <= 0) + { + alpha = 0; + transitionIn = true; + roundNum++; + roundText.text = "Round " + roundNum; + gameState = GameState.PlayerSelection; + } } + break; } - } - // Only one player went for the pot, give them pot value - if (potNum == 1) - { - players[potPlayerNum].Score += potValue; - pileScale = (float)(potValue * 0.1); - coinPiles[potPlayerNum].transform.localScale += new Vector3(pileScale, pileScale, pileScale); - } + case GameState.PlayerSelection: + { + // Increase timer + if (timer < timeToChoose) + { + timer += Time.deltaTime; + timerText.text = "Timer: " + (int)Mathf.Round((timeToChoose - timer) * 100) / 100; + } - // Reset players choices and give them some pity money - for (int i = 0; i < players.Length; i++) - { - players[i].Choice = Choice.None; - players[i].Score += 1; - coinPiles[i].transform.localScale += new Vector3(0.1f, 0.1f, 0.1f); - } + // Once timer has reached timeToChoose, handle choices + else + { + // Collect Player choices + Choice[] choices = { players[0].Choice, players[1].Choice, players[2].Choice, players[3].Choice }; - // Increase round number - currentRound++; + // Number of players who went for the pot + int potNum = 0; - // End game if round number is greater than number of rounds - if (currentRound > numRounds) - { - GameOver(); - return; - } + // ID of player who went for the pot + int potPlayerNum = -1; - // Increase pot value and size - potValue += potIncrease; - pileScale = (float)(potIncrease * 0.1); - pot.transform.localScale += new Vector3(pileScale, pileScale, pileScale); + // Handle each choice + for (int i = 0; i < choices.Length; i++) + { + // Player went for the pot + if (choices[i] == Choice.Pot) + { + potNum++; + potPlayerNum = i; + } - UpdateScores(); + // Player chose to steal + else if (choices[i] == Choice.StealLeft || choices[i] == Choice.StealRight) + { + //Index of object being targeted + int target = -1; + + switch (choices[i]) + { + case Choice.StealLeft: + if (i != 3) + { + target = i + 1; + } + else + { + target = 0; + } + break; + case Choice.StealRight: + if (i != 0) + { + target = i - 1; + } + else + { + target = choices.Length - 1; + } + break; + } + // Ignore if the chosen player is blocking, otherwise give half of score to player stealing + if (choices[target] != Choice.Block) + { + int half = (int)Mathf.Ceil(players[target].Score / 2); + players[i].Score += half; + players[target].Score -= half; + pileScale = (float)(half * 0.1); + coinPiles[i].transform.localScale += new Vector3(pileScale, pileScale, pileScale); + coinPiles[target].transform.localScale -= new Vector3(pileScale, pileScale, pileScale); + } + } + } + + // Only one player went for the pot, give them pot value + if (potNum == 1) + { + players[potPlayerNum].Score += potValue; + pileScale = (float)(potValue * 0.1); + coinPiles[potPlayerNum].transform.localScale += new Vector3(pileScale, pileScale, pileScale); + } + + // Reset players choices and give them some pity money + for (int i = 0; i < players.Length; i++) + { + players[i].Choice = Choice.None; + players[i].Score += 1; + coinPiles[i].transform.localScale += new Vector3(0.1f, 0.1f, 0.1f); + } + + // Increase round number + currentRound++; + + // End game if round number is greater than number of rounds + if (currentRound > numRounds) + { + GameOver(); + return; + } + + // Increase pot value and size + potValue += potIncrease; + pileScale = (float)(potIncrease * 0.1); + pot.transform.localScale += new Vector3(pileScale, pileScale, pileScale); + + UpdateScores(); + + // Reset timer + timer = 0.0f; + timerText.text = "Timer: " + timeToChoose; + gameState = GameState.RoundTransition; + } + break; + } - // Reset timer - timer = 0.0f; + case GameState.AnimatePlayers: + { + break; + } } } + /// /// When the game has ended, show results /// diff --git a/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs b/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs index 4b4138d..18ba120 100644 --- a/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs +++ b/GDDImagineGame/Assets/Team2/scripts/PlayerController.cs @@ -1,4 +1,5 @@ using UnityEngine; +using UnityEngine.UI; // Enumeration of the actions a player can take in a round public enum Choice @@ -24,6 +25,10 @@ public class PlayerController : MonoBehaviour public KeyCode stealLeft; public KeyCode stealRight; + public Text readyText; + + public Manager manager; + //Player Properties public int Score @@ -59,7 +64,15 @@ void Start() void Update() { - PlayerAction(); + if (manager.Timer != 0) + { + PlayerAction(); + } + + if (manager.Timer == 0) + { + readyText.enabled = false; + } } /// @@ -75,17 +88,20 @@ public void PlayerAction() { Debug.Log(name + " is going for main pot"); Choice = Choice.Pot; + readyText.enabled = true; } // Player wants to go for a steal, handle who they're trying to steal from else if (Input.GetKeyDown(stealLeft)) { Debug.Log(name + " is stealing from the player to the left of them"); Choice = Choice.StealLeft; + readyText.enabled = true; } else if (Input.GetKeyDown(stealRight)) { Debug.Log(name + " is stealing from the player to the right of them"); Choice = Choice.StealRight; + readyText.enabled = true; } // Player wants to block @@ -93,6 +109,7 @@ public void PlayerAction() { Debug.Log(name + " is blocking"); Choice = Choice.Block; + readyText.enabled = true; } } }