Skip to content

Commit

Permalink
updated for v2.50 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamAtomic committed Apr 27, 2011
1 parent 598883a commit 09fcbbf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
8 changes: 2 additions & 6 deletions src/Enemy.as
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,13 @@ package
public function Enemy()
{
super();
loadRotatedGraphic(ImgBot,64,0);
loadRotatedGraphic(ImgBot,64,0,false,true);

//We want the enemy's "hit box" or actual size to be
//smaller than the enemy graphic itself, just by a few pixels.
width = 12;
height = 12;

//Since the graphic is 16x16, and the hit box is 12x12,
//we want to scootch everything over by 2 pixels (16-12 = 4, 4/2 = 2).
offset.x = 2;
offset.y = 2;
centerOffsets();

//Here we are setting up the jet particles
// that shoot out the back of the ship.
Expand Down
19 changes: 13 additions & 6 deletions src/MenuState.as
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package
{
import flash.geom.Rectangle;
import flash.net.SharedObject;

import org.flixel.*;
import org.flixel.plugin.DebugPathDisplay;

public class MenuState extends FlxState
{
Expand Down Expand Up @@ -75,9 +77,10 @@ package
timer = 0;
attractMode = false;

/*silly path following test
pathFollower = new FlxSprite(-20,-20,ImgEnemy);
testPath = new FlxPath();
add(pathFollower);
add(pathFollower);//*/

FlxG.mouse.show(ImgCursor,2);
}
Expand All @@ -89,17 +92,21 @@ package
playButton = null;
title1 = null;
title2 = null;

/*silly path following test
testPath.destroy();//*/
}

override public function update():void
{
/*silly path following test code
if(FlxG.mouse.justPressed() && FlxG.keys.SPACE)
{
timer = 0;
testPath.addPoint(FlxG.mouse);
if(pathFollower.path == null)
pathFollower.followPath(testPath,100,FlxObject.PATH_LOOP_FORWARD,true);
}
}//*/

super.update();

Expand Down Expand Up @@ -129,12 +136,12 @@ package
text.color = 0x3a5c39;
add(text);

var flixelButton:FlxButton = new FlxButton(FlxG.width/2-40,FlxG.height/3+54,onFlixel,"flixel.org");
var flixelButton:FlxButton = new FlxButton(FlxG.width/2-40,FlxG.height/3+54,"flixel.org",onFlixel);
flixelButton.color = 0xff729954;
flixelButton.label.color = 0xffd8eba2;
add(flixelButton);

var dannyButton:FlxButton = new FlxButton(flixelButton.x,flixelButton.y + 22,onDanny,"music: dannyB");
var dannyButton:FlxButton = new FlxButton(flixelButton.x,flixelButton.y + 22,"music: dannyB",onDanny);
dannyButton.color = flixelButton.color;
dannyButton.label.color = flixelButton.label.color;
add(dannyButton);
Expand All @@ -144,7 +151,7 @@ package
text.alignment = "center";
add(text);

playButton = new FlxButton(flixelButton.x,flixelButton.y + 82,onPlay,"CLICK HERE");
playButton = new FlxButton(flixelButton.x,flixelButton.y + 82,"CLICK HERE",onPlay);
playButton.color = flixelButton.color;
playButton.label.color = flixelButton.label.color;
add(playButton);
Expand All @@ -153,7 +160,7 @@ package
//X + C were pressed, fade out and change to play state.
//OR, if we sat on the menu too long, launch the attract mode instead!
timer += FlxG.elapsed;
if(timer >= 8) //go into demo mode if no buttons are pressed for 10 seconds
if(timer >= 10) //go into demo mode if no buttons are pressed for 10 seconds
attractMode = true;
if(!fading && ((FlxG.keys.X && FlxG.keys.C) || attractMode))
{
Expand Down

0 comments on commit 09fcbbf

Please sign in to comment.