Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GameDevWeek
Wintersemester 2018-2019
Unity
Suck It
Commits
119a4e85
Commit
119a4e85
authored
Mar 28, 2019
by
mthiele2
Browse files
Du bist schön, aber dafür kannst du nichts
parent
02a8d9e9
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Assets/_Game/Data/Player Data/Movement Data/Movement States.asset
View file @
119a4e85
...
...
@@ -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
...
...
Assets/_Game/Prefabs/Elemental Attacks/WaterAttack.prefab
View file @
119a4e85
...
...
@@ -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
}
...
...
Assets/_Game/
Scripts/Player/PlayerAttacks/Earth/PlayerEarthProjectile.cs
.meta
→
Assets/_Game/
Prefabs/Level_Elements/EarthDestroyable.prefab
.meta
View file @
119a4e85
fileFormatVersion: 2
guid:
2007383666d03dc4da582cfeb693f08a
Mono
Importer:
guid:
5b5951e593e0fc1419f6e0dbb2ba1682
Prefab
Importer:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/_Game/Scenes/Max-Level.unity
View file @
119a4e85
This diff is collapsed.
Click to expand it.
Assets/_Game/Scripts/Level Hazards/DestroyObjectByEarth.cs
View file @
119a4e85
...
...
@@ -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
);
...
...
Assets/_Game/Scripts/Player/MovementController.cs
View file @
119a4e85
...
...
@@ -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
)
...
...
Assets/_Game/Scripts/Player/PlayerAttacks/Earth/PlayerEarthAttack.cs
View file @
119a4e85
...
...
@@ -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
()
...
...
Assets/_Game/Scripts/Player/PlayerAttacks/Earth/PlayerEarthProjectile.cs
deleted
100644 → 0
View file @
02a8d9e9
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
()
{
}
}
Assets/_Game/Scripts/Player/PlayerAttacks/Player_FireAttack.cs
View file @
119a4e85
...
...
@@ -5,7 +5,7 @@ using System.Collections;
public
class
Player_FireAttack
:
MonoBehaviour
{
private
float
nextFire
;
public
float
C
ooldown
;
public
float
c
ooldown
;
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
;
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
()
{
...
...
Assets/_Game/Scripts/Player/PlayerAttacks/Water/PlayerWaterAttack.cs
View file @
119a4e85
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
;
}
}
}
Assets/_Game/Scripts/Player/PlayerInteract.cs
View file @
119a4e85
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(_
water
Attack.Attack())
//
{
//
state.ChangeCharges(-1);
//
onChargeChange.Raise();
//
}
//
break;
if
(
_
fire
Attack
.
Attack
())
{
state
.
ChangeCharges
(-
1
);
onChargeChange
.
Raise
();
}
break
;
case
InfusedElement
.
Water
:
print
(
"done"
);
if
(
_waterAttack
.
Attack
())
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment