diff --git a/Assets/Art/T_Char_02.png b/Assets/Art/T_Char_02.png new file mode 100644 index 0000000..23a3fa8 Binary files /dev/null and b/Assets/Art/T_Char_02.png differ diff --git a/Assets/Art/T_Char_02.png.meta b/Assets/Art/T_Char_02.png.meta new file mode 100644 index 0000000..c382375 --- /dev/null +++ b/Assets/Art/T_Char_02.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 028cce0260747214d81db557ec6f37c4 +timeCreated: 1460100052 +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_Char_Dash_02.png b/Assets/Art/T_Char_Dash_02.png new file mode 100644 index 0000000..971d1d7 Binary files /dev/null and b/Assets/Art/T_Char_Dash_02.png differ diff --git a/Assets/Art/T_Char_Dash_02.png.meta b/Assets/Art/T_Char_Dash_02.png.meta new file mode 100644 index 0000000..1986cf3 --- /dev/null +++ b/Assets/Art/T_Char_Dash_02.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 877352de2811c3e46b8b58e2475e07b3 +timeCreated: 1460100053 +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_Planet_Center.png b/Assets/Art/T_Planet_Center.png new file mode 100644 index 0000000..e59027c Binary files /dev/null and b/Assets/Art/T_Planet_Center.png differ diff --git a/Assets/Art/T_Planet_Center.png.meta b/Assets/Art/T_Planet_Center.png.meta new file mode 100644 index 0000000..01d56de --- /dev/null +++ b/Assets/Art/T_Planet_Center.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 545c8c8845e75b44087e8546737ac074 +timeCreated: 1460102042 +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_Satelite_01.png b/Assets/Art/T_Satelite_01.png new file mode 100644 index 0000000..4514c61 Binary files /dev/null and b/Assets/Art/T_Satelite_01.png differ diff --git a/Assets/Art/T_Satelite_01.png.meta b/Assets/Art/T_Satelite_01.png.meta new file mode 100644 index 0000000..1a9d976 --- /dev/null +++ b/Assets/Art/T_Satelite_01.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: adc5fe6c93bdded4bb5dc5e25191dbfc +timeCreated: 1460100053 +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/Prefabs/Astronaut.prefab b/Assets/Prefabs/Astronaut.prefab new file mode 100644 index 0000000..565df51 Binary files /dev/null and b/Assets/Prefabs/Astronaut.prefab differ diff --git a/Assets/Prefabs/Astronaut.prefab.meta b/Assets/Prefabs/Astronaut.prefab.meta new file mode 100644 index 0000000..f0f64a3 --- /dev/null +++ b/Assets/Prefabs/Astronaut.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: acd71c7b2f995984d9033c9dc4e257dc +timeCreated: 1460102262 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/file.txt b/Assets/Prefabs/file.txt deleted file mode 100644 index dc4d943..0000000 --- a/Assets/Prefabs/file.txt +++ /dev/null @@ -1 +0,0 @@ -tst \ No newline at end of file diff --git a/Assets/Prefabs/file.txt.meta b/Assets/Prefabs/file.txt.meta deleted file mode 100644 index 5db0151..0000000 --- a/Assets/Prefabs/file.txt.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: afc3ba2bd5b70194e9fb05d80712eecb -timeCreated: 1460091048 -licenseType: Pro -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Astronaut.cs b/Assets/Scripts/Astronaut.cs new file mode 100644 index 0000000..b5075d1 --- /dev/null +++ b/Assets/Scripts/Astronaut.cs @@ -0,0 +1,142 @@ +using UnityEngine; +using System.Collections; + +public class Astronaut : MonoBehaviour { + + private enum AstronautState + { + Idle, Walking, Jumping, Dashing, Ejecting, Dead + } + + public GameObject Rotator; + public GameObject SpriteWalk; + public GameObject SpriteDash; + + public float StepTime; + public float JumpSpeed; + + private AstronautState _state; + private AstronautState State + { + get + { + return _state; + } + set + { + AstronautState oldState = _state; + _state = value; + + if (oldState == _state) return; + + if (oldState == AstronautState.Dashing) + { + SpriteWalk.SetActive(false); + SpriteDash.SetActive(true); + } + else + { + SpriteWalk.SetActive(true); + SpriteDash.SetActive(false); + } + + if (_state == AstronautState.Walking) + { + StartCoroutine(WalkingStance()); + } + } + } + + private float vSpeed = 0; + private float height = 0; + private float angle = 0; + private float walkTime = 0; + + private int nextStep = 1; + + // Use this for initialization + void Start () { + State = AstronautState.Idle; + } + + // Update is called once per frame + void Update () { + + /* + switch (State) + { + case AstronautState.Dashing: + + break; + case AstronautState.Ejecting: + + break; + case AstronautState.Idle: + + break; + case AstronautState.Jumping: + + break; + case AstronautState.Walking: + + break; + } + */ + } + + public void Move(float x, float y) + { + if (State >= AstronautState.Ejecting ) + return; + + if (State < AstronautState.Jumping) + { + if (Mathf.Approximately(x, 0)) + { + State = AstronautState.Idle; + } + else + { + Debug.Log("walking"); + State = AstronautState.Walking; + } + } + } + + public void Jump() + { + if (_state >= AstronautState.Ejecting) + return; + } + + public void Dash() + { + if (_state >= AstronautState.Ejecting) + return; + } + + public void OnGUI() + { + if (GUI.Button(new Rect(10, 10, 150, 50), State.ToString())) + Debug.Log("Clicked the button with an image"); + } + + IEnumerator WalkingStance() + { + Debug.Log("walking stance"); + walkTime += Time.deltaTime / StepTime; + while (State <= AstronautState.Walking && walkTime <= 1f) + { + Vector3 rotation = transform.rotation.eulerAngles; + rotation.z = Mathf.Sin(walkTime*Mathf.PI); + transform.rotation = Quaternion.Euler(rotation); + yield return null; + } + + /*walkTime = 0f; + if(State == AstronautState.Walking) + { + StartCoroutine("WalkingStance"); + }*/ + } +} diff --git a/Assets/Scripts/Astronaut.cs.meta b/Assets/Scripts/Astronaut.cs.meta new file mode 100644 index 0000000..4f4dd5a --- /dev/null +++ b/Assets/Scripts/Astronaut.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8c32c40e0b8e5eb47bb7a91068af09ca +timeCreated: 1460098199 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/AstronautController.cs b/Assets/Scripts/AstronautController.cs new file mode 100644 index 0000000..bd94670 --- /dev/null +++ b/Assets/Scripts/AstronautController.cs @@ -0,0 +1,69 @@ +using UnityEngine; +using System.Collections; +using InputHandler; + +[RequireComponent(typeof(Astronaut))] +public class AstronautController : MonoBehaviour { + + private Astronaut _astronaut; + + public int PlayerNumber; + + // Use this for initialization + void Start() + { + InputManager.Instance.PushActiveContext("Gameplay", PlayerNumber); + InputManager.Instance.AddCallback(PlayerNumber, HandlePlayerAxis); + InputManager.Instance.AddCallback(PlayerNumber, HandlePlayerButtons); + + _astronaut = GetComponent(); + } + + private void HandlePlayerAxis(MappedInput input) + { + if (this == null) return; + + // movement + + float xValue = 0f; + + if (input.Ranges.ContainsKey("MoveLeft")) + { + xValue = -input.Ranges["MoveLeft"]; + } + else if (input.Ranges.ContainsKey("MoveRight")) + { + xValue = input.Ranges["MoveRight"]; + } + + float yValue = 0f; + + if (input.Ranges.ContainsKey("MoveUp")) + { + yValue = input.Ranges["MoveUp"]; + } + else if (input.Ranges.ContainsKey("MoveDown")) + { + yValue = -input.Ranges["MoveDown"]; + } + + _astronaut.Move(xValue, yValue); + + if (input.Ranges.ContainsKey("Dash")) + { + if(input.Ranges["Dash"] > 0.8f) + _astronaut.Dash(); + } + } + + private void HandlePlayerButtons(MappedInput input) + { + if (this == null) return; + + if (input.Actions.Contains("Jump")) + { + _astronaut.Jump(); + } + } +} + diff --git a/Assets/Scripts/AstronautController.cs.meta b/Assets/Scripts/AstronautController.cs.meta new file mode 100644 index 0000000..9831b13 --- /dev/null +++ b/Assets/Scripts/AstronautController.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ab270b0cb2475114ab8eb45661af0df1 +timeCreated: 1460097909 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/file.txt b/Assets/Scripts/file.txt deleted file mode 100644 index dc4d943..0000000 --- a/Assets/Scripts/file.txt +++ /dev/null @@ -1 +0,0 @@ -tst \ No newline at end of file diff --git a/Assets/Scripts/file.txt.meta b/Assets/Scripts/file.txt.meta deleted file mode 100644 index 1390611..0000000 --- a/Assets/Scripts/file.txt.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6681384214c3a3e4a90c112542387b03 -timeCreated: 1460091047 -licenseType: Pro -TextScriptImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Test/FloorTest.mat b/Assets/Test/FloorTest.mat new file mode 100644 index 0000000..3441c4f Binary files /dev/null and b/Assets/Test/FloorTest.mat differ diff --git a/Assets/Test/FloorTest.mat.meta b/Assets/Test/FloorTest.mat.meta new file mode 100644 index 0000000..a0e2a1a --- /dev/null +++ b/Assets/Test/FloorTest.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 48b3602a683827541bcc7e6753cd9aa8 +timeCreated: 1460102495 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Test/SR_TestInput.unity b/Assets/Test/SR_TestInput.unity index 425a364..278577f 100644 Binary files a/Assets/Test/SR_TestInput.unity and b/Assets/Test/SR_TestInput.unity differ