Commit 119a4e85 authored by mthiele2's avatar mthiele2

Du bist schön, aber dafür kannst du nichts

parent 02a8d9e9
...@@ -13,41 +13,46 @@ MonoBehaviour: ...@@ -13,41 +13,46 @@ MonoBehaviour:
m_Name: Movement States m_Name: Movement States
m_EditorClassIdentifier: Assembly-CSharp:_Game.Scripts.Scriptable_Object:MovementStates m_EditorClassIdentifier: Assembly-CSharp:_Game.Scripts.Scriptable_Object:MovementStates
airMoveState: airMoveState:
jumpForce: 0 jumpForce: 5
smoothing: 0 smoothing: 0.03
airControl: 0 airControl: 1
moveSpeed: 0 canSwim: 1
maxJumpCount: 0 moveSpeed: 30
mass: 0 maxJumpCount: 5
gravity: 0 mass: 0.1
gravity: 0.5
earthMoveState: earthMoveState:
jumpForce: 0 jumpForce: 10
smoothing: 0 smoothing: 0.03
airControl: 0 airControl: 1
moveSpeed: 0 canSwim: 0
maxJumpCount: 0 moveSpeed: 15
mass: 0 maxJumpCount: 1
gravity: 0 mass: 20
gravity: 3
fireMoveState: fireMoveState:
jumpForce: 0 jumpForce: 15
smoothing: 0 smoothing: 0.03
airControl: 0 airControl: 1
moveSpeed: 0 canSwim: 1
maxJumpCount: 0 moveSpeed: 20
mass: 0 maxJumpCount: 2
gravity: 0 mass: 1
gravity: 3
waterMoveState: waterMoveState:
jumpForce: 0 jumpForce: 10
smoothing: 0 smoothing: 0.03
airControl: 0 airControl: 1
moveSpeed: 0 canSwim: 1
maxJumpCount: 0 moveSpeed: 20
mass: 0 maxJumpCount: 1
gravity: 0 mass: 1
gravity: 3
defaultMoveState: defaultMoveState:
jumpForce: 0 jumpForce: 0
smoothing: 0 smoothing: 0
airControl: 0 airControl: 0
canSwim: 0
moveSpeed: 0 moveSpeed: 0
maxJumpCount: 0 maxJumpCount: 0
mass: 0 mass: 0
......
...@@ -68,8 +68,8 @@ SpriteRenderer: ...@@ -68,8 +68,8 @@ SpriteRenderer:
m_AutoUVMaxDistance: 0.5 m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89 m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0} m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0 m_SortingLayerID: 1206248169
m_SortingLayer: 0 m_SortingLayer: 3
m_SortingOrder: 0 m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 8b8155e0c48fa0c479794a7820e522b9, type: 3} m_Sprite: {fileID: 21300000, guid: 8b8155e0c48fa0c479794a7820e522b9, type: 3}
m_Color: {r: 0.16932298, g: 0.1273585, b: 1, a: 1} m_Color: {r: 0.16932298, g: 0.1273585, b: 1, a: 1}
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: 2007383666d03dc4da582cfeb693f08a guid: 5b5951e593e0fc1419f6e0dbb2ba1682
MonoImporter: PrefabImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:
This diff is collapsed.
...@@ -7,6 +7,7 @@ public class DestroyObjectByEarth : MonoBehaviour ...@@ -7,6 +7,7 @@ public class DestroyObjectByEarth : MonoBehaviour
{ {
void OnCollisionEnter2D(Collision2D other) void OnCollisionEnter2D(Collision2D other)
{ {
if (!other.gameObject.CompareTag("Player")) return;
if (other.gameObject.GetComponent<PlayerEarthAttack>().isStomping) if (other.gameObject.GetComponent<PlayerEarthAttack>().isStomping)
{ {
Destroy(gameObject); Destroy(gameObject);
......
...@@ -110,6 +110,7 @@ public class MovementController : MonoBehaviour ...@@ -110,6 +110,7 @@ public class MovementController : MonoBehaviour
public void Move(Vector2 move, bool jump) public void Move(Vector2 move, bool jump)
{ {
Debug.Log("grounded: " + m_Grounded + " aircontrol: " + m_AirControl);
//only control the player if grounded or airControl is turned on //only control the player if grounded or airControl is turned on
if (m_Grounded || (m_AirControl && (m_Airborn && !m_Grounded)) || (m_Swimming && m_CanSwim)) if (m_Grounded || (m_AirControl && (m_Airborn && !m_Grounded)) || (m_Swimming && m_CanSwim))
{ {
...@@ -153,10 +154,10 @@ public class MovementController : MonoBehaviour ...@@ -153,10 +154,10 @@ public class MovementController : MonoBehaviour
{ {
m_Rigidbody2D.velocity += Vector2.up * Physics2D.gravity.y * (m_fallMultiplier - 1) * Time.deltaTime; m_Rigidbody2D.velocity += Vector2.up * Physics2D.gravity.y * (m_fallMultiplier - 1) * Time.deltaTime;
} }
else if (m_Rigidbody2D.velocity.y > 0 && !Input.GetButton("Jump")) //else if (m_Rigidbody2D.velocity.y > 0 && !Input.GetButton("Jump"))
{ //{
m_Rigidbody2D.velocity += Vector2.up * Physics2D.gravity.y * (m_lowJumpMultiplier - 1) * Time.deltaTime; // m_Rigidbody2D.velocity += Vector2.up * Physics2D.gravity.y * (m_lowJumpMultiplier - 1) * Time.deltaTime;
} //}
} }
public void SetSwimming(bool value) public void SetSwimming(bool value)
......
...@@ -13,6 +13,8 @@ namespace _Game.Scripts.Player.PlayerAttacks.Earth ...@@ -13,6 +13,8 @@ namespace _Game.Scripts.Player.PlayerAttacks.Earth
private RaycastHit2D[] RaycastHits2D = new RaycastHit2D[8]; private RaycastHit2D[] RaycastHits2D = new RaycastHit2D[8];
private LayerMask whatIsDestroyable; private LayerMask whatIsDestroyable;
private ContactFilter2D contactFilter2D; private ContactFilter2D contactFilter2D;
private bool _ready;
private bool _activated;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerEarthProjectile : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
...@@ -5,7 +5,7 @@ using System.Collections; ...@@ -5,7 +5,7 @@ using System.Collections;
public class Player_FireAttack : MonoBehaviour public class Player_FireAttack : MonoBehaviour
{ {
private float nextFire; private float nextFire;
public float Cooldown; public float cooldown;
public int volleySize; public int volleySize;
public float launchPower; public float launchPower;
public float attackSpeed; public float attackSpeed;
...@@ -14,23 +14,45 @@ public class Player_FireAttack : MonoBehaviour ...@@ -14,23 +14,45 @@ public class Player_FireAttack : MonoBehaviour
public GameObject fireBall; public GameObject fireBall;
private Rigidbody2D body; private Rigidbody2D body;
private bool _ready;
private bool _activated;
private void Start() private void Start()
{ {
nextFire = 0; nextFire = 0;
_ready = true;
_activated = false;
} }
private void Update() private void Update()
{ {
if (Input.GetButtonDown("Fire1") && Time.time > nextFire) _ready = Time.time > nextFire;
{
nextFire = Time.time + Cooldown;
StartCoroutine(fire()); if (!_activated) return;
}
print("Fire_Attack");
nextFire = Time.time + cooldown;
StartCoroutine(fire());
_activated = false;
//if (Input.GetButtonDown("Fire1") && Time.time > nextFire)
//{
// nextFire = Time.time + Cooldown;
// StartCoroutine(fire());
//}
} }
public bool Attack()
{
if (_ready)
{
_activated = true;
}
return _ready;
}
IEnumerator fire() IEnumerator fire()
{ {
......
using System.Collections; using System.Collections;
using UnityEngine; using UnityEngine;
namespace _Game.Scripts.Player.PlayerAttacks.Water namespace _Game.Scripts.Player.PlayerAttacks.Water
...@@ -36,6 +36,8 @@ namespace _Game.Scripts.Player.PlayerAttacks.Water ...@@ -36,6 +36,8 @@ namespace _Game.Scripts.Player.PlayerAttacks.Water
_nextFire = Time.time + cooldown; _nextFire = Time.time + cooldown;
StartCoroutine(Fire()); StartCoroutine(Fire());
_activated = false;
} }
public bool Attack() public bool Attack()
...@@ -64,8 +66,6 @@ namespace _Game.Scripts.Player.PlayerAttacks.Water ...@@ -64,8 +66,6 @@ namespace _Game.Scripts.Player.PlayerAttacks.Water
projectile.GetComponent<Rigidbody2D>().velocity = direction * launchPower; projectile.GetComponent<Rigidbody2D>().velocity = direction * launchPower;
yield return new WaitForSeconds(attackSpeed); yield return new WaitForSeconds(attackSpeed);
} }
_activated = false;
} }
} }
} }
using System; using System;
using UnityEngine; using UnityEngine;
using _Game.Scripts.Elements; using _Game.Scripts.Elements;
using _Game.Scripts.Player.PlayerAttacks.Air; using _Game.Scripts.Player.PlayerAttacks.Air;
...@@ -61,12 +61,12 @@ namespace _Game.Scripts.Player ...@@ -61,12 +61,12 @@ namespace _Game.Scripts.Player
// } // }
break; break;
case InfusedElement.Fire: case InfusedElement.Fire:
// if(_waterAttack.Attack()) if (_fireAttack.Attack())
// { {
// state.ChangeCharges(-1); state.ChangeCharges(-1);
// onChargeChange.Raise(); onChargeChange.Raise();
// } }
// break; break;
case InfusedElement.Water: case InfusedElement.Water:
print("done"); print("done");
if(_waterAttack.Attack()) if(_waterAttack.Attack())
......
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