Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Geomy
- {
- /**
- * ...
- * @author Erlend
- */
- /** moving object */
- public class Body
- {
- public var x:Number = 0;
- public var y:Number = 0;
- public var xSpeed:Number = 0;
- public var ySpeed:Number = 0;
- protected var _density:Number = 1;
- /** Calculates new mass. */
- public function set density(value:Number):void {
- _density = value;
- calculateMass();
- }
- public function get density():Number {
- return _density;
- }
- protected var _mass:Number = 0;
- /** Read only! */
- public function get mass():Number {
- return _mass;
- }
- public function Body():void
- {
- // ABSTRACT
- }
- public function setPosition(x:Number, y:Number):void
- {
- this.x = x;
- this.y = y;
- }
- protected function calculateMass():void
- {
- }
- /**
- * Returns true if it overlaps shape argument
- */
- public function solveCollision(shape:Shape):Boolean
- {
- return false;
- }
- public function setSpeed(xSpeed:Number, ySpeed:Number):void
- {
- this.xSpeed = xSpeed;
- this.ySpeed = ySpeed;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement