2 players 🤯
This commit is contained in:
1 parent
afcc84fa7e
commit
316a5d4eb4
2 files changed
+285
-3
No files matched your search
@@ -119,6 +119,125 @@ NavMeshSettings:
|
|||||||
debug:
|
debug:
|
||||||
m_Flags: 0
|
m_Flags: 0
|
||||||
m_NavMeshData: {fileID: 0}
|
m_NavMeshData: {fileID: 0}
|
||||||
|
--- !u!1 &28161217
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 28161220}
|
||||||
|
- component: {fileID: 28161219}
|
||||||
|
- component: {fileID: 28161218}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Bird2
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!50 &28161218
|
||||||
|
Rigidbody2D:
|
||||||
|
serializedVersion: 5
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 28161217}
|
||||||
|
m_BodyType: 0
|
||||||
|
m_Simulated: 1
|
||||||
|
m_UseFullKinematicContacts: 0
|
||||||
|
m_UseAutoMass: 0
|
||||||
|
m_Mass: 3.5
|
||||||
|
m_LinearDamping: 3.5
|
||||||
|
m_AngularDamping: 0
|
||||||
|
m_GravityScale: 0
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IncludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_ExcludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_Interpolate: 0
|
||||||
|
m_SleepingMode: 1
|
||||||
|
m_CollisionDetection: 0
|
||||||
|
m_Constraints: 0
|
||||||
|
--- !u!212 &28161219
|
||||||
|
SpriteRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 28161217}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_CastShadows: 0
|
||||||
|
m_ReceiveShadows: 0
|
||||||
|
m_DynamicOccludee: 1
|
||||||
|
m_StaticShadowCaster: 0
|
||||||
|
m_MotionVectors: 1
|
||||||
|
m_LightProbeUsage: 1
|
||||||
|
m_ReflectionProbeUsage: 1
|
||||||
|
m_RayTracingMode: 0
|
||||||
|
m_RayTraceProcedural: 0
|
||||||
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
|
m_RenderingLayerMask: 1
|
||||||
|
m_RendererPriority: 0
|
||||||
|
m_Materials:
|
||||||
|
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_StaticBatchInfo:
|
||||||
|
firstSubMesh: 0
|
||||||
|
subMeshCount: 0
|
||||||
|
m_StaticBatchRoot: {fileID: 0}
|
||||||
|
m_ProbeAnchor: {fileID: 0}
|
||||||
|
m_LightProbeVolumeOverride: {fileID: 0}
|
||||||
|
m_ScaleInLightmap: 1
|
||||||
|
m_ReceiveGI: 1
|
||||||
|
m_PreserveUVs: 0
|
||||||
|
m_IgnoreNormalsForChartDetection: 0
|
||||||
|
m_ImportantGI: 0
|
||||||
|
m_StitchLightmapSeams: 1
|
||||||
|
m_SelectedEditorRenderState: 0
|
||||||
|
m_MinimumChartSize: 4
|
||||||
|
m_AutoUVMaxDistance: 0.5
|
||||||
|
m_AutoUVMaxAngle: 89
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingLayer: 0
|
||||||
|
m_SortingOrder: 0
|
||||||
|
m_Sprite: {fileID: 21300000, guid: dbf71fe5f2caad1409da64bdbb781eb5, type: 3}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_FlipX: 0
|
||||||
|
m_FlipY: 0
|
||||||
|
m_DrawMode: 0
|
||||||
|
m_Size: {x: 1.28, y: 1.28}
|
||||||
|
m_AdaptiveModeThreshold: 0.5
|
||||||
|
m_SpriteTileMode: 0
|
||||||
|
m_WasSpriteAssigned: 1
|
||||||
|
m_MaskInteraction: 0
|
||||||
|
m_SpriteSortPoint: 0
|
||||||
|
--- !u!4 &28161220
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 28161217}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 3.64, y: -4.1359, z: 0}
|
||||||
|
m_LocalScale: {x: 1.35, y: 1.35, z: 1.35}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children:
|
||||||
|
- {fileID: 952789931}
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1 &34767204
|
--- !u!1 &34767204
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -2566,9 +2685,11 @@ MonoBehaviour:
|
|||||||
highScoreText: {fileID: 1606868532}
|
highScoreText: {fileID: 1606868532}
|
||||||
boostText: {fileID: 497996347}
|
boostText: {fileID: 497996347}
|
||||||
bird: {fileID: 808236448}
|
bird: {fileID: 808236448}
|
||||||
|
bird2: {fileID: 28161217}
|
||||||
pausePanel: {fileID: 302151016}
|
pausePanel: {fileID: 302151016}
|
||||||
statsPanel: {fileID: 1140906499}
|
statsPanel: {fileID: 1140906499}
|
||||||
rb: {fileID: 808236449}
|
rb: {fileID: 808236449}
|
||||||
|
rb2: {fileID: 28161218}
|
||||||
backgroundMusic: {fileID: 1625416039}
|
backgroundMusic: {fileID: 1625416039}
|
||||||
berryParent: {fileID: 157908646}
|
berryParent: {fileID: 157908646}
|
||||||
mobileButtons: {fileID: 872476494}
|
mobileButtons: {fileID: 872476494}
|
||||||
@@ -4491,6 +4612,110 @@ CanvasRenderer:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 927852285}
|
m_GameObject: {fileID: 927852285}
|
||||||
m_CullTransparentMesh: 1
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!1 &952789930
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 952789931}
|
||||||
|
- component: {fileID: 952789933}
|
||||||
|
- component: {fileID: 952789932}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Gun
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &952789931
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 952789930}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: -0.519, y: 0.315, z: 0}
|
||||||
|
m_LocalScale: {x: -2, y: 2, z: 2}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 28161220}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &952789932
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 952789930}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 99925664e1b4e403ea674c8646fcf842, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: Assembly-CSharp::GunHandler
|
||||||
|
bulletTemplate: {fileID: 1719498250}
|
||||||
|
--- !u!212 &952789933
|
||||||
|
SpriteRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 952789930}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_CastShadows: 0
|
||||||
|
m_ReceiveShadows: 0
|
||||||
|
m_DynamicOccludee: 1
|
||||||
|
m_StaticShadowCaster: 0
|
||||||
|
m_MotionVectors: 1
|
||||||
|
m_LightProbeUsage: 1
|
||||||
|
m_ReflectionProbeUsage: 1
|
||||||
|
m_RayTracingMode: 0
|
||||||
|
m_RayTraceProcedural: 0
|
||||||
|
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||||
|
m_RayTracingAccelStructBuildFlags: 1
|
||||||
|
m_SmallMeshCulling: 1
|
||||||
|
m_ForceMeshLod: -1
|
||||||
|
m_MeshLodSelectionBias: 0
|
||||||
|
m_RenderingLayerMask: 1
|
||||||
|
m_RendererPriority: 0
|
||||||
|
m_Materials:
|
||||||
|
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
||||||
|
m_StaticBatchInfo:
|
||||||
|
firstSubMesh: 0
|
||||||
|
subMeshCount: 0
|
||||||
|
m_StaticBatchRoot: {fileID: 0}
|
||||||
|
m_ProbeAnchor: {fileID: 0}
|
||||||
|
m_LightProbeVolumeOverride: {fileID: 0}
|
||||||
|
m_ScaleInLightmap: 1
|
||||||
|
m_ReceiveGI: 1
|
||||||
|
m_PreserveUVs: 0
|
||||||
|
m_IgnoreNormalsForChartDetection: 0
|
||||||
|
m_ImportantGI: 0
|
||||||
|
m_StitchLightmapSeams: 1
|
||||||
|
m_SelectedEditorRenderState: 0
|
||||||
|
m_MinimumChartSize: 4
|
||||||
|
m_AutoUVMaxDistance: 0.5
|
||||||
|
m_AutoUVMaxAngle: 89
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_GlobalIlluminationMeshLod: 0
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingLayer: 0
|
||||||
|
m_SortingOrder: 1
|
||||||
|
m_Sprite: {fileID: 21300000, guid: 23d93754de02c4faba5df580f9f61da0, type: 3}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_FlipX: 0
|
||||||
|
m_FlipY: 0
|
||||||
|
m_DrawMode: 0
|
||||||
|
m_Size: {x: 0.26, y: 0.18}
|
||||||
|
m_AdaptiveModeThreshold: 0.5
|
||||||
|
m_SpriteTileMode: 0
|
||||||
|
m_WasSpriteAssigned: 1
|
||||||
|
m_MaskInteraction: 0
|
||||||
|
m_SpriteSortPoint: 0
|
||||||
--- !u!1 &981975472
|
--- !u!1 &981975472
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -8442,6 +8667,7 @@ SceneRoots:
|
|||||||
- {fileID: 1931111989}
|
- {fileID: 1931111989}
|
||||||
- {fileID: 1625416040}
|
- {fileID: 1625416040}
|
||||||
- {fileID: 808236451}
|
- {fileID: 808236451}
|
||||||
|
- {fileID: 28161220}
|
||||||
- {fileID: 1811565639}
|
- {fileID: 1811565639}
|
||||||
- {fileID: 1035262213}
|
- {fileID: 1035262213}
|
||||||
- {fileID: 157908647}
|
- {fileID: 157908647}
|
||||||
|
|||||||
@@ -27,13 +27,16 @@ public class GamePlayer : MonoBehaviour
|
|||||||
private float antiLeft;
|
private float antiLeft;
|
||||||
private float screenWidth;
|
private float screenWidth;
|
||||||
internal bool isGrounded;
|
internal bool isGrounded;
|
||||||
|
internal bool isGrounded2;
|
||||||
public TMP_Text scoreText;
|
public TMP_Text scoreText;
|
||||||
public TMP_Text highScoreText;
|
public TMP_Text highScoreText;
|
||||||
public TMP_Text boostText;
|
public TMP_Text boostText;
|
||||||
public GameObject bird;
|
public GameObject bird;
|
||||||
|
public GameObject bird2;
|
||||||
public GameObject pausePanel;
|
public GameObject pausePanel;
|
||||||
public GameObject statsPanel;
|
public GameObject statsPanel;
|
||||||
public Rigidbody2D rb;
|
public Rigidbody2D rb;
|
||||||
|
public Rigidbody2D rb2;
|
||||||
public AudioSource backgroundMusic;
|
public AudioSource backgroundMusic;
|
||||||
public GameObject berryParent;
|
public GameObject berryParent;
|
||||||
|
|
||||||
@@ -73,7 +76,10 @@ public class GamePlayer : MonoBehaviour
|
|||||||
float baseSpeed = 0.18f * (screenWidth / 20.19257f);
|
float baseSpeed = 0.18f * (screenWidth / 20.19257f);
|
||||||
bool doMoveRight = false;
|
bool doMoveRight = false;
|
||||||
bool doMoveLeft = false;
|
bool doMoveLeft = false;
|
||||||
|
bool doMoveRight2 = false;
|
||||||
|
bool doMoveLeft2 = false;
|
||||||
bool doJump = false;
|
bool doJump = false;
|
||||||
|
bool doJump2 = false;
|
||||||
bool doRestart = false;
|
bool doRestart = false;
|
||||||
bool doBack = false;
|
bool doBack = false;
|
||||||
float movespeed = baseSpeed;
|
float movespeed = baseSpeed;
|
||||||
@@ -91,18 +97,30 @@ public class GamePlayer : MonoBehaviour
|
|||||||
bool controllerJump = Gamepad.current != null && (Gamepad.current.leftStick.up.isPressed || Gamepad.current.leftStick.down.isPressed || Gamepad.current.dpad.up.isPressed || Gamepad.current.dpad.down.isPressed || Gamepad.current.rightStick.up.isPressed || Gamepad.current.rightStick.down.isPressed);
|
bool controllerJump = Gamepad.current != null && (Gamepad.current.leftStick.up.isPressed || Gamepad.current.leftStick.down.isPressed || Gamepad.current.dpad.up.isPressed || Gamepad.current.dpad.down.isPressed || Gamepad.current.rightStick.up.isPressed || Gamepad.current.rightStick.down.isPressed);
|
||||||
if (!Application.isMobilePlatform)
|
if (!Application.isMobilePlatform)
|
||||||
{
|
{
|
||||||
if (controllerLeft || Keyboard.current.leftArrowKey.isPressed || Keyboard.current.aKey.isPressed || Keyboard.current.jKey.isPressed)
|
if (controllerLeft || Keyboard.current.aKey.isPressed)
|
||||||
{
|
{
|
||||||
doMoveLeft = true;
|
doMoveLeft = true;
|
||||||
}
|
}
|
||||||
if (controllerRight || Keyboard.current.rightArrowKey.isPressed || Keyboard.current.dKey.isPressed || Keyboard.current.lKey.isPressed)
|
if (controllerRight || Keyboard.current.dKey.isPressed)
|
||||||
{
|
{
|
||||||
doMoveRight = true;
|
doMoveRight = true;
|
||||||
}
|
}
|
||||||
if (controllerJump || Keyboard.current.spaceKey.isPressed || Keyboard.current.upArrowKey.isPressed || Keyboard.current.wKey.isPressed || Keyboard.current.downArrowKey.isPressed || Keyboard.current.sKey.isPressed || Keyboard.current.kKey.isPressed || Keyboard.current.iKey.isPressed || (Gamepad.current != null && Gamepad.current.buttonSouth.isPressed))
|
if (Keyboard.current.leftArrowKey.isPressed)
|
||||||
|
{
|
||||||
|
doMoveLeft2 = true;
|
||||||
|
}
|
||||||
|
if (Keyboard.current.rightArrowKey.isPressed)
|
||||||
|
{
|
||||||
|
doMoveRight2 = true;
|
||||||
|
}
|
||||||
|
if (Keyboard.current.wKey.isPressed)
|
||||||
{
|
{
|
||||||
doJump = true;
|
doJump = true;
|
||||||
}
|
}
|
||||||
|
if (Keyboard.current.upArrowKey.isPressed)
|
||||||
|
{
|
||||||
|
doJump2 = true;
|
||||||
|
}
|
||||||
if (Keyboard.current.rKey.isPressed)
|
if (Keyboard.current.rKey.isPressed)
|
||||||
{
|
{
|
||||||
doRestart = true;
|
doRestart = true;
|
||||||
@@ -133,6 +151,16 @@ public class GamePlayer : MonoBehaviour
|
|||||||
bird.transform.position += new UnityEngine.Vector3(movespeed, 0f, 0f);
|
bird.transform.position += new UnityEngine.Vector3(movespeed, 0f, 0f);
|
||||||
ClampPosition(bird);
|
ClampPosition(bird);
|
||||||
}
|
}
|
||||||
|
if (doMoveLeft2 && !doMoveRight2)
|
||||||
|
{
|
||||||
|
bird2.transform.position += new UnityEngine.Vector3(-movespeed, 0f, 0f);
|
||||||
|
ClampPosition(bird2);
|
||||||
|
}
|
||||||
|
if (doMoveRight2 && !doMoveLeft2)
|
||||||
|
{
|
||||||
|
bird2.transform.position += new UnityEngine.Vector3(movespeed, 0f, 0f);
|
||||||
|
ClampPosition(bird2);
|
||||||
|
}
|
||||||
if (doJump && isGrounded)
|
if (doJump && isGrounded)
|
||||||
{
|
{
|
||||||
AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Sounds/Jump"), Camera.main.transform.position, 0.75f * BazookaManager.Instance.GetSettingSFXVolume());
|
AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Sounds/Jump"), Camera.main.transform.position, 0.75f * BazookaManager.Instance.GetSettingSFXVolume());
|
||||||
@@ -149,6 +177,22 @@ public class GamePlayer : MonoBehaviour
|
|||||||
rb.linearVelocity = UnityEngine.Vector2.up * 9f;
|
rb.linearVelocity = UnityEngine.Vector2.up * 9f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (doJump2 && isGrounded2)
|
||||||
|
{
|
||||||
|
AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Sounds/Jump"), Camera.main.transform.position, 0.75f * BazookaManager.Instance.GetSettingSFXVolume());
|
||||||
|
if (boostLeft > 0f || speedyLeft > 0f)
|
||||||
|
{
|
||||||
|
rb2.linearVelocity = UnityEngine.Vector2.up * 12f;
|
||||||
|
}
|
||||||
|
else if (slownessLeft > 0f)
|
||||||
|
{
|
||||||
|
rb2.linearVelocity = UnityEngine.Vector2.up * 6f;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rb2.linearVelocity = UnityEngine.Vector2.up * 9f;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (doBack)
|
if (doBack)
|
||||||
{
|
{
|
||||||
TogglePause();
|
TogglePause();
|
||||||
@@ -304,6 +348,7 @@ public class GamePlayer : MonoBehaviour
|
|||||||
{
|
{
|
||||||
screenWidth = Camera.main.orthographicSize * 2f * Camera.main.aspect;
|
screenWidth = Camera.main.orthographicSize * 2f * Camera.main.aspect;
|
||||||
ClampPosition(bird);
|
ClampPosition(bird);
|
||||||
|
ClampPosition(bird2);
|
||||||
GameObject[] allberries = GameObject.FindGameObjectsWithTag("NormalBerry")
|
GameObject[] allberries = GameObject.FindGameObjectsWithTag("NormalBerry")
|
||||||
.Concat(GameObject.FindGameObjectsWithTag("PoisonBerry"))
|
.Concat(GameObject.FindGameObjectsWithTag("PoisonBerry"))
|
||||||
.Concat(GameObject.FindGameObjectsWithTag("SlowBerry"))
|
.Concat(GameObject.FindGameObjectsWithTag("SlowBerry"))
|
||||||
@@ -598,8 +643,11 @@ public class GamePlayer : MonoBehaviour
|
|||||||
void Respawn()
|
void Respawn()
|
||||||
{
|
{
|
||||||
bird.transform.position = new UnityEngine.Vector3(0f, -4.3f, 0f);
|
bird.transform.position = new UnityEngine.Vector3(0f, -4.3f, 0f);
|
||||||
|
bird2.transform.position = new UnityEngine.Vector3(0f, -4.3f, 0f);
|
||||||
rb.gravityScale = 0f;
|
rb.gravityScale = 0f;
|
||||||
rb.linearVelocity = UnityEngine.Vector2.zero;
|
rb.linearVelocity = UnityEngine.Vector2.zero;
|
||||||
|
rb2.gravityScale = 0f;
|
||||||
|
rb2.linearVelocity = UnityEngine.Vector2.zero;
|
||||||
score = 0;
|
score = 0;
|
||||||
boostLeft = 0f;
|
boostLeft = 0f;
|
||||||
slownessLeft = 0f;
|
slownessLeft = 0f;
|
||||||
@@ -659,6 +707,14 @@ public class GamePlayer : MonoBehaviour
|
|||||||
bird.transform.position = new UnityEngine.Vector2(bird.transform.position.x, -4.1359f);
|
bird.transform.position = new UnityEngine.Vector2(bird.transform.position.x, -4.1359f);
|
||||||
rb.linearVelocity = new UnityEngine.Vector2(rb.linearVelocity.x, 0f);
|
rb.linearVelocity = new UnityEngine.Vector2(rb.linearVelocity.x, 0f);
|
||||||
}
|
}
|
||||||
|
isGrounded2 = bird2.transform.position.y <= -4.1299996f;
|
||||||
|
rb2.gravityScale = isGrounded2 ? 0f : 1.5f;
|
||||||
|
|
||||||
|
if (bird2.transform.position.y < -4.1359f)
|
||||||
|
{
|
||||||
|
bird2.transform.position = new UnityEngine.Vector2(bird2.transform.position.x, -4.1359f);
|
||||||
|
rb2.linearVelocity = new UnityEngine.Vector2(rb2.linearVelocity.x, 0f);
|
||||||
|
}
|
||||||
if (Application.isMobilePlatform) jumpButton.transform.GetChild(0).GetComponent<TMP_Text>().color = isGrounded ? Color.white : Color.red;
|
if (Application.isMobilePlatform) jumpButton.transform.GetChild(0).GetComponent<TMP_Text>().color = isGrounded ? Color.white : Color.red;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user