Added Powerup Logic

main
thoopchuk26 4 years ago
parent cbd91fdea8
commit b5324f8a4d

@ -132,6 +132,31 @@ public class GameManager : MonoBehaviour
}
}
}
private void doHealthupCheck()
{
if (obtainedPowerups.Contains(Powerup.HealthUp))
{
player.GetComponent<Health>().maxHealth = 150;
}
}
private void doDoubleJumpCheck()
{
if (obtainedPowerups.Contains(Powerup.DoubleJump))
{
player.GetComponent<movement>().maxJumps = 2;
}
}
private void doShrinkButtonCheck()
{
if (obtainedPowerups.Contains(Powerup.Shrink))
{
}
}
public GameObject GetPlayer()
{
return player;

@ -0,0 +1,45 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Shrink : MonoBehaviour
{
private GameObject player;
private bool canShrink = false;
// Start is called before the first frame update
void Start()
{
player = GetComponent<GameObject>();
}
// Update is called once per frame
void Update()
{
if (true)
{
}
}
public void startShrinking()
{
if (canShrink)
{
for(int i = 0; i < 2; i++)
{
player.transform.localScale = new Vector3(player.transform.localScale.x*0.75f, player.transform.localScale.y*0.75f, player.transform.localScale.z);
}
}
}
public void startUnShrinking()
{
if (canShrink)
{
for (int i = 0; i < 2; i++)
{
player.transform.localScale = new Vector3(player.transform.localScale.x * (4/3), player.transform.localScale.y * (4 / 3), player.transform.localScale.z);
}
}
}
}

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 37e947767f230cb45b7cca13e4b4dbb3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -17,7 +17,7 @@ public class movement : MonoBehaviour
public float _MinAcc = -1.0f;
public float _Deceleration = 2f;
public float jumpForce = 350;
private float maxJumps = 1;
public float maxJumps = 1;
private float numJumps;
private bool isGrounded = true;

Loading…
Cancel
Save