Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.drift
- {
- import flash.geom.Point;
- import flash.display.Sprite;
- public class Car extends Sprite
- {
- public var velocityX:Number = 0;//x velocity
- public var velocityY:Number = 0;//y velocity
- public var drag:Number = 0.9;//how fast the car slows down
- public var angle:Number = 1;//car's angle in radian
- public var angularVelocity:Number = 0; //speed the car is spinning, in radians
- public var angularDrag:Number = 0.9;//how fast the car stops spinning
- public var power:Number = 0.8; //how fast car can accelerate
- public var turnSpeed:Number = 0.02; //how fast to turn
- public function Car()
- {
- //simple car graphic
- this.graphics.beginFill(0x444444,1);
- this.graphics.drawRect(-(25/2),-20,25,40);
- this.graphics.beginFill(0x000000,1);
- this.graphics.drawRect(-(5/2),-8,5,5);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment