Permalink
Browse files

Updated Readme & Enemies do Contact Damage.

  • Loading branch information...
Retl committed Apr 6, 2014
1 parent 36eb7cf commit 9d6b9a1959cb1826c9d13fc827d7e2d3a4323707
@@ -5,6 +5,17 @@ The Seas Have Eyes is a first-person arcade horror game developed by Blue Husky

*REMEMBER: When running in the preview window in Unity, use ctrl+p to start and stop, as the cursor will be locked.*

*Controls*

* Keyboard WASD – Forward, Left strafe, Backward, Right strafe (respectively)
* Keyboard Shift – Boost (takes up stamina)
* Keyboard Space - Swim up. (Kinda like an infinite jump.)
* Keyboard Ctrl – Brake
* Mouse movement – Pitch, yaw
* Mouse left click – Forward
* Mouse right click - Attack
* Mouse middle click - Change Movement Style

*Credits*
* Programming: https://github.com/Supuhstar & https://github.com/Retl
* Grahpical Assets: https://github.com/Supuhstar & https://github.com/Retl
@@ -46,7 +46,11 @@ void OnTriggerStay(Collider other)
{
print("Trigger Stay by: " + other.ToString());
}
PlayerController playerController = other.transform.parent.GetComponent<PlayerController>();

PlayerController playerController;

//If the parent of the object we're colliding with is the player, Check to see if we are looking at eachother before dealing damage.
playerController = other.transform.parent.GetComponent<PlayerController>();
if (playerController != null && genericEnemy.attackCooldownTime <= 0)
{
genericEnemy.SmoothLookAt(playerController.transform.position);
@@ -56,6 +60,16 @@ void OnTriggerStay(Collider other)
genericEnemy.attackCooldownTime = attackRate; //Wait one second before able to attack again.
}
}

//If the object we're colliding with is the player, immediately attempt to deal damage.
playerController = other.GetComponent<PlayerController>();
if (playerController != null && genericEnemy.attackCooldownTime <= 0)
{
genericEnemy.SmoothLookAt(playerController.transform.position);
playerController.TakeDamage(DAMAGE);
genericEnemy.attackCooldownTime = attackRate; //Wait one second before able to attack again.
}

}
}

@@ -47,16 +47,29 @@ void OnTriggerStay(Collider other)
{
print("Trigger Stay by: " + other.ToString());
}
PlayerController playerController = other.transform.parent.GetComponent<PlayerController>();
if (playerController != null && genericEnemy.attackCooldownTime <= 0)
{
genericEnemy.SmoothLookAt(playerController.transform.position);
if (genericEnemy.IsFacingPlayer(attackRange))
{
playerController.TakeDamage(DAMAGE);
genericEnemy.attackCooldownTime = attackRate; //Wait one second before able to attack again.
}
}

PlayerController playerController;

//If the parent of the object we're colliding with is the player, Check to see if we are looking at eachother before dealing damage.
playerController = other.transform.parent.GetComponent<PlayerController>();
if (playerController != null && genericEnemy.attackCooldownTime <= 0)
{
genericEnemy.SmoothLookAt(playerController.transform.position);
if (genericEnemy.IsFacingPlayer(attackRange))
{
playerController.TakeDamage(DAMAGE);
genericEnemy.attackCooldownTime = attackRate; //Wait one second before able to attack again.
}
}

//If the object we're colliding with is the player, immediately attempt to deal damage.
playerController = other.GetComponent<PlayerController>();
if (playerController != null && genericEnemy.attackCooldownTime <= 0)
{
genericEnemy.SmoothLookAt(playerController.transform.position);
playerController.TakeDamage(DAMAGE);
genericEnemy.attackCooldownTime = attackRate; //Wait one second before able to attack again.
}
}
}

@@ -235,6 +235,27 @@ void HandlePlayerInput()
* Mouse right click - Attack? Or is attacking automatic? - Moore
*/

//Misc Options Section
if (Input.GetButtonDown("Fire2"))
{
//If the player just used Fire2 (Middleclick) change the movement control style to the next level up. This may be better suited to an on screen button or options menu.
switch (controlStyle)
{
case ControlStyle.Advanced:
controlStyle = ControlStyle.Basic;
break;
case ControlStyle.Basic:
controlStyle = ControlStyle.Normal;
break;
case ControlStyle.Normal:
controlStyle = ControlStyle.Advanced;
break;

default:
break;
}
}

//Movement Section

gamepadLeftHorizontalOffset = Input.GetAxis("Horizontal");

0 comments on commit 9d6b9a1

Please sign in to comment.