Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
gstuitje
RingMaster
Commits
bbf0b1a0
Commit
bbf0b1a0
authored
Feb 06, 2019
by
mmaluschnig
Browse files
added trampoline to trapeze
parent
7b2678b1
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
RingMaster/RingMaster/.vs/RingMaster/xs/UserPrefs.xml
View file @
bbf0b1a0
<Properties
StartupConfiguration=
"{67A4F128-F6AC-CD88-DA35-F29416A0792A}|"
>
<MonoDevelop.Ide.ItemProperties.Assembly-CSharp
PreferredExecutionTarget=
"Unity.Editor"
/>
<MonoDevelop.Ide.Workbench
ActiveDocument=
"Assets/Scripts/MimeScripts/TriggerManager.cs"
>
<Files>
<File
FileName=
"Assets/Scripts/DaytimeScripts/DaytimeManager.cs"
Line=
"1"
Column=
"1"
/>
<File
FileName=
"Assets/Scripts/MimeScripts/SpawnKeys.cs"
Line=
"1"
Column=
"1"
/>
<File
FileName=
"Assets/Scripts/DaytimeScripts/CharacterInteractions.cs"
Line=
"68"
Column=
"116"
/>
<File
FileName=
"Assets/Scripts/DaytimeScripts/TentInteractoins.cs"
Line=
"28"
Column=
"112"
/>
<File
FileName=
"Assets/Scripts/TrapezeScripts/TrapezePerson.cs"
Line=
"45"
Column=
"75"
/>
<File
FileName=
"Assets/Scripts/MimeScripts/TriggerManager.cs"
Line=
"45"
Column=
"78"
/>
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.Workspace
ActiveConfiguration=
"Debug"
/>
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore
/>
</MonoDevelop.Ide.DebuggingService.Breakpoints>
<MonoDevelop.Ide.DebuggingService.PinnedWatches
/>
<MultiItemStartupConfigurations
/>
</Properties>
\ No newline at end of file
<Properties
/>
\ No newline at end of file
RingMaster/RingMaster/Assets/Materials/SideWall.physicsMaterial2D
0 → 100644
View file @
bbf0b1a0
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!62
&6200000
PhysicsMaterial2D
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
0
}
m_Name
:
SideWall
friction
:
0.4
bounciness
:
0.2
RingMaster/RingMaster/Assets/Materials/SideWall.physicsMaterial2D.meta
0 → 100644
View file @
bbf0b1a0
fileFormatVersion: 2
guid: acf94433b30574f1d9936ac17a1caef8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 6200000
userData:
assetBundleName:
assetBundleVariant:
RingMaster/RingMaster/Assets/Materials/Trampoline.physicsMaterial2D
0 → 100644
View file @
bbf0b1a0
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!62
&6200000
PhysicsMaterial2D
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
0
}
m_Name
:
Trampoline
friction
:
0
bounciness
:
1.1
RingMaster/RingMaster/Assets/Materials/Trampoline.physicsMaterial2D.meta
0 → 100644
View file @
bbf0b1a0
fileFormatVersion: 2
guid: d39771301f92041ce86aa918e7055b9e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 6200000
userData:
assetBundleName:
assetBundleVariant:
RingMaster/RingMaster/Assets/Scenes/Trapeze.unity
View file @
bbf0b1a0
This diff is collapsed.
Click to expand it.
RingMaster/RingMaster/Assets/Scripts/TrapezeScripts/FollowPlayerx.cs
0 → 100644
View file @
bbf0b1a0
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
FollowPlayerx
:
MonoBehaviour
{
private
GameObject
player
;
// Use this for initialization
void
Start
()
{
player
=
GameObject
.
FindWithTag
(
"Player"
);
}
// Update is called once per frame
void
Update
()
{
Vector3
newPos
=
transform
.
position
;
newPos
.
x
=
player
.
transform
.
position
.
x
;
transform
.
position
=
newPos
;
}
void
OnCollisionEnter
(
Collision
collision
)
{
player
.
GetComponent
<
Rigidbody2D
>().
angularVelocity
=
0
;
print
(
"Tramp"
);
}
}
RingMaster/RingMaster/Assets/Scripts/TrapezeScripts/FollowPlayerx.cs.meta
0 → 100644
View file @
bbf0b1a0
fileFormatVersion: 2
guid: 00eca143d98b34078819fb52dca7f491
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
RingMaster/RingMaster/Assets/Scripts/TrapezeScripts/GenerateTrapezes.cs
View file @
bbf0b1a0
...
...
@@ -74,7 +74,7 @@ public class GenerateTrapezes : MonoBehaviour {
private
void
ScalingTrapezeGeneration
()
{
//Scaling trapeze Generation
print
(
numTrapezes
/
3
);
//
print(numTrapezes / 3);
float
progression
=
(
numTrapezes
/
3
)
/
(
float
)
maxDificulty
;
if
(
progression
>
1
)
progression
=
1
;
...
...
@@ -102,7 +102,7 @@ public class GenerateTrapezes : MonoBehaviour {
//apply scaling
newTrapeze
.
x
+=
XScaler
;
newTrapeze
.
y
+=
YScaler
;
print
(
"X "
+
XScaler
+
"Y "
+
YScaler
);
//
print("X " + XScaler + "Y " + YScaler);
currentTrapezeInLevel
[
i
]
=
Instantiate
(
trapeze
,
newTrapeze
,
Quaternion
.
identity
).
transform
;
numTrapezes
++;
}
...
...
RingMaster/RingMaster/Assets/Scripts/TrapezeScripts/HandsTrigger.cs
View file @
bbf0b1a0
...
...
@@ -20,7 +20,7 @@ public class HandsTrigger : MonoBehaviour {
void
OnTriggerStay2D
(
Collider2D
collision
)
{
if
(
collision
.
gameObject
.
layer
==
LayerMask
.
NameToLayer
(
"Key"
))
{
print
(
"Collision "
+
collision
.
gameObject
.
name
);
//
print("Collision " + collision.gameObject.name);
if
(!
trapezePerson
.
onTrapeze
)
{
//possibly enable this trapeze after a second
if
(!
collision
.
gameObject
.
Equals
(
lastTrapeze
))
{
...
...
@@ -38,7 +38,7 @@ public class HandsTrigger : MonoBehaviour {
}
private
void
OnTriggerExit2D
(
Collider2D
collision
)
{
print
(
"Exit "
+
collision
.
gameObject
.
name
);
//
print("Exit " + collision.gameObject.name);
}
public
IEnumerator
reactivateTrapeze
()
{
...
...
RingMaster/RingMaster/Assets/Scripts/TrapezeScripts/TrapezePerson.cs
View file @
bbf0b1a0
...
...
@@ -35,14 +35,14 @@ public class TrapezePerson : MonoBehaviour {
// Update is called once per frame
void
Update
()
{
if
(
Input
.
GetKey
(
KeyCode
.
D
))
{
if
(
Input
.
GetKey
(
KeyCode
.
D
)
||
Input
.
GetKeyDown
(
KeyCode
.
RightArrow
)
)
{
if
(
onTrapeze
)
{
body
.
AddTorque
(
swingForce
/
10
);
}
else
{
transform
.
RotateAround
(
currentPivot
.
position
,
Vector3
.
forward
,
-
rotateForce
);
}
}
if
(
Input
.
GetKey
(
KeyCode
.
A
))
{
if
(
Input
.
GetKey
(
KeyCode
.
A
)
||
Input
.
GetKeyDown
(
KeyCode
.
LeftArrow
)
)
{
if
(
onTrapeze
)
{
body
.
AddTorque
(-
swingForce
/
10
);
}
else
{
...
...
@@ -67,6 +67,7 @@ public class TrapezePerson : MonoBehaviour {
//GetComponent<CapsuleCollider2D>().enabled = true;
currentTrapeze
=
trapeze
;
Time
.
timeScale
=
1
;
body
.
freezeRotation
=
false
;
}
public
void
DetachFromTrapeze
()
{
...
...
@@ -77,5 +78,6 @@ public class TrapezePerson : MonoBehaviour {
//Time.timeScale = 0.5f;
body
.
angularVelocity
=
0
;
StartCoroutine
(
handsTrigger
.
reactivateTrapeze
());
body
.
freezeRotation
=
true
;
}
}
Write
Preview
Supports
Markdown
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