diff --git a/Assets/AntoineScene.unity b/Assets/AntoineScene.unity index f18be85..091cc0e 100644 Binary files a/Assets/AntoineScene.unity and b/Assets/AntoineScene.unity differ diff --git a/Assets/Materials.meta b/Assets/Materials.meta index 334f543..97cbe12 100644 --- a/Assets/Materials.meta +++ b/Assets/Materials.meta @@ -1,7 +1,13 @@ fileFormatVersion: 2 +<<<<<<< HEAD +guid: 9ae293cd9e24d174a992ca345a75eac3 +folderAsset: yes +timeCreated: 1466817257 +======= guid: a9a564757083e4a4d9316e9e699316ac folderAsset: yes timeCreated: 1466870448 +>>>>>>> 417cb1bd20dec13350564e0d8da1a93ffdb26561 licenseType: Free DefaultImporter: userData: diff --git a/Assets/Materials/Ground.mat b/Assets/Materials/Ground.mat new file mode 100644 index 0000000..2eb866d Binary files /dev/null and b/Assets/Materials/Ground.mat differ diff --git a/Assets/Materials/Ground.mat.meta b/Assets/Materials/Ground.mat.meta new file mode 100644 index 0000000..097a510 --- /dev/null +++ b/Assets/Materials/Ground.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: aed5fade9ccbf2d46bf25f753014c55e +timeCreated: 1466817296 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Materials/New Material 1.mat b/Assets/Materials/New Material 1.mat index 7e63c51..70a7d84 100644 Binary files a/Assets/Materials/New Material 1.mat and b/Assets/Materials/New Material 1.mat differ diff --git a/Assets/Materials/New Material 1.mat.meta b/Assets/Materials/New Material 1.mat.meta index d090321..e0e66e7 100644 --- a/Assets/Materials/New Material 1.mat.meta +++ b/Assets/Materials/New Material 1.mat.meta @@ -1,6 +1,11 @@ fileFormatVersion: 2 +<<<<<<< HEAD +guid: 7f3315ade4f14c740a827cbd008ea14e +timeCreated: 1466817392 +======= guid: a1d7ff165c6400643b2057a06b2fb899 timeCreated: 1466869200 +>>>>>>> 417cb1bd20dec13350564e0d8da1a93ffdb26561 licenseType: Free NativeFormatImporter: userData: diff --git a/Assets/Materials/New Material.mat b/Assets/Materials/New Material.mat index c100e99..355f6eb 100644 Binary files a/Assets/Materials/New Material.mat and b/Assets/Materials/New Material.mat differ diff --git a/Assets/Prefabs/Cube.prefab b/Assets/Prefabs/Cube.prefab new file mode 100644 index 0000000..686994f Binary files /dev/null and b/Assets/Prefabs/Cube.prefab differ diff --git a/Assets/Prefabs/Cube.prefab.meta b/Assets/Prefabs/Cube.prefab.meta new file mode 100644 index 0000000..ecbf067 --- /dev/null +++ b/Assets/Prefabs/Cube.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: edbc472cdc087e04b8454564a02e0105 +timeCreated: 1466879663 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Tile.prefab b/Assets/Prefabs/Tile.prefab new file mode 100644 index 0000000..1e58aff Binary files /dev/null and b/Assets/Prefabs/Tile.prefab differ diff --git a/Assets/Prefabs/TileTrap.prefab b/Assets/Prefabs/TileTrap.prefab new file mode 100644 index 0000000..b71fd9e Binary files /dev/null and b/Assets/Prefabs/TileTrap.prefab differ diff --git a/Assets/Scenes.meta b/Assets/Scenes.meta new file mode 100644 index 0000000..6426d80 --- /dev/null +++ b/Assets/Scenes.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9af33609c2bd71b49b10ef5c4cc64007 +folderAsset: yes +timeCreated: 1466817280 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/MovementPlayer.unity b/Assets/Scenes/MovementPlayer.unity new file mode 100644 index 0000000..dd704ac Binary files /dev/null and b/Assets/Scenes/MovementPlayer.unity differ diff --git a/Assets/Scenes/MovementPlayer.unity.meta b/Assets/Scenes/MovementPlayer.unity.meta new file mode 100644 index 0000000..a820129 --- /dev/null +++ b/Assets/Scenes/MovementPlayer.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cb1c8348b6f5812488b3702db8152ad3 +timeCreated: 1466822462 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts.meta b/Assets/Scripts.meta index 5d8d110..1b3d4d8 100644 --- a/Assets/Scripts.meta +++ b/Assets/Scripts.meta @@ -1,5 +1,10 @@ fileFormatVersion: 2 <<<<<<< HEAD +guid: cb6d0969f94b8e74cb372cc48d1509c8 +folderAsset: yes +timeCreated: 1466817267 +======= +<<<<<<< HEAD guid: 40764ebe822b819449a2b0cf923f4c2e folderAsset: yes timeCreated: 1466858656 @@ -8,6 +13,7 @@ guid: 585294b74b6b54cae92293ffbd3a2088 folderAsset: yes timeCreated: 1466869142 >>>>>>> 7154f75c01cc58ae5d74a82380fe1a95dca97e73 +>>>>>>> 417cb1bd20dec13350564e0d8da1a93ffdb26561 licenseType: Free DefaultImporter: userData: diff --git a/Assets/Scripts/Cube 1.prefab b/Assets/Scripts/Cube 1.prefab new file mode 100644 index 0000000..1456cf8 Binary files /dev/null and b/Assets/Scripts/Cube 1.prefab differ diff --git a/Assets/Scripts/Cube 1.prefab.meta b/Assets/Scripts/Cube 1.prefab.meta new file mode 100644 index 0000000..cbaf219 --- /dev/null +++ b/Assets/Scripts/Cube 1.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7159df8adbfc94e4f8acac37ab9af5ce +timeCreated: 1466884176 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Cube.prefab b/Assets/Scripts/Cube.prefab new file mode 100644 index 0000000..a719780 Binary files /dev/null and b/Assets/Scripts/Cube.prefab differ diff --git a/Assets/Scripts/Cube.prefab.meta b/Assets/Scripts/Cube.prefab.meta new file mode 100644 index 0000000..07b085b --- /dev/null +++ b/Assets/Scripts/Cube.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2479cecac8cfd2e4faf372505019532e +timeCreated: 1466882337 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/FloorTileGenerator.cs b/Assets/Scripts/FloorTileGenerator.cs new file mode 100644 index 0000000..baf97e2 --- /dev/null +++ b/Assets/Scripts/FloorTileGenerator.cs @@ -0,0 +1,27 @@ +using UnityEngine; +using System.Collections; +[ExecuteInEditMode] +public class FloorTileGenerator : MonoBehaviour { + + public GameObject tile; + public int x; + public int y; + public GameObject[] floorArray; + //public GameObject[] testArray; + // Use this for initialization + void Start () { + CreateFloor(); + + } + void CreateFloor() + { + floorArray = new GameObject[x*y]; + for (int i = 0; i < x * y; ++i) + { + floorArray[i] = (GameObject)Instantiate(tile, new Vector3(i/y, 0, i%y), new Quaternion()); + floorArray[i].name = i/y + "," + i%y; + } + } + + +} diff --git a/Assets/Scripts/FloorTileGenerator.cs.meta b/Assets/Scripts/FloorTileGenerator.cs.meta new file mode 100644 index 0000000..f00fe25 --- /dev/null +++ b/Assets/Scripts/FloorTileGenerator.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a2a093b34b4e3714293729a5a3c4bfb3 +timeCreated: 1466877393 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/JumpingPlayer.cs b/Assets/Scripts/JumpingPlayer.cs new file mode 100644 index 0000000..247ae9b --- /dev/null +++ b/Assets/Scripts/JumpingPlayer.cs @@ -0,0 +1,42 @@ +using UnityEngine; +using System.Collections; + +public class JumpingPlayer : MonoBehaviour +{ + + public float jump = 0f; + private Rigidbody rb; + private bool isGrounded; + Vector3 up; + + + void Start() + { + up = new Vector3(); + rb = GetComponent(); + } + + void OnCollisionEnter(Collision collision) + { + if (collision.gameObject.tag == "Ground") + { + isGrounded = true; + Debug.Log(isGrounded); + } + Debug.LogWarning(isGrounded); + + } + + // Update is called once per frame + void FixedUpdate() + { + if (Input.GetButtonDown("Jump") && isGrounded) + { + up = rb.velocity; + up.y = jump; + rb.velocity = up; + isGrounded = false; + Debug.Log(isGrounded); + } + } +} diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs new file mode 100644 index 0000000..1233837 --- /dev/null +++ b/Assets/Scripts/PlayerController.cs @@ -0,0 +1,44 @@ +using UnityEngine; +using System.Collections; + +public class PlayerController : MonoBehaviour { + + public float speed; + GameObject gameController; + + + // Use this for initialization + void Start () { + + gameController = GameObject.Find("GameController"); + } + + // Update is called once per frame + void Update () { + + } + + void FixedUpdate() + { + float moveHorizontal = Input.GetAxis("Horizontal"); + //float moveVertical = Input.GetAxis("Vertical"); + + Vector3 movement = new Vector3(moveHorizontal, 0.0f, 0); + + GetComponent().AddForce(movement * speed * Time.deltaTime); + } + + void OnTriggerEnter(Collider other) + { + if (other.tag == "Tile") + {// && gameController.GetComponent().fallTriggerActivated == true + other.GetComponent().wasTouched = true; + Debug.Log("Tile touched"); + } + if (other.tag == "Trigger") + { + Debug.Log("Trigger entered"); + gameController.GetComponent().fallTriggerActivated = true; + } + } +} diff --git a/Assets/Scripts/PostEffectScript.cs b/Assets/Scripts/PostEffectScript.cs index 14fb0d2..c735025 100644 --- a/Assets/Scripts/PostEffectScript.cs +++ b/Assets/Scripts/PostEffectScript.cs @@ -6,6 +6,7 @@ public class PostEffectScript : MonoBehaviour { public float blindness = 0.5f; public Rigidbody character; public float blindnessRatio = 0.1f; + public float blindnessSpeed = 0.1f; public float velocity; // Use this for initialization void Start () { @@ -18,15 +19,16 @@ public class PostEffectScript : MonoBehaviour { } void OnRenderImage(RenderTexture src, RenderTexture dest) { + Vector2 planarVelocity = new Vector3(character.velocity.x, 0, character.velocity.z); if (character.velocity.magnitude > 0) { - blindness = character.velocity.normalized.magnitude * blindnessRatio; + blindness = 1 * blindnessRatio; blindnessRatio += 0.01f; } else if (blindnessRatio >= 0.1f) { - blindness = character.velocity.normalized.magnitude * blindnessRatio; - blindnessRatio = 0.1f; + blindnessRatio -= 0.01f; + blindness = 1 * blindnessRatio; } diff --git a/Assets/Scripts/PostEffectShader.shader b/Assets/Scripts/PostEffectShader.shader index 86ee589..34dfd26 100644 --- a/Assets/Scripts/PostEffectShader.shader +++ b/Assets/Scripts/PostEffectShader.shader @@ -45,7 +45,8 @@ fixed4 frag (v2f i) : SV_Target { fixed4 col = tex2D(_MainTex, i.uv); - col.r = col.r+ _Blindness; + //half4 transparent = tex2D(_MainText, UNITY_PROJ_COORD(i)); + col.r = col.r+_Blindness; col.g = col.g+_Blindness; col.b = col.b+_Blindness; //col.a = (c.r + c.b + c.g) / 3; diff --git a/Assets/Scripts/TileController.cs b/Assets/Scripts/TileController.cs new file mode 100644 index 0000000..fdbc32a --- /dev/null +++ b/Assets/Scripts/TileController.cs @@ -0,0 +1,66 @@ +using UnityEngine; +using System.Collections; + +public class TileController : MonoBehaviour +{ + + public float speed; + public float speedAddition; + public float seconds; + public bool wasTouched; + public bool timerStart; + float initialTime; + private bool hasStartedMovement; + Vector3 movement; + //GameObject gameController; + + // Use this for initialization + void Start() + { + movement = new Vector3(0.0f, -1, 0.0f); + timerStart = false; + //gameController = GameObject.Find("GameController"); + } + + // Update is called once per frame + void Update() + { + + } + + void FixedUpdate() + { + if (wasTouched == true) + { + CountdownUntilFall(seconds); + } + if (hasStartedMovement == true) + { + GetComponent().isKinematic = false; + GetComponent().AddForce(movement * speed * Time.deltaTime); + speed = speed + speedAddition; + } + } + + private void CountdownUntilFall(float seconds) + { + if (!timerStart) + { + initialTime = Time.realtimeSinceStartup + seconds; + timerStart = true; + } + if (Time.realtimeSinceStartup >= initialTime) + { + hasStartedMovement = true; + } + + } + + void OnTriggerEnter (Collider other) + { + if (other.tag == "DestroyTrigger") + { + Destroy(this.gameObject); + } + } +} diff --git a/README.md b/README.md index b9f8cf8..d28dcdf 100644 --- a/README.md +++ b/README.md @@ -18,17 +18,16 @@ Core gameplay principles * First person view (w/ controls of view and headbobbing) *Assigned to Alex* * View controls ✓ * Headbobbing - * Movement (jumping, etc) *Assigned to Kerby* + * Movement (jumping, etc) *Assigned to Kerby* ✓ * Controls ✓ - * Jumping + * Jumping ✓ * Gameplay mechanics * Fog of war - * Falling tiles *Assigned to Hugo* - * Stay a while mechanic *Assigned to Antoine* + * Falling tiles *Assigned to Hugo* ✓ + * Stay a while mechanic *Assigned to Antoine* ✓ ###Possible traps/pick ups * Slow down time -* Transparent structures * Super jump / speed * XRay