Commit b5a9331b authored by mthiele2's avatar mthiele2

You were my sun, you were my earth

But you didn't know all the ways I loved you, no
So you took a chance, made other plans
But I bet you didn't think that they would come crashing down, no
You don't have to say, what you did
I already know, I found out from him
Now there's just no chance
With you and me
There'll never be
Don't it make you sad about it?
You told me you love me
Why did you leave me all alone
Now you tell me you need me
When you call me on the phone
Girl, I refuse
You must have me confused with some other guy
The bridges were burned
Now it's your turn, to cry
Cry me a river
Cry me a river
Cry me a river
Cry me a river
parent 84b8570a
......@@ -49,11 +49,11 @@ MonoBehaviour:
mass: 1
gravity: 3
defaultMoveState:
jumpForce: 0
smoothing: 0
airControl: 0
canSwim: 0
moveSpeed: 0
maxJumpCount: 0
mass: 0
gravity: 0
jumpForce: 15
smoothing: 0.03
airControl: 1
canSwim: 1
moveSpeed: 30
maxJumpCount: 1
mass: 1
gravity: 3
This diff is collapsed.
......@@ -6,7 +6,7 @@ namespace _Game.Scripts.Player.PlayerAttacks.Earth
public class PlayerEarthAttack : MonoBehaviour
{
private float nextFire;
public float Cooldown;
public float cooldown;
public float massIncrease;
public bool isStomping;
MovementController controller;
......@@ -21,17 +21,39 @@ namespace _Game.Scripts.Player.PlayerAttacks.Earth
{
controller = GetComponentInParent<MovementController>();
contactFilter2D.SetLayerMask(whatIsDestroyable);
_ready = true;
_activated = false;
}
public bool Attack()
{
if (_ready)
{
_activated = true;
}
return _ready;
}
// Update is called once per frame
void Update()
{
if (Input.GetButtonDown("Fire1") && Time.time > nextFire && !controller.Grounded)
{
nextFire = Time.time + Cooldown;
_ready = Time.time > nextFire;
StartCoroutine(fire());
}
if (!_activated) return;
print("Fire_Attack");
nextFire = Time.time + cooldown;
StartCoroutine(fire());
_activated = false;
//if (Input.GetButtonDown("Fire1") && Time.time > nextFire && !controller.Grounded)
//{
// nextFire = Time.time + Cooldown;
// StartCoroutine(fire());
//}
}
IEnumerator fire()
......
......@@ -38,6 +38,13 @@ namespace _Game.Scripts.Player
_waterAttack = this.gameObject.GetComponent<PlayerWaterAttack>();
_controller = this.gameObject.GetComponent<MovementController>();
state.UpdateElement(InfusedElement.None);
_airAttack.enabled = false;
_earthAttack.enabled = false;
_fireAttack.enabled = false;
_waterAttack.enabled = false;
_controller.SetMovementParameters(state.GetCurrentMovementState());
}
private void Update()
......@@ -46,19 +53,19 @@ namespace _Game.Scripts.Player
{
switch (state.GetCurrentElement())
{
case InfusedElement.Air:
//case InfusedElement.Air:
// if(_waterAttack.Attack())
// {
// state.ChangeCharges(-1);
// onChargeChange.Raise();
// }
break;
//break;
case InfusedElement.Earth:
// if(_waterAttack.Attack())
// {
// state.ChangeCharges(-1);
// onChargeChange.Raise();
// }
if (_earthAttack.Attack())
{
state.ChangeCharges(-1);
onChargeChange.Raise();
}
break;
case InfusedElement.Fire:
if (_fireAttack.Attack())
......
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
......@@ -19,13 +19,13 @@ namespace _Game.Scripts.Scriptable_Object
[SerializeField][Range(0, 5)] private int charges;
// [SerializeField] private float currentJumpForce;
// [SerializeField] private float currentSmoothing;
// [SerializeField] private bool currentAirControl;
// [SerializeField] private float currentMoveSpeed;
// [SerializeField] private int currentMaxJumpCount;
// [SerializeField] private float currentMass;
// [SerializeField] private float currentGravity;
// [SerializeField] private float currentJumpForce;
// [SerializeField] private float currentSmoothing;
// [SerializeField] private bool currentAirControl;
// [SerializeField] private float currentMoveSpeed;
// [SerializeField] private int currentMaxJumpCount;
// [SerializeField] private float currentMass;
// [SerializeField] private float currentGravity;
public void UpdateElement(InfusedElement newElement)
{
......@@ -46,7 +46,7 @@ namespace _Game.Scripts.Scriptable_Object
} else if ((charges + amount) <= 0)
{
charges = 0;
currentInfusedElement = InfusedElement.None;
UpdateElement(InfusedElement.None);
}
else
{
......
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