From 25ce591e2250adb34480182699a50fb0dd2847db Mon Sep 17 00:00:00 2001 From: Rain Clark Date: Fri, 7 Oct 2016 00:59:34 -0400 Subject: [PATCH] Go Gel sleep animation working and slowed down animation :snail: --- source/Gel.hx | 9 +++++++-- source/HUD.hx | 6 ++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/source/Gel.hx b/source/Gel.hx index e13e1ee..31f3071 100644 --- a/source/Gel.hx +++ b/source/Gel.hx @@ -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("happy", [6, 7, 8, 9, 10, 11, 10, 9, 8, 7], 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("ashamed", [21, 22, 23, 22], 3, false); @@ -60,6 +60,7 @@ class Gel extends FlxSprite FlxG.watch.add(this, "Age"); FlxG.watch.add(this, "CurrentMood"); FlxG.watch.add(this, "CurrentNeed"); + FlxG.watch.add(this.animation, "name", "Gel.animation"); FlxG.watch.add(this, "Wait"); FlxG.watch.add(this, "Intellect"); FlxG.watch.add(this, "_hasStudied"); @@ -94,7 +95,9 @@ class Gel extends FlxSprite private function checkMood():Void { if (_isAsleep) - CurrentMood == SLEEPING; + { + CurrentMood = SLEEPING; + } else { if (Happiness >= 61) @@ -139,6 +142,7 @@ class Gel extends FlxSprite CurrentNeed = SLEEPY; else CurrentNeed = NONE; + // TODO: Make/Play alert type sound effect when need change } public function EatFood():Void @@ -164,6 +168,7 @@ class Gel extends FlxSprite public function Study():Void { // TODO: Add study faliure chance + // TODO: Add Age bonus if (!_hasStudied) { Intellect++; diff --git a/source/HUD.hx b/source/HUD.hx index 9d703ee..063399f 100644 --- a/source/HUD.hx +++ b/source/HUD.hx @@ -173,6 +173,7 @@ class HUD extends FlxTypedGroup _gel.update(elapsed); + // Gel Animation if (_gel.CurrentMood == Gel.Mood.NEUTRAL) _gel.animation.play("neutral", false); else if(_gel.CurrentMood == Gel.Mood.HAPPY) @@ -182,6 +183,7 @@ class HUD extends FlxTypedGroup else if (_gel.CurrentMood == Gel.Mood.SLEEPING) _gel.animation.play("sleeping", false); + // Need Bubble if (_gel.CurrentNeed == Gel.Need.NONE) _sprThoughts.animation.play("none", false); else if (_gel.CurrentNeed == Gel.Need.HUNGRY) @@ -342,10 +344,6 @@ class HUD extends FlxTypedGroup _gel.Wait = false; } - private function showThought():Void - { - - } } // TODO: Actually use this instead of _menuChoice