Initial Commit
* Adds Menu * Adds Level Manager - LevelBase * Adds Sample level * Basic player movement
This commit is contained in:
73
source/scenes/GameOver.hx
Normal file
73
source/scenes/GameOver.hx
Normal file
@@ -0,0 +1,73 @@
|
||||
package scenes;
|
||||
|
||||
import djFlixel.gfx.pal.Pal_DB32;
|
||||
import djFlixel.ui.FlxMenu;
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.FlxSubState;
|
||||
import flixel.math.FlxPoint;
|
||||
import flixel.util.FlxColor;
|
||||
import flixel.util.FlxSpriteUtil;
|
||||
|
||||
class GameOver extends FlxSubState
|
||||
{
|
||||
var bgWidth:Int = 126;
|
||||
var bgHeight:Int = 116;
|
||||
var menuWidth:Int = 90;
|
||||
var bgMenuSpace:Int = 16;
|
||||
var bgRectDiff:Int = 2;
|
||||
var menuFontSize:Int = 20;
|
||||
|
||||
public function new()
|
||||
{
|
||||
super(0x33000000);
|
||||
}
|
||||
|
||||
override public function create()
|
||||
{
|
||||
super.create();
|
||||
|
||||
var bg:FlxSprite = new FlxSprite();
|
||||
bg.makeGraphic(menuWidth + (bgMenuSpace * 2) + (bgRectDiff * 2), bgHeight, FlxColor.TRANSPARENT);
|
||||
|
||||
FlxSpriteUtil.drawRoundRect(bg, 0, 0, (bgWidth - (bgRectDiff * 2)), bgHeight, 10, 10, FlxColor.BLACK);
|
||||
var _menu = new FlxMenu(FlxG.width / 2 - (menuWidth / 2 - menuFontSize), FlxG.height / 2, menuWidth);
|
||||
|
||||
bg.setPosition((_menu.x - bgMenuSpace), (_menu.y) - (bgMenuSpace * 2));
|
||||
_menu.stI.text = {
|
||||
f: AssetPaths.MrPixel__otf,
|
||||
s: menuFontSize,
|
||||
bt: 1,
|
||||
so: [1, 1]
|
||||
};
|
||||
_menu.PARAMS.enable_mouse = false;
|
||||
_menu.stI.col_t = {
|
||||
idle: Pal_DB32.COL[21],
|
||||
focus: Pal_DB32.COL[28],
|
||||
accent: Pal_DB32.COL[29],
|
||||
dis: Pal_DB32.COL[25], // Disabled
|
||||
dis_f: Pal_DB32.COL[23], // Disabled focused
|
||||
};
|
||||
_menu.stI.col_b = {
|
||||
idle: Pal_DB32.COL[1],
|
||||
focus: Pal_DB32.COL[0]
|
||||
};
|
||||
_menu.stHeader = {
|
||||
f: AssetPaths.MrPixel__otf,
|
||||
s: 16,
|
||||
bt: 2,
|
||||
bs: 1,
|
||||
c: Pal_DB32.COL[8],
|
||||
bc: Pal_DB32.COL[27]
|
||||
};
|
||||
_menu.PARAMS.header_CPS = 30;
|
||||
_menu.PARAMS.page_anim_parallel = true;
|
||||
_menu.createPage('main', "GAME OVER").addM(['Restart |link|restart', 'Home |link|home', 'Exit |link|exit']);
|
||||
_menu.onItemEvent = (a, b) -> {};
|
||||
add(bg);
|
||||
add(_menu);
|
||||
_menu.goto('main');
|
||||
FlxG.camera.follow(null);
|
||||
FlxG.camera.focusOn(new FlxPoint(0, 0));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user