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

Go Gel sleep animation working and slowed down animation 🐌

This commit is contained in:
Rain Clark 2016-10-07 00:59:34 -04:00
parent d3bb4acd18
commit 25ce591e22
2 changed files with 9 additions and 6 deletions

View File

@ -50,7 +50,7 @@ class Gel extends FlxSprite
animation.add("neutral", [0, 1, 2, 3, 4, 5, 4, 3, 2, 1], 2, true); animation.add("neutral", [0, 1, 2, 3, 4, 5, 4, 3, 2, 1], 2, true);
animation.add("happy", [6, 7, 8, 9, 10, 11, 10, 9, 8, 7], 2, true); animation.add("happy", [6, 7, 8, 9, 10, 11, 10, 9, 8, 7], 2, true);
animation.add("angry", [12, 13, 14, 13], 2, true); animation.add("angry", [12, 13, 14, 13], 2, true);
animation.add("sleeping", [15, 16, 17, 16], 2, true); animation.add("sleeping", [15, 16, 17, 16], 1, true);
animation.add("excited", [18, 19, 20, 19], 3, false); animation.add("excited", [18, 19, 20, 19], 3, false);
animation.add("ashamed", [21, 22, 23, 22], 3, false); animation.add("ashamed", [21, 22, 23, 22], 3, false);
@ -60,6 +60,7 @@ class Gel extends FlxSprite
FlxG.watch.add(this, "Age"); FlxG.watch.add(this, "Age");
FlxG.watch.add(this, "CurrentMood"); FlxG.watch.add(this, "CurrentMood");
FlxG.watch.add(this, "CurrentNeed"); FlxG.watch.add(this, "CurrentNeed");
FlxG.watch.add(this.animation, "name", "Gel.animation");
FlxG.watch.add(this, "Wait"); FlxG.watch.add(this, "Wait");
FlxG.watch.add(this, "Intellect"); FlxG.watch.add(this, "Intellect");
FlxG.watch.add(this, "_hasStudied"); FlxG.watch.add(this, "_hasStudied");
@ -94,7 +95,9 @@ class Gel extends FlxSprite
private function checkMood():Void private function checkMood():Void
{ {
if (_isAsleep) if (_isAsleep)
CurrentMood == SLEEPING; {
CurrentMood = SLEEPING;
}
else else
{ {
if (Happiness >= 61) if (Happiness >= 61)
@ -139,6 +142,7 @@ class Gel extends FlxSprite
CurrentNeed = SLEEPY; CurrentNeed = SLEEPY;
else else
CurrentNeed = NONE; CurrentNeed = NONE;
// TODO: Make/Play alert type sound effect when need change
} }
public function EatFood():Void public function EatFood():Void
@ -164,6 +168,7 @@ class Gel extends FlxSprite
public function Study():Void public function Study():Void
{ {
// TODO: Add study faliure chance // TODO: Add study faliure chance
// TODO: Add Age bonus
if (!_hasStudied) if (!_hasStudied)
{ {
Intellect++; Intellect++;

View File

@ -173,6 +173,7 @@ class HUD extends FlxTypedGroup<FlxSprite>
_gel.update(elapsed); _gel.update(elapsed);
// Gel Animation
if (_gel.CurrentMood == Gel.Mood.NEUTRAL) if (_gel.CurrentMood == Gel.Mood.NEUTRAL)
_gel.animation.play("neutral", false); _gel.animation.play("neutral", false);
else if(_gel.CurrentMood == Gel.Mood.HAPPY) else if(_gel.CurrentMood == Gel.Mood.HAPPY)
@ -182,6 +183,7 @@ class HUD extends FlxTypedGroup<FlxSprite>
else if (_gel.CurrentMood == Gel.Mood.SLEEPING) else if (_gel.CurrentMood == Gel.Mood.SLEEPING)
_gel.animation.play("sleeping", false); _gel.animation.play("sleeping", false);
// Need Bubble
if (_gel.CurrentNeed == Gel.Need.NONE) if (_gel.CurrentNeed == Gel.Need.NONE)
_sprThoughts.animation.play("none", false); _sprThoughts.animation.play("none", false);
else if (_gel.CurrentNeed == Gel.Need.HUNGRY) else if (_gel.CurrentNeed == Gel.Need.HUNGRY)
@ -342,10 +344,6 @@ class HUD extends FlxTypedGroup<FlxSprite>
_gel.Wait = false; _gel.Wait = false;
} }
private function showThought():Void
{
}
} }
// TODO: Actually use this instead of _menuChoice // TODO: Actually use this instead of _menuChoice