1
0
mirror of https://github.com/Melon-Bread/Pet.GB synced 2024-11-28 13:58:20 -05:00

Renamed 'Train' to 'Study

This commit is contained in:
Rain Clark 2016-10-04 04:08:00 -04:00
parent a595be5763
commit 3a22beb7ca
3 changed files with 55 additions and 29 deletions

View File

Before

Width:  |  Height:  |  Size: 294 B

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

View File

@ -6,6 +6,7 @@ import flixel.group.FlxGroup;
import flixel.system.FlxSound; import flixel.system.FlxSound;
import flixel.text.FlxText; import flixel.text.FlxText;
import flixel.util.FlxColor; import flixel.util.FlxColor;
using flixel.util.FlxSpriteUtil;
class HUD extends FlxTypedGroup<FlxSprite> class HUD extends FlxTypedGroup<FlxSprite>
{ {
@ -15,8 +16,8 @@ class HUD extends FlxTypedGroup<FlxSprite>
private var _sprInfo:FlxSprite; private var _sprInfo:FlxSprite;
private var _txtFeed:FlxText; private var _txtFeed:FlxText;
private var _sprFeed:FlxSprite; private var _sprFeed:FlxSprite;
private var _txtTrain:FlxText; private var _txtStudy:FlxText;
private var _sprTrain:FlxSprite; private var _sprStudy:FlxSprite;
private var _txtRest:FlxText; private var _txtRest:FlxText;
private var _sprRest:FlxSprite; private var _sprRest:FlxSprite;
@ -72,15 +73,15 @@ class HUD extends FlxTypedGroup<FlxSprite>
_sprFeed = new FlxSprite((_txtFeed.x + 2), (_txtFeed.y - 17), AssetPaths.Feed__png); _sprFeed = new FlxSprite((_txtFeed.x + 2), (_txtFeed.y - 17), AssetPaths.Feed__png);
add(_sprFeed); add(_sprFeed);
// Train // Study
_txtTrain = new FlxText((_txtFeed.x + _txtFeed.width - 1), (_sprTop.height - 13), 0, "Train", 8); _txtStudy = new FlxText((_txtFeed.x + _txtFeed.width - 1), (_sprTop.height - 13), 0, "Study", 8);
_txtTrain.setFormat(AssetPaths.EarlyGameBoy__ttf, 8, FlxColor.fromRGB(8, 24, 32, 0), CENTER); _txtStudy.setFormat(AssetPaths.EarlyGameBoy__ttf, 8, FlxColor.fromRGB(8, 24, 32, 0), CENTER);
add(_txtTrain); add(_txtStudy);
_sprTrain = new FlxSprite((_txtTrain.x + 6), (_txtTrain.y - 17), AssetPaths.Train__png); _sprStudy = new FlxSprite((_txtStudy.x + 6), (_txtStudy.y - 17), AssetPaths.Study__png);
add(_sprTrain); add(_sprStudy);
// Rest // Rest
_txtRest = new FlxText((_txtTrain.x + _txtTrain.width), (_sprTop.height - 13), 0, "Rest", 8); _txtRest = new FlxText((_txtStudy.x + _txtStudy.width), (_sprTop.height - 13), 0, "Rest", 8);
_txtRest.setFormat(AssetPaths.EarlyGameBoy__ttf, 8, FlxColor.fromRGB(8, 24, 32, 0), CENTER); _txtRest.setFormat(AssetPaths.EarlyGameBoy__ttf, 8, FlxColor.fromRGB(8, 24, 32, 0), CENTER);
add(_txtRest); add(_txtRest);
_sprRest = new FlxSprite((_txtRest.x + 2), (_txtRest.y - 17), AssetPaths.Rest__png); _sprRest = new FlxSprite((_txtRest.x + 2), (_txtRest.y - 17), AssetPaths.Rest__png);
@ -135,11 +136,14 @@ class HUD extends FlxTypedGroup<FlxSprite>
_sprInteraction.visible = false; _sprInteraction.visible = false;
add(_sprInteraction); add(_sprInteraction);
_tmpText = new FlxText(_sprInteraction.x, _sprInteraction.y, 0, "X", 8); _tmpText = new FlxText(_sprInteraction.x, _sprInteraction.y, 0, "", 8);
add(_tmpText); add(_tmpText);
// DEBUG // DEBUG
FlxG.watch.add(this, "_menuOption", "Menu Index"); FlxG.watch.add(this, "_menuOption", "Menu Index");
FlxG.watch.add(_sprInteraction, "alpha", "Interact Alpha");
FlxG.watch.add(_sprInteraction, "visible", "Interact Visible");
FlxG.watch.add(_tmpText, "text", "Temp Text");
} }
override public function update(elapsed:Float):Void override public function update(elapsed:Float):Void
@ -200,6 +204,8 @@ class HUD extends FlxTypedGroup<FlxSprite>
} }
private function makeOption(option:Int):Void private function makeOption(option:Int):Void
{
if(!_gel.Wait)
{ {
switch(option) switch(option)
{ {
@ -231,17 +237,37 @@ class HUD extends FlxTypedGroup<FlxSprite>
_sndSelect.play(true); _sndSelect.play(true);
} }
}
private function feedGel():Void private function feedGel():Void
{ {
itemJoin("F");
_gel.EatFood(); _gel.EatFood();
_sprInteraction.fadeOut(2, itemLeave);
}
private function itemJoin(letter:String = ""):Void
{
_sprInteraction.visible = true;
_tmpText.text = letter;
}
private function itemLeave(_):Void
{
_sprInteraction.visible = false;
_tmpText.text = "";
_sprInteraction.alpha = 1;
_gel.Wait = false;
} }
} }
// TODO: Actually use this instead of _menuChoice
enum MenuOption enum MenuOption
{ {
INFO; INFO;
FEED; FEED;
TRAIN; STUDY;
REST; REST;
CHEER; CHEER;
SCOLD; SCOLD;