Compare commits

...
4 changed files with 63 additions and 45 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ Material:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Prototype Checker
m_Name: Prototype checker
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON
m_LightmapFlags: 4
+35 -17
View File
@@ -9,11 +9,13 @@ public class FloorLevel : MonoBehaviour
{
public int escalation = 1;
public int level = 1;
public GameObject player;
public PlayerController script;
public GameObject[] obstacleList;
private int selection = 0;
private int height = 2;
void Awake()
{
@@ -40,7 +42,8 @@ public class FloorLevel : MonoBehaviour
if(script.finished == true)
{
escalation++;
level++;
if(level > 3) escalation++;
respawn();
levelBuild();
@@ -66,7 +69,7 @@ public class FloorLevel : MonoBehaviour
void respawn()
{
script.transform.position = new Vector3((50*escalation)+100, 2, (50*escalation)+100);
script.transform.position = new Vector3((100*escalation)+50, 2, (100*escalation)+50);
script.transform.Rotate(0.0f, 0.0f, 0.0f, Space.Self);
}
@@ -81,28 +84,43 @@ public class FloorLevel : MonoBehaviour
Destroy(GameObject.FindWithTag("Finish"));
for(int i = 1; i <= escalation; i++){
for(int j = 1; j <= escalation; j++){
selection = Random.Range(2, obstacleList.Length);
Instantiate(obstacleList[selection], new Vector3(50*i, 2, 50*j), Quaternion.identity);
selection = Random.Range(2, obstacleList.Length);
Instantiate(obstacleList[selection], new Vector3(-50*i, 2, -50*j), Quaternion.identity);
for(int i = 0; i < escalation; i++){
for(int j = 0; j < escalation; j++){
selection = Random.Range(2, obstacleList.Length);
Instantiate(obstacleList[selection], new Vector3(-50*i, 2, 50*j), Quaternion.identity);
if(Random.Range(0, 20) != 0 || (i == (escalation-1) && j == (escalation-1) && i == j))
{
height = Random.Range(0, 7);
selection = Random.Range(2, obstacleList.Length);
Instantiate(obstacleList[selection], new Vector3(100*i+50, height, 100*j+50), Quaternion.identity);
}
selection = Random.Range(2, obstacleList.Length);
Instantiate(obstacleList[selection], new Vector3(50*i, 2, -50*j), Quaternion.identity);
if(Random.Range(0, 20) != 0 || (i == (escalation-1) && j == (escalation-1) && i == j))
{
height = Random.Range(0, 7);
selection = Random.Range(2, obstacleList.Length);
Instantiate(obstacleList[selection], new Vector3(-100*i-50, height, -100*j-50), Quaternion.identity);
}
if(Random.Range(0, 10) != 0)
{
height = Random.Range(0, 7);
selection = Random.Range(2, obstacleList.Length);
Instantiate(obstacleList[selection], new Vector3(-100*i-50, height, 100*j+50), Quaternion.identity);
}
if(Random.Range(0, 10) != 0)
{
height = Random.Range(0, 7);
selection = Random.Range(2, obstacleList.Length);
Instantiate(obstacleList[selection], new Vector3(100*i+50, height, -100*j-50), Quaternion.identity);
}
script.transform.position = new Vector3((50*escalation)+100, 2, (50*escalation)+100);
script.transform.Rotate(0.0f, 0.0f, 0.0f, Space.Self);
}
}
Instantiate(obstacleList[0], new Vector3((50*escalation)+100, 0, (50*escalation)+100), Quaternion.identity);
Instantiate(obstacleList[1], new Vector3(-((50*escalation)+100), 0, -((50*escalation)+100)), Quaternion.identity);
Instantiate(obstacleList[0], new Vector3((100*escalation)+50, 0, (100*escalation)+50), Quaternion.identity);
Instantiate(obstacleList[1], new Vector3(-((100*escalation)+50), 0, -((100*escalation)+50)), Quaternion.identity);
script.finished = false;
}
+5 -5
View File
@@ -146,14 +146,14 @@ public class PlayerController : MonoBehaviour
}
}
if(Input.GetButton("Crouch"))
if(Input.GetButton("Crouch") || Input.GetAxis("Crouch") == 1.0f)
{
characterController.height /= 2;
capsule.height /= 2;
transform.localScale = new Vector3(transform.localScale.x, transformHeight/2, transform.localScale.z);
if(Input.GetButtonDown("Crouch"))
if(Input.GetButtonDown("Crouch") || Input.GetAxis("Crouch") == 1.0f)
{
if((Input.GetAxis("Horizontal") != 0 || Input.GetAxis("Vertical") != 0))
{
@@ -197,7 +197,7 @@ public class PlayerController : MonoBehaviour
} else {
slideTime = Time.time;
if(Input.GetButton("Crouch"))
if(Input.GetButton("Crouch") || Input.GetAxis("Crouch") == 1.0f)
{
characterController.height /= 2;
@@ -214,7 +214,7 @@ public class PlayerController : MonoBehaviour
}
//Might want to change move direction value to make triggering this speed up effect easier/harder
if(diving && moveDirection.y > 0.75 && Input.GetButtonDown("Crouch"))
if(diving && moveDirection.y > 0.75 && (Input.GetButtonDown("Crouch") || Input.GetAxis("Crouch") == 1.0f ))
{
dive++;
if(dive == 1){
@@ -268,7 +268,7 @@ public class PlayerController : MonoBehaviour
velocity.x += moveDirection.x;
velocity.z += moveDirection.z;
if((Input.GetAxis("Horizontal") == 0 && Input.GetAxis("Vertical") == 0) || Input.GetButton("Stop")){
if((Input.GetAxis("Horizontal") == 0 && Input.GetAxis("Vertical") == 0) || (Input.GetButton("Stop") || Input.GetAxis("Stop") == 1.0f)){
//Remove or "lower" friction to add an 'ice' effect
velocity.x = Mathf.SmoothDamp(velocity.x, 0.0f, ref xVelocity, friction);
+22 -22
View File
@@ -186,16 +186,16 @@ InputManager:
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 7
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
gravity: 0
dead: 0.19
sensitivity: 1
snap: 1
invert: 0
type: 0
axis: 0
type: 2
axis: 9
joyNum: 0
- serializedVersion: 3
m_Name: Walk
@@ -218,23 +218,23 @@ InputManager:
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 6
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
gravity: 0
dead: 0.19
sensitivity: 1
snap: 1
invert: 0
type: 0
axis: 0
type: 2
axis: 8
joyNum: 0
- serializedVersion: 3
m_Name: Jump
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 1
positiveButton: joystick button 0
altNegativeButton:
altPositiveButton:
gravity: 1000
@@ -253,13 +253,13 @@ InputManager:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 1000
gravity: 0
dead: 0.25
sensitivity: 0.1
sensitivity: 1
snap: 0
invert: 0
type: 2
axis: 2
axis: 3
joyNum: 0
- serializedVersion: 3
m_Name: Mouse Y
@@ -269,13 +269,13 @@ InputManager:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 1000
gravity: 0
dead: 0.25
sensitivity: 0.1
sensitivity: 1
snap: 0
invert: 1
type: 2
axis: 3
axis: 4
joyNum: 0
- serializedVersion: 3
m_Name: Pause
@@ -298,7 +298,7 @@ InputManager:
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 9
positiveButton: joystick button 7
altNegativeButton:
altPositiveButton:
gravity: 1000