Browse Source

changes from Gumbo playtest

master
Josh 2 years ago
parent
commit
1c3f0b93ac
  1. 2
      unity/Assets/Prefabs/Bird.prefab
  2. 2
      unity/Assets/Scripts/Bird.cs
  3. 9
      unity/Assets/Scripts/Fireball.cs

2
unity/Assets/Prefabs/Bird.prefab

@ -28,7 +28,7 @@ Transform:
m_GameObject: {fileID: 8800180563921210508}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1137.7001, y: 597.95557, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalScale: {x: -1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0

2
unity/Assets/Scripts/Bird.cs

@ -4,7 +4,7 @@ using UnityEngine;
public class Bird : MonoBehaviour
{
const float horizontalSpeed = 200f;
const float horizontalSpeed = 100f;
const float verticalSpeed = 5f;
const float amplitude = 30f;

9
unity/Assets/Scripts/Fireball.cs

@ -7,7 +7,9 @@ public class Fireball : MonoBehaviour
{
DragonMovement.AttackType _attackType = DragonMovement.AttackType.FIREBALL;
float _lifeSpan = 0f;
GameObject _follow = null;
public DragonMovement.AttackType AttackType { get => _attackType; set => _attackType = value; }
public GameObject Follow { get => _follow; set => _follow = value; }
// Start is called before the first frame update
void Start()
@ -18,6 +20,11 @@ public class Fireball : MonoBehaviour
// Update is called once per frame
void Update()
{
if (_follow != null)
{
this.transform.position = _follow.transform.position;
}
_lifeSpan += Time.deltaTime;
float speed = 1000f; //fireball
if (_attackType == DragonMovement.AttackType.CONE)
@ -34,7 +41,7 @@ public class Fireball : MonoBehaviour
transform.position = new Vector3(transform.position.x + speed * Time.deltaTime, transform.position.y, transform.position.z);
if (_lifeSpan >= 0.8f)
if (_lifeSpan >= 1.8f)
{
GameObject.Destroy(this.gameObject);
}

Loading…
Cancel
Save