Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Suck It
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GameDevWeek
W
Wintersemester 2018-2019
Unity
Suck It
Commits
119a4e85
Commit
119a4e85
authored
Mar 28, 2019
by
mthiele2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Du bist schön, aber dafür kannst du nichts
parent
02a8d9e9
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
436 additions
and
144 deletions
+436
-144
Assets/_Game/Data/Player Data/Movement Data/Movement States.asset
...Game/Data/Player Data/Movement Data/Movement States.asset
+33
-28
Assets/_Game/Prefabs/Elemental Attacks/WaterAttack.prefab
Assets/_Game/Prefabs/Elemental Attacks/WaterAttack.prefab
+2
-2
Assets/_Game/Prefabs/Level_Elements/EarthDestroyable.prefab.meta
..._Game/Prefabs/Level_Elements/EarthDestroyable.prefab.meta
+7
-0
Assets/_Game/Scenes/Max-Level.unity
Assets/_Game/Scenes/Max-Level.unity
+348
-76
Assets/_Game/Scripts/Level Hazards/DestroyObjectByEarth.cs
Assets/_Game/Scripts/Level Hazards/DestroyObjectByEarth.cs
+1
-0
Assets/_Game/Scripts/Player/MovementController.cs
Assets/_Game/Scripts/Player/MovementController.cs
+5
-4
Assets/_Game/Scripts/Player/PlayerAttacks/Earth/PlayerEarthAttack.cs
...e/Scripts/Player/PlayerAttacks/Earth/PlayerEarthAttack.cs
+2
-0
Assets/_Game/Scripts/Player/PlayerAttacks/Earth/PlayerEarthProjectile.cs
...ripts/Player/PlayerAttacks/Earth/PlayerEarthProjectile.cs
+0
-18
Assets/_Game/Scripts/Player/PlayerAttacks/Player_FireAttack.cs
...s/_Game/Scripts/Player/PlayerAttacks/Player_FireAttack.cs
+28
-6
Assets/_Game/Scripts/Player/PlayerAttacks/Water/PlayerWaterAttack.cs
...e/Scripts/Player/PlayerAttacks/Water/PlayerWaterAttack.cs
+3
-3
Assets/_Game/Scripts/Player/PlayerInteract.cs
Assets/_Game/Scripts/Player/PlayerInteract.cs
+7
-7
No files found.
Assets/_Game/Data/Player Data/Movement Data/Movement States.asset
View file @
119a4e85
...
@@ -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
...
...
Assets/_Game/Prefabs/Elemental Attacks/WaterAttack.prefab
View file @
119a4e85
...
@@ -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
}
...
...
Assets/_Game/
Scripts/Player/PlayerAttacks/Earth/PlayerEarthProjectile.cs
.meta
→
Assets/_Game/
Prefabs/Level_Elements/EarthDestroyable.prefab
.meta
View file @
119a4e85
fileFormatVersion: 2
fileFormatVersion: 2
guid:
2007383666d03dc4da582cfeb693f08a
guid:
5b5951e593e0fc1419f6e0dbb2ba1682
Mono
Importer:
Prefab
Importer:
externalObjects: {}
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
userData:
assetBundleName:
assetBundleName:
assetBundleVariant:
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
...
@@ -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
);
...
...
Assets/_Game/Scripts/Player/MovementController.cs
View file @
119a4e85
...
@@ -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
)
...
...
Assets/_Game/Scripts/Player/PlayerAttacks/Earth/PlayerEarthAttack.cs
View file @
119a4e85
...
@@ -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
()
...
...
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;
...
@@ -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
C
ooldown
;
public
float
c
ooldown
;
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
;
if
(!
_activated
)
return
;
print
(
"Fire_Attack"
);
nextFire
=
Time
.
time
+
cooldown
;
StartCoroutine
(
fire
());
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
()
{
{
...
...
Assets/_Game/Scripts/Player/PlayerAttacks/Water/PlayerWaterAttack.cs
View file @
119a4e85
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
;
}
}
}
}
}
}
Assets/_Game/Scripts/Player/PlayerInteract.cs
View file @
119a4e85
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(_water
Attack.Attack())
if
(
_fire
Attack
.
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
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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