mirror of
https://github.com/Melon-Bread/Pet.GB
synced 2024-11-28 13:58:20 -05:00
Finished up waste management 💩
- Fixed waste clean up bug - Brought down the range for when waste is ready
This commit is contained in:
parent
c85abca75d
commit
0f21667c33
@ -42,19 +42,19 @@ class Gel extends FlxSprite
|
|||||||
// Gels internal clock
|
// Gels internal clock
|
||||||
public var _clock:Clock;
|
public var _clock:Clock;
|
||||||
|
|
||||||
public function new(?X:Float=0, ?Y:Float=0)
|
public function new(?X:Float=0, ?Y:Float=0, clock:Clock)
|
||||||
{
|
{
|
||||||
super(X, Y);
|
super(X, Y);
|
||||||
|
|
||||||
loadGraphic(AssetPaths.Player__png, true, 64, 64);
|
loadGraphic(AssetPaths.Player__png, true, 64, 64);
|
||||||
animation.add("neutral", [0, 1, 2, 3, 4, 5, 4, 3, 2, 1], 5, true);
|
animation.add("neutral", [0, 1, 2, 3, 4, 5, 4, 3, 2, 1], 5, true);
|
||||||
animation.add("happy", [6, 7, 8, 9, 10, 11, 10, 9, 8, 7], 5 true);
|
animation.add("happy", [6, 7, 8, 9, 10, 11, 10, 9, 8, 7], 5, true);
|
||||||
animation.add("angry", [12, 13, 14, 13], 5, true);
|
animation.add("angry", [12, 13, 14, 13], 5, true);
|
||||||
animation.add("sleeping", [15, 16, 17, 16], 3, true);
|
animation.add("sleeping", [15, 16, 17, 16], 3, true);
|
||||||
animation.add("excited", [18, 19, 20, 19], 6, false);
|
animation.add("excited", [18, 19, 20, 19], 6, false);
|
||||||
animation.add("ashamed", [21, 22, 23, 22], 4, false);
|
animation.add("ashamed", [21, 22, 23, 22], 4, false);
|
||||||
|
|
||||||
_clock = new Clock();
|
_clock = clock;
|
||||||
|
|
||||||
// DEBUG
|
// DEBUG
|
||||||
FlxG.watch.add(this, "Age");
|
FlxG.watch.add(this, "Age");
|
||||||
@ -109,8 +109,6 @@ class Gel extends FlxSprite
|
|||||||
|
|
||||||
private function checkNeed():Void
|
private function checkNeed():Void
|
||||||
{
|
{
|
||||||
// TODO: Add need stat triggers
|
|
||||||
|
|
||||||
// Fullness Checks
|
// Fullness Checks
|
||||||
if(Fullness < 50)
|
if(Fullness < 50)
|
||||||
_isHungry = true;
|
_isHungry = true;
|
||||||
@ -118,7 +116,7 @@ class Gel extends FlxSprite
|
|||||||
_isHungry = false;
|
_isHungry = false;
|
||||||
|
|
||||||
// Waste Check
|
// Waste Check
|
||||||
if (Waste > 75 && Waste < 100)
|
if (Waste > 85 && Waste < 100)
|
||||||
_wasteReady = true;
|
_wasteReady = true;
|
||||||
else if (Waste >= 100)
|
else if (Waste >= 100)
|
||||||
makeWaste();
|
makeWaste();
|
||||||
@ -230,10 +228,9 @@ class Gel extends FlxSprite
|
|||||||
public function Wipe():Void
|
public function Wipe():Void
|
||||||
{
|
{
|
||||||
Wait = true;
|
Wait = true;
|
||||||
// TODO: Lock Wipe down for the rest of hour
|
|
||||||
|
|
||||||
// Early Wipe
|
// Early Wipe
|
||||||
if (!_wasteReady)
|
if (!_wasteReady && !_madeWaste)
|
||||||
{
|
{
|
||||||
Happiness -=5;
|
Happiness -=5;
|
||||||
// TODO: Pay ashamed animation to show bad wipe
|
// TODO: Pay ashamed animation to show bad wipe
|
||||||
@ -241,7 +238,7 @@ class Gel extends FlxSprite
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Good Wipe
|
// Good Wipe
|
||||||
if (!_madeWaste)
|
else if (!_madeWaste)
|
||||||
{
|
{
|
||||||
Happiness += 10;
|
Happiness += 10;
|
||||||
Discipline += 10;
|
Discipline += 10;
|
||||||
@ -285,6 +282,16 @@ class Gel extends FlxSprite
|
|||||||
checkRange();
|
checkRange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function beExcited():Void
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private function beAshamed():Void
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private function newHour():Void
|
private function newHour():Void
|
||||||
{
|
{
|
||||||
if (!_isAsleep)
|
if (!_isAsleep)
|
||||||
@ -370,9 +377,8 @@ enum Mood
|
|||||||
HAPPY;
|
HAPPY;
|
||||||
ANGRY;
|
ANGRY;
|
||||||
SLEEPING;
|
SLEEPING;
|
||||||
|
EXCITED;
|
||||||
ENCOURAGED;
|
ASHAMED;
|
||||||
SAD;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Need
|
enum Need
|
||||||
|
Loading…
Reference in New Issue
Block a user