Skip to content
Browse files

level completion works.

  • Loading branch information...
1 parent 316999a commit 87d95100c3e8fa4b7591f71691c9d20873ddaf01 @tamagokun committed May 8, 2012
Showing with 11 additions and 3 deletions.
  1. +2 −0 app/PlayState.as
  2. +8 −2 app/elements/Kong.as
  3. +1 −1 app/levels/Level1.as
View
2 app/PlayState.as
@@ -112,6 +112,8 @@ package
if(level.completed())
{
//stop game.
+ barrels.clear();
+ dk.stop();
//go to next!
}
View
10 app/elements/Kong.as
@@ -5,6 +5,7 @@ package elements
public class Kong extends FlxSprite
{
private var _parent:PlayState;
+ private var barrel_timer:FlxTimer;
[Embed(source="../../assets/kong.gif")] private var ImgKong:Class;
@@ -18,12 +19,17 @@ package elements
addAnimation("throw_left",[8,8],4,false);
addAnimation("throw_right",[9,9],4,false);
- var barrel_timer:FlxTimer = new FlxTimer();
+ barrel_timer = new FlxTimer();
barrel_timer.start(4,0,dk_throw);
play("standing");
}
-
+
+ public function stop():void
+ {
+ barrel_timer.stop();
+ }
+
public function dk_throw(Timer:FlxTimer):void
{
play(facing == LEFT? "throw_left" : "throw_right");
View
2 app/levels/Level1.as
@@ -63,7 +63,7 @@ package levels
override public function completed():Boolean
{
- return (state.mikey.x <= 144 && state.mikey.x >= 136 && state.mikey.y < 48);
+ return (state.mikey.x <= 144 && state.mikey.x >= 130 && state.mikey.y <= 48);
}
public function create_row(X:uint,Y:uint,count:uint):void

0 comments on commit 87d9510

Please sign in to comment.
Something went wrong with that request. Please try again.