Advertisement
Guest User

public error

a guest
Jan 13th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Haxe 1.95 KB | None | 0 0
  1. package arm;
  2. import iron.system.Input;
  3. import iron.math.Vec4;
  4.  
  5. class Character extends iron.Trait {
  6.     public function new() {
  7.         super();
  8.  
  9.         notifyOnInit(function() {
  10.             //var//
  11.             var key = Input.getKeyboard();
  12.             var mo = Input.getMouse();
  13.             var cam = iron.Scene.active.getCamera("cam");
  14.  
  15.             //stuff
  16.             var playerViewOffset = 0.6; //The height at which the camera is bound to
  17.             var xMouseSensitivity = 30.0;
  18.             var yMouseSensitivity = 30.0;
  19.  
  20.             //frame occuring factor
  21.             var gravity = 20.0;
  22.             var friction = 6; //ground friction
  23.  
  24.             // Movement stuff//
  25.             var moveSpeed = 7.0; // Ground move speed
  26.             var runAcceleration = 14.0; // Ground accel
  27.             var runDeacceleration = 10.0; // Deacceleration that occurs when running on the ground
  28.             var airAcceleration = 2.0; // Air accel
  29.             var airDecceleration = 2.0; // Deacceleration experienced when ooposite strafing
  30.             var airControl = 0.3; // How precise air control is
  31.             var sideStrafeAcceleration = 50.0; // How fast acceleration occurs to get up to sideStrafeSpeed when
  32.             var sideStrafeSpeed = 1.0; // What the max speed to generate when side strafing
  33.             var jumpSpeed = 8.0; // The speed at which the character's up axis gains when hitting jump
  34.             var holdJumpBhop = false; // When enabled allows player to just hold jump button to keep on bhopping perfectly. Beware: smells like casual.
  35.  
  36.             //FPS stuff//
  37.             var fpsDisplayRate = 4.0;
  38.             var frameCount = 0;
  39.             var dt = 0.0;
  40.             var fps = 0.0;
  41.  
  42.             //cam rotation
  43.             var rotX = 0.0;
  44.             public var rotY = 0.0;
  45.  
  46.             var moveDirectionNorm = new Vec4();
  47.             var playerVelocity = new Vec4();
  48.             var playerTopVelocity = 0.0;
  49.  
  50.             // Q3: players can queue the next jump just before he hits the ground
  51.             var wishJump = false;
  52.             // Used to display real time fricton values
  53.             var playerFriction = 0.0;
  54.  
  55.             mo.hide();
  56.             mo.lock();
  57.  
  58.  
  59.  
  60.         });
  61.  
  62.         //notifyOnUpdate(function() {
  63.         //});
  64.  
  65.         // notifyOnRemove(function() {
  66.         // });
  67.     }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement