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