Commit b75c40b0 authored by Jordan McKenney's avatar Jordan McKenney

Added files I was working on because i dont have a computer

parent ae59fabf
fileFormatVersion: 2
guid: b3b2f4d882443b4479197c16a3a047f9
timeCreated: 1477616236
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
public class FireballMove : MonoBehaviour {
public float speed;
private Rigidbody2D fireRB;
public int direction;
public Vector2 move;
// Use this for initialization
void Start () {
fireRB = GetComponent<Rigidbody2D> ();
/*
if (direction == 0)
move = new Vector2 (1,0);
if (direction == 1)
move = new Vector2 (0,1);
if (direction == 2)
move = new Vector2 (-1,0);
if (direction == 3)
move = new Vector2 (0,-1);
*/
}
// Update is called once per frame
void Update () {
fireRB.MovePosition((Vector2)transform.position + move*speed);
}
}
fileFormatVersion: 2
guid: b245668d1f70fae43ba9905676a8f688
timeCreated: 1477616043
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -4,8 +4,11 @@ using System.Collections;
public class HeroAttackController : MonoBehaviour {
enum ability {fireball, water, others };
public int direction;
public float speed;
private ability currentAbility = ability.fireball;
public GameObject FireballPrefab;
// Use this for initialization
void Start () {
......@@ -18,6 +21,10 @@ public class HeroAttackController : MonoBehaviour {
switch (currentAbility)
{
case ability.fireball:
GameObject clone = Instantiate (FireballPrefab, new Vector3 (0, 0, 0), Quaternion.identity) as GameObject;
clone.GetComponent<FireballMove> ().move = GetComponent<PlayerAnimation> ().lastInput;
clone.GetComponent<FireballMove> ().speed = speed;
Debug.Log("fireball");
break;
default:
......
......@@ -4,7 +4,7 @@ using System.Collections;
public class PlayerAnimation : MonoBehaviour {
private Animator animator;
private Vector2 lastInput = new Vector2(1, 1);
public Vector2 lastInput = new Vector2(1, 1);
private int horizontalDir = 1;
private HeroMobility hm;
......
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