Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class PlayerScript : MovementClass
- {
- // Use this for initialization
- public override void Start()
- {
- base.Start();
- //spawnPos = thisTransform.position;
- }
- // Update is called once per frame
- public void Update()
- {
- // these are false unless one of keys is pressed
- isLeft = false;
- isRight = false;
- isJump = false;
- movingDir = moving.None;
- // keyboard input
- if (Input.GetButton("Left"))
- {
- isLeft = true;
- facingDir = facing.Left;
- }
- if (Input.GetButton("Right") && isLeft == false)
- {
- isRight = true;
- facingDir = facing.Right;
- }
- if (Input.GetButtonDown("Fire1"))
- {
- isJump = true;
- }
- UpdateMovement();
- }
- void OnTriggerEnter(Collider other)
- {
- }
- public void Respawn()
- {
- if (alive == true)
- {
- thisTransform.position = spawnPos;
- rayDistUp = 0.375f;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement