Advertisement
Guest User

Untitled

a guest
Apr 13th, 2013
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class PlayerScript : MovementClass
  5. {
  6. // Use this for initialization
  7. public override void Start()
  8. {
  9. base.Start();
  10.  
  11. //spawnPos = thisTransform.position;
  12. }
  13.  
  14. // Update is called once per frame
  15. public void Update()
  16. {
  17. // these are false unless one of keys is pressed
  18. isLeft = false;
  19. isRight = false;
  20. isJump = false;
  21.  
  22. movingDir = moving.None;
  23.  
  24. // keyboard input
  25. if (Input.GetButton("Left"))
  26. {
  27. isLeft = true;
  28. facingDir = facing.Left;
  29. }
  30. if (Input.GetButton("Right") && isLeft == false)
  31. {
  32. isRight = true;
  33. facingDir = facing.Right;
  34. }
  35.  
  36. if (Input.GetButtonDown("Fire1"))
  37. {
  38. isJump = true;
  39. }
  40.  
  41. UpdateMovement();
  42. }
  43.  
  44. void OnTriggerEnter(Collider other)
  45. {
  46. }
  47.  
  48. public void Respawn()
  49. {
  50. if (alive == true)
  51. {
  52. thisTransform.position = spawnPos;
  53. rayDistUp = 0.375f;
  54. }
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement