diff --git a/Assets/Art/T_PlanetTremor_Title_01.png b/Assets/Art/T_PlanetTremor_Title_01.png new file mode 100644 index 0000000..6718757 Binary files /dev/null and b/Assets/Art/T_PlanetTremor_Title_01.png differ diff --git a/Assets/Art/T_PlanetTremor_Title_01.png.meta b/Assets/Art/T_PlanetTremor_Title_01.png.meta new file mode 100644 index 0000000..9128ad1 --- /dev/null +++ b/Assets/Art/T_PlanetTremor_Title_01.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: b10a47314c9e9f54eb0d62019ca49971 +timeCreated: 1460236344 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Art/T_Text_PressStart.png b/Assets/Art/T_Text_PressStart.png new file mode 100644 index 0000000..d6a3d18 Binary files /dev/null and b/Assets/Art/T_Text_PressStart.png differ diff --git a/Assets/Art/T_Text_PressStart.png.meta b/Assets/Art/T_Text_PressStart.png.meta new file mode 100644 index 0000000..b47be7b --- /dev/null +++ b/Assets/Art/T_Text_PressStart.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 69076e315a6e1064da20c70c88286915 +timeCreated: 1460237872 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 8 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ControllerMapper.asset b/Assets/ControllerMapper.asset index dae1f5f..09609cc 100644 --- a/Assets/ControllerMapper.asset +++ b/Assets/ControllerMapper.asset @@ -16,6 +16,9 @@ MonoBehaviour: ButtonActions: - name: Jump XboxButtons: 00000000 + KeyboardKeys: + - name: Start + XboxButtons: 07000000 KeyboardKeys: 20000000 AxisRanges: - name: Dash diff --git a/Assets/Scripts/AsteroidSpawner.cs b/Assets/Scripts/AsteroidSpawner.cs index 3812775..89e3aaf 100644 --- a/Assets/Scripts/AsteroidSpawner.cs +++ b/Assets/Scripts/AsteroidSpawner.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; public class AsteroidSpawner : TimerFunctionsClass { - public float NextSpawnTime = 1.0f; public GameObject AsteroidPrefab1; public GameObject AsteroidPrefab2; diff --git a/Assets/Scripts/MenuController.cs b/Assets/Scripts/MenuController.cs index cf3e17f..86d0dc8 100644 --- a/Assets/Scripts/MenuController.cs +++ b/Assets/Scripts/MenuController.cs @@ -7,12 +7,14 @@ public class MenuController : MonoBehaviour private Astronaut _astronaut; public GameObject ReadySprite; + public MenuManager Menu; public int PlayerNumber; public void Update() { - ReadySprite.SetActive(_astronaut.Height < 3.5); - //Debug.Log(_astronaut.Height); + bool active = _astronaut.Height < 3.5; + ReadySprite.SetActive(active); + WorldManager.Instance.PlayersActive[PlayerNumber] = active; } // Use this for initialization @@ -38,5 +40,10 @@ public class MenuController : MonoBehaviour { _astronaut.Jump(); } + + if (input.Actions.Contains("Start")) + { + Menu.StartGame(); + } } } diff --git a/Assets/Scripts/MenuManager.cs b/Assets/Scripts/MenuManager.cs index 428d74a..e1a2039 100644 --- a/Assets/Scripts/MenuManager.cs +++ b/Assets/Scripts/MenuManager.cs @@ -1,21 +1,36 @@ using UnityEngine; -using System.Collections; +using System.Collections; +using UnityEngine.SceneManagement; -public class MenuManager : MonoBehaviour { +public class MenuManager : MonoBehaviour { + + public bool canPlay = false; + public GameObject PressStart; // Use this for initialization - void Start () { - + void Start () { //Place all players - /*Astronaut[] players = FindObjectOfType(); - foreach (Astronaut p in players) + MenuController[] players = FindObjectsOfType(); + Debug.Log(players.Length); + foreach (MenuController player in players) { - p.SetTheta(); - }*/ + player.Menu = this; + } } // Update is called once per frame void Update () { - + int numPlayers = 0; + foreach (bool b in WorldManager.Instance.PlayersActive) + numPlayers += b ? 1 : 0; + + canPlay = numPlayers > 1; + PressStart.SetActive(canPlay); + } + + public void StartGame() + { + if (canPlay) + SceneManager.LoadScene("Main"); } } diff --git a/Assets/Scripts/WorldManager.cs b/Assets/Scripts/WorldManager.cs index ba1ecdc..1114591 100644 --- a/Assets/Scripts/WorldManager.cs +++ b/Assets/Scripts/WorldManager.cs @@ -1,25 +1,14 @@ using UnityEngine; -using System.Collections; - -public class WorldManager : MonoBehaviour { - - private static WorldManager instance = null; - private WorldManager(){} - - // Use this for initialization - public void Awake () { - if (!instance) - { - instance = new WorldManager(); - } - } - - public WorldManager getInstance() { - return instance; - } - - // Update is called once per frame - void Update () { - - } +using System.Collections; + +public class WorldManager +{ + private static WorldManager instance = new WorldManager(); + public static WorldManager Instance + { + get { return instance; } + } + private WorldManager() { } + + public bool[] PlayersActive = { false, false, false, false }; } diff --git a/Assets/_Scenes/Selection.unity b/Assets/_Scenes/Selection.unity index b5cb84e..a2d73e3 100644 --- a/Assets/_Scenes/Selection.unity +++ b/Assets/_Scenes/Selection.unity @@ -113,8 +113,8 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 52383534} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 2.26, z: -0.11} - m_LocalScale: {x: 0.5, y: 0.6, z: 1} + m_LocalPosition: {x: 0, y: 2.71, z: -0.11} + m_LocalScale: {x: 0.3, y: 0.35, z: 1} m_Children: [] m_Father: {fileID: 10252813} m_RootOrder: 1 @@ -317,6 +317,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: ReadySprite: {fileID: 1394874970} + Menu: {fileID: 0} PlayerNumber: 1 --- !u!1 &334654674 stripped GameObject: @@ -334,6 +335,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: ReadySprite: {fileID: 1358448712} + Menu: {fileID: 0} PlayerNumber: 0 --- !u!1 &345530092 GameObject: @@ -389,8 +391,8 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 460107759} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 2.26, z: -0.11} - m_LocalScale: {x: 0.5, y: 0.6, z: 1} + m_LocalPosition: {x: 0, y: 2.71, z: -0.11} + m_LocalScale: {x: 0.3, y: 0.35, z: 1} m_Children: [] m_Father: {fileID: 1297255189} m_RootOrder: 1 @@ -424,6 +426,64 @@ SpriteRenderer: m_Color: {r: 0.08823532, g: 1, b: 0.13225162, a: 1} m_FlipX: 0 m_FlipY: 0 +--- !u!1 &771276056 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 771276057} + - 212: {fileID: 771276058} + m_Layer: 0 + m_Name: T_Text_PressStart + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &771276057 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 771276056} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.15411687, y: -1.942733, z: -0.11} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1793181213} + m_RootOrder: 0 +--- !u!212 &771276058 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 771276056} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 0 + m_ReflectionProbeUsage: 0 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 69076e315a6e1064da20c70c88286915, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 --- !u!4 &780956563 stripped Transform: m_PrefabParentObject: {fileID: 494126, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} @@ -490,6 +550,64 @@ Prefab: m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: df46c50b8d1900d41856ac14ea277586, type: 2} m_IsPrefabParent: 0 +--- !u!1 &916100836 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 916100837} + - 212: {fileID: 916100838} + m_Layer: 0 + m_Name: T_PlanetTremor_Title_01 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &916100837 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 916100836} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -3.32, y: 4.41, z: -0.11} + m_LocalScale: {x: 1.5, y: 1.5, z: 1} + m_Children: [] + m_Father: {fileID: 1793181213} + m_RootOrder: 1 +--- !u!212 &916100838 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 916100836} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0} + m_SubsetIndices: + m_StaticBatchRoot: {fileID: 0} + m_UseLightProbes: 0 + m_ReflectionProbeUsage: 0 + m_ProbeAnchor: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: b10a47314c9e9f54eb0d62019ca49971, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 --- !u!114 &1027139440 stripped MonoBehaviour: m_PrefabParentObject: {fileID: 11471614, guid: 198e988adacced646a19f757f6237ae1, @@ -559,6 +677,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: ReadySprite: {fileID: 460107759} + Menu: {fileID: 0} PlayerNumber: 2 --- !u!1001 &1223268487 Prefab: @@ -748,8 +867,8 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1358448712} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 2.26, z: -0.11} - m_LocalScale: {x: 0.5, y: 0.6, z: 1} + m_LocalPosition: {x: 0, y: 2.71, z: -0.11} + m_LocalScale: {x: 0.3, y: 0.35, z: 1} m_Children: [] m_Father: {fileID: 1419848163} m_RootOrder: 1 @@ -806,8 +925,8 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1394874970} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 2.26, z: -0.11} - m_LocalScale: {x: 0.5, y: 0.6, z: 1} + m_LocalPosition: {x: 0, y: 2.71, z: -0.11} + m_LocalScale: {x: 0.3, y: 0.35, z: 1} m_Children: [] m_Father: {fileID: 780956563} m_RootOrder: 1 @@ -912,6 +1031,10 @@ Prefab: propertyPath: PlayerOffset value: 54 objectReference: {fileID: 0} + - target: {fileID: 11471614, guid: 198e988adacced646a19f757f6237ae1, type: 2} + propertyPath: CartierResetRatioSpeedFactor + value: 0.1 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 198e988adacced646a19f757f6237ae1, type: 2} m_IsPrefabParent: 0 @@ -1199,6 +1322,49 @@ Prefab: - {fileID: 11434752, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} m_ParentPrefab: {fileID: 100100000, guid: acd71c7b2f995984d9033c9dc4e257dc, type: 2} m_IsPrefabParent: 0 +--- !u!1 &1793181211 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1793181213} + - 114: {fileID: 1793181212} + m_Layer: 0 + m_Name: MenuManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1793181212 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1793181211} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 67b495a5d73b72a45ad6c14e819a980a, type: 3} + m_Name: + m_EditorClassIdentifier: + canPlay: 0 + PressStart: {fileID: 771276056} +--- !u!4 &1793181213 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1793181211} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.036000013, y: 0.0765, z: 0.11} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 771276057} + - {fileID: 916100837} + m_Father: {fileID: 0} + m_RootOrder: 8 --- !u!1001 &1867085521 Prefab: m_ObjectHideFlags: 0 @@ -1372,7 +1538,7 @@ Camera: far clip plane: 1000 field of view: 60 orthographic: 1 - orthographic size: 9.36 + orthographic size: 6.46 m_Depth: -1 m_CullingMask: serializedVersion: 2 @@ -1393,7 +1559,7 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1945693977} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalPosition: {x: 0, y: 1.41, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -1414,4 +1580,5 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: ReadySprite: {fileID: 52383534} + Menu: {fileID: 0} PlayerNumber: 3