Commit 394f4636 authored by Luke A Smith's avatar Luke A Smith

Merge branch 'enemyHorizontal' into 'master'

enemy prefabs

See merge request !38
parents 2556993b 53ba17aa
......@@ -35,6 +35,9 @@ public class BaseEnemy : MonoBehaviour {
{
RaycastHit2D hitSide = Physics2D.Raycast(collisionPos, dir, .1f);
RaycastHit2D hitDown = Physics2D.Raycast(collisionPos, -transform.up, .1f);
Debug.DrawRay(collisionPos, dir, Color.red);
Debug.DrawRay(collisionPos, -transform.up, Color.green);
if (hitDown.collider != null && hitSide.collider == null)
{
return true;
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class VerticalEnemy : BaseEnemy {
public bool leftWall;
void Update()
{
//find collision direction and position of enemy
......
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