Commits

Jake Albano committed 829a034

Increased hop speed in opening cutscene;

  • Participants
  • Parent commits 714c3f5

Comments (0)

Files changed (1)

src/com/jacobalbano/ludumdare23/Spinky.as

 		private var hopping:Boolean;
 		private var hopDirection:int;
 		private var lastPosition:Point;
+		private var baseLevel:Number;
 		
 		private var sineTicks:Number;
 		
 		public function Spinky(x:Number, y:Number, pose:uint) 
 		{
 			super(x, y, sprites = new Spritemap(SPRITESHEET, 73, 65));
+			this.baseLevel = x;
 			
 			sprites.add("stand", [0]);
 			sprites.add("sad", [1]);
 		public function startHop(direction:int):void
 		{
 			this.hopping = true;
+			this.baseLevel = this.x;
 			this.hopDirection = direction;
 		}
 		
 		private function doHop():void
 		{
 			var test:Number = Math.sin(sineTicks += 0.1);
+			test *= 2.5;
 			
 			y += test;
 			
 		{
 			super.update();
 			
-			if (this.hopping)
+			if (this.hopping || Math.abs(this.x - this.baseLevel) > 5 )
 			{
 				this.doHop();
 			}