Fixes to camera, started Slowmo

This commit is contained in:
adrenalx 2016-06-25 17:25:10 -04:00
commit ac697131cc
27 changed files with 268 additions and 9 deletions

Binary file not shown.

View File

@ -1,7 +1,13 @@
fileFormatVersion: 2
<<<<<<< HEAD
guid: 9ae293cd9e24d174a992ca345a75eac3
folderAsset: yes
timeCreated: 1466817257
=======
guid: a9a564757083e4a4d9316e9e699316ac
folderAsset: yes
timeCreated: 1466870448
>>>>>>> 417cb1bd20dec13350564e0d8da1a93ffdb26561
licenseType: Free
DefaultImporter:
userData:

BIN
Assets/Materials/Ground.mat Normal file

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: aed5fade9ccbf2d46bf25f753014c55e
timeCreated: 1466817296
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -1,6 +1,11 @@
fileFormatVersion: 2
<<<<<<< HEAD
guid: 7f3315ade4f14c740a827cbd008ea14e
timeCreated: 1466817392
=======
guid: a1d7ff165c6400643b2057a06b2fb899
timeCreated: 1466869200
>>>>>>> 417cb1bd20dec13350564e0d8da1a93ffdb26561
licenseType: Free
NativeFormatImporter:
userData:

Binary file not shown.

BIN
Assets/Prefabs/Cube.prefab Normal file

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: edbc472cdc087e04b8454564a02e0105
timeCreated: 1466879663
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Prefabs/Tile.prefab Normal file

Binary file not shown.

Binary file not shown.

9
Assets/Scenes.meta Normal file
View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 9af33609c2bd71b49b10ef5c4cc64007
folderAsset: yes
timeCreated: 1466817280
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cb1c8348b6f5812488b3702db8152ad3
timeCreated: 1466822462
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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:

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7159df8adbfc94e4f8acac37ab9af5ce
timeCreated: 1466884176
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Scripts/Cube.prefab Normal file

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2479cecac8cfd2e4faf372505019532e
timeCreated: 1466882337
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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;
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: a2a093b34b4e3714293729a5a3c4bfb3
timeCreated: 1466877393
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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<Rigidbody>();
}
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);
}
}
}

View File

@ -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<Rigidbody>().AddForce(movement * speed * Time.deltaTime);
}
void OnTriggerEnter(Collider other)
{
if (other.tag == "Tile")
{// && gameController.GetComponent<GameController>().fallTriggerActivated == true
other.GetComponent<TileController>().wasTouched = true;
Debug.Log("Tile touched");
}
if (other.tag == "Trigger")
{
Debug.Log("Trigger entered");
gameController.GetComponent<GameController>().fallTriggerActivated = true;
}
}
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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<Rigidbody>().isKinematic = false;
GetComponent<Rigidbody>().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);
}
}
}

View File

@ -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