Commit 2cbc0619 authored by Cody A Burchett's avatar Cody A Burchett

-m

parent 67992c6c
......@@ -3,9 +3,15 @@ using System.Collections;
public class FlameCrab : MonoBehaviour {
//update once grid is ready
//array of positions to move to once grid is ready
//Vector3 [] positions;
public float moveDelay = 5f;
public float speed = 5f;
public float health = 10f;
public int moveDistance = 5;
float nextMove = 0f;
Vector3 targetLocation = -Vector3.up;
......@@ -22,7 +28,7 @@ public class FlameCrab : MonoBehaviour {
{
if (targetLocation != -Vector3.up)
{
if ((transform.position - targetLocation).sqrMagnitude > .15f)
if ((transform.position - targetLocation).sqrMagnitude > .5f)
{
Move();
}
......@@ -35,7 +41,7 @@ public class FlameCrab : MonoBehaviour {
else
{
//find new target location to right or left of enemy
int spacesToMove = Random.Range(-5, 6);
int spacesToMove = Random.Range(-moveDistance, moveDistance+1);
RaycastHit2D hit = Physics2D.Raycast(transform.position, transform.right, spacesToMove, 1);
if (hit.collider)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment