Added finish upgraded level1 and added music
This commit is contained in:
@@ -16,6 +16,7 @@ public class CameraTracking : MonoBehaviour
|
||||
{
|
||||
Vector3 playpos = player.transform.position;
|
||||
playpos.z = playpos.z - 10;
|
||||
playpos.y = playpos.y + 3;
|
||||
transform.position = playpos;
|
||||
}
|
||||
}
|
||||
|
@@ -12,8 +12,6 @@ public class PlayerControls : MonoBehaviour
|
||||
public SpriteRenderer sprite;
|
||||
public PhysicsMaterial2D bottom;
|
||||
public CharacterController2D controller;
|
||||
public RigidbodyConstraints2D topx;
|
||||
public RigidbodyConstraints2D bottomx;
|
||||
public AudioSource sfx;
|
||||
public float runspeed = 40f;
|
||||
float horizonatalaxis = 0f;
|
||||
@@ -29,28 +27,34 @@ public class PlayerControls : MonoBehaviour
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
horizonatalaxis = Input.GetAxisRaw("Horizontal");
|
||||
jumping = Input.GetButton("Jump") || Input.GetAxisRaw("Vertical") > 0;
|
||||
animator.SetFloat("Horizontal_speed", horizonatalaxis);
|
||||
|
||||
if(Input.GetButtonDown("Switch")) {
|
||||
switchy = !switchy;
|
||||
if (switchy){
|
||||
sprite.flipY = true;
|
||||
rb.constraints = topx;
|
||||
rb.sharedMaterial = top;
|
||||
controller.m_JumpForce = controller.m_JumpForce * 1.2f;
|
||||
controller.m_JumpForce = controller.m_JumpForce * 1.6f;
|
||||
}
|
||||
else {
|
||||
sprite.flipY = false;
|
||||
rb.constraints = bottomx;
|
||||
rb.sharedMaterial = bottom;
|
||||
controller.m_JumpForce = controller.m_JumpForce * 0.8f;
|
||||
controller.m_JumpForce = controller.m_JumpForce / 1.6f;
|
||||
}
|
||||
sfx.clip = RotateSFX;
|
||||
sfx.Play();
|
||||
}
|
||||
Vector3 playpos = transform.position;
|
||||
playpos.z = 0f;
|
||||
transform.position = playpos;
|
||||
if (!switchy){
|
||||
horizonatalaxis = Input.GetAxisRaw("Horizontal");
|
||||
}
|
||||
else{
|
||||
horizonatalaxis = 0;
|
||||
}
|
||||
jumping = Input.GetButton("Jump") || Input.GetAxisRaw("Vertical") > 0;
|
||||
animator.SetFloat("Horizontal_speed", horizonatalaxis);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user