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

Set debug layout 🐛

This commit is contained in:
Rain Clark 2016-10-06 01:18:02 -04:00
parent b0bc0f62ab
commit 6f781f7e50
8 changed files with 453 additions and 314 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
# Dir # Dir
_tmp/ _tmp/
export/* export/*
export/.build

View File

@ -163,12 +163,14 @@
* Puts player in Sleeping Mood * Puts player in Sleeping Mood
* Last 6-9 hours (random, may make discipline be a factor) * Last 6-9 hours (random, may make discipline be a factor)
* Can only view INFO & CONF * Can only view INFO & CONF
* Happiness change determined by level * Stat changes on wake up
* HAPPY = Happiness - 15; * Happiness change determined by level
* NEUTRAL = Happiness +10 * HAPPY = Happiness - 15;
* ANGRY = Happiness +10; * NEUTRAL = Happiness +10
* Fullness -50; * ANGRY = Happiness +10;
* Sleepiness =0; * Fullness -50;
* Sleepiness =0;
* Waste += 10;
###CHEER: ###CHEER:
* Happiness +10 * Happiness +10

View File

@ -3,9 +3,61 @@
{ {
"selected_items": "selected_items":
[ [
[
"As",
"_isAsleep\tBool"
],
[
"Cu",
"CurrentMood\tMood"
],
[ [
"_is", "_is",
"_isAsleep" "_isTired\tBool"
],
[
"Sl",
"Sleepiness\tInt"
],
[
"check",
"checkRange( )\tVoid"
],
[
"is",
"_isAsleep\tBool"
],
[
"S",
"SLEEPING\tMood"
],
[
"CU",
"CurrentMood\tMood"
],
[
"_isa",
"_isAsleep\tBool"
],
[
"Sle",
"Sleep( )\tVoid"
],
[
"ite",
"itemJoin( ?letter : String )\tVoid"
],
[
"In",
"Intellect"
],
[
"Int",
"Intellect\tInt"
],
[
"_has",
"_hasStudied\tBool"
], ],
[ [
"_made", "_made",
@ -27,10 +79,6 @@
"_sp", "_sp",
"_sprInteraction\tflixel.FlxSprite" "_sprInteraction\tflixel.FlxSprite"
], ],
[
"check",
"checkRange( )\tVoid"
],
[ [
"el", "el",
"elapsed" "elapsed"
@ -43,10 +91,6 @@
"isT", "isT",
"_isTired\tBool" "_isTired\tBool"
], ],
[
"CU",
"CurrentNeed\tNeed"
],
[ [
"SLEEP", "SLEEP",
"SLEEPY\tNeed" "SLEEPY\tNeed"
@ -155,10 +199,6 @@
"_sprS", "_sprS",
"_sprSelect\tflixel.FlxSprite" "_sprSelect\tflixel.FlxSprite"
], ],
[
"S",
"Select__ogg\tString"
],
[ [
"Menu", "Menu",
"_menuChoice" "_menuChoice"
@ -391,7 +431,7 @@
"file": "source/PlayState.hx", "file": "source/PlayState.hx",
"settings": "settings":
{ {
"buffer_size": 720, "buffer_size": 738,
"encoding": "UTF-8", "encoding": "UTF-8",
"line_ending": "Unix" "line_ending": "Unix"
} }
@ -409,7 +449,7 @@
"file": "source/HUD.hx", "file": "source/HUD.hx",
"settings": "settings":
{ {
"buffer_size": 8501, "buffer_size": 9035,
"encoding": "UTF-8", "encoding": "UTF-8",
"line_ending": "Windows" "line_ending": "Windows"
} }
@ -418,7 +458,7 @@
"file": "source/Gel.hx", "file": "source/Gel.hx",
"settings": "settings":
{ {
"buffer_size": 5479, "buffer_size": 6939,
"encoding": "UTF-8", "encoding": "UTF-8",
"line_ending": "Windows" "line_ending": "Windows"
} }
@ -427,7 +467,7 @@
"file": "source/Clock.hx", "file": "source/Clock.hx",
"settings": "settings":
{ {
"buffer_size": 851, "buffer_size": 814,
"encoding": "UTF-8", "encoding": "UTF-8",
"line_ending": "Windows" "line_ending": "Windows"
} }
@ -440,18 +480,18 @@
"build_varint": "", "build_varint": "",
"command_palette": "command_palette":
{ {
"height": 243.0, "height": 357.0,
"last_filter": "instal", "last_filter": "im",
"selected_items": "selected_items":
[ [
[
"instal",
"Package Control: Install Package"
],
[ [
"im", "im",
"Haxe: Organize Imports" "Haxe: Organize Imports"
], ],
[
"instal",
"Package Control: Install Package"
],
[ [
"i", "i",
"Haxe: Organize Imports" "Haxe: Organize Imports"
@ -593,7 +633,7 @@
"Package Control: Install Package" "Package Control: Install Package"
] ]
], ],
"width": 414.0 "width": 446.0
}, },
"console": "console":
{ {
@ -765,6 +805,8 @@
"case_sensitive": false, "case_sensitive": false,
"find_history": "find_history":
[ [
"Mood.Sleep",
"_isAsleeps",
"madwa", "madwa",
"elsapsed", "elsapsed",
"/l6", "/l6",
@ -809,6 +851,7 @@
"regex": false, "regex": false,
"replace_history": "replace_history":
[ [
"_isAsleep",
"elapsed", "elapsed",
"", "",
"Study", "Study",
@ -837,7 +880,7 @@
"groups": "groups":
[ [
{ {
"selected": 2, "selected": 0,
"sheets": "sheets":
[ [
{ {
@ -846,15 +889,15 @@
"semi_transient": false, "semi_transient": false,
"settings": "settings":
{ {
"buffer_size": 720, "buffer_size": 738,
"regions": "regions":
{ {
}, },
"selection": "selection":
[ [
[ [
8, 304,
8 304
] ]
], ],
"settings": "settings":
@ -864,12 +907,27 @@
{ {
"close": "close":
{ {
"1":
[
304,
305
]
}, },
"icon": "icon":
{ {
"1":
[
"Packages/BracketHighlighter/icons/round_bracket.png",
"brackethighlighter.default"
]
}, },
"open": "open":
{ {
"1":
[
280,
281
]
}, },
"unmatched": "unmatched":
{ {
@ -877,61 +935,61 @@
}, },
"bracket_highlighter.regions": "bracket_highlighter.regions":
[ [
"bh_angle",
"bh_angle_center",
"bh_angle_open",
"bh_angle_close",
"bh_angle_content",
"bh_single_quote", "bh_single_quote",
"bh_single_quote_center", "bh_single_quote_center",
"bh_single_quote_open", "bh_single_quote_open",
"bh_single_quote_close", "bh_single_quote_close",
"bh_single_quote_content", "bh_single_quote_content",
"bh_square",
"bh_square_center",
"bh_square_open",
"bh_square_close",
"bh_square_content",
"bh_regex",
"bh_regex_center",
"bh_regex_open",
"bh_regex_close",
"bh_regex_content",
"bh_double_quote",
"bh_double_quote_center",
"bh_double_quote_open",
"bh_double_quote_close",
"bh_double_quote_content",
"bh_curly",
"bh_curly_center",
"bh_curly_open",
"bh_curly_close",
"bh_curly_content",
"bh_tag",
"bh_tag_center",
"bh_tag_open",
"bh_tag_close",
"bh_tag_content",
"bh_c_define",
"bh_c_define_center",
"bh_c_define_open",
"bh_c_define_close",
"bh_c_define_content",
"bh_default", "bh_default",
"bh_default_center", "bh_default_center",
"bh_default_open", "bh_default_open",
"bh_default_close", "bh_default_close",
"bh_default_content", "bh_default_content",
"bh_curly",
"bh_curly_center",
"bh_curly_open",
"bh_curly_close",
"bh_curly_content",
"bh_c_define",
"bh_c_define_center",
"bh_c_define_open",
"bh_c_define_close",
"bh_c_define_content",
"bh_unmatched",
"bh_unmatched_center",
"bh_unmatched_open",
"bh_unmatched_close",
"bh_unmatched_content",
"bh_tag",
"bh_tag_center",
"bh_tag_open",
"bh_tag_close",
"bh_tag_content",
"bh_angle",
"bh_angle_center",
"bh_angle_open",
"bh_angle_close",
"bh_angle_content",
"bh_square",
"bh_square_center",
"bh_square_open",
"bh_square_close",
"bh_square_content",
"bh_round", "bh_round",
"bh_round_center", "bh_round_center",
"bh_round_open", "bh_round_open",
"bh_round_close", "bh_round_close",
"bh_round_content", "bh_round_content",
"bh_unmatched", "bh_double_quote",
"bh_unmatched_center", "bh_double_quote_center",
"bh_unmatched_open", "bh_double_quote_open",
"bh_unmatched_close", "bh_double_quote_close",
"bh_unmatched_content" "bh_double_quote_content",
"bh_regex",
"bh_regex_center",
"bh_regex_open",
"bh_regex_close",
"bh_regex_content"
], ],
"haxe-build-id": 0, "haxe-build-id": 0,
"syntax": "Packages/Haxe/Haxe.tmLanguage", "syntax": "Packages/Haxe/Haxe.tmLanguage",
@ -941,7 +999,7 @@
"translation.y": 0.0, "translation.y": 0.0,
"zoom_level": 1.0 "zoom_level": 1.0
}, },
"stack_index": 3, "stack_index": 0,
"type": "text" "type": "text"
}, },
{ {
@ -1060,7 +1118,7 @@
"translation.y": 390.0, "translation.y": 390.0,
"zoom_level": 1.0 "zoom_level": 1.0
}, },
"stack_index": 2, "stack_index": 4,
"type": "text" "type": "text"
}, },
{ {
@ -1069,15 +1127,15 @@
"semi_transient": false, "semi_transient": false,
"settings": "settings":
{ {
"buffer_size": 8501, "buffer_size": 9035,
"regions": "regions":
{ {
}, },
"selection": "selection":
[ [
[ [
3553, 5867,
3553 5867
] ]
], ],
"settings": "settings":
@ -1089,15 +1147,15 @@
{ {
"1": "1":
[ [
3561, 6596,
3562 6597
] ]
}, },
"icon": "icon":
{ {
"1": "1":
[ [
"Packages/BracketHighlighter/icons/round_bracket.png", "Packages/BracketHighlighter/icons/curly_bracket.png",
"brackethighlighter.default" "brackethighlighter.default"
] ]
}, },
@ -1105,8 +1163,8 @@
{ {
"1": "1":
[ [
3527, 5383,
3528 5384
] ]
}, },
"unmatched": "unmatched":
@ -1115,130 +1173,21 @@
}, },
"bracket_highlighter.regions": "bracket_highlighter.regions":
[ [
"bh_unmatched",
"bh_unmatched_center",
"bh_unmatched_open",
"bh_unmatched_close",
"bh_unmatched_content",
"bh_default",
"bh_default_center",
"bh_default_open",
"bh_default_close",
"bh_default_content",
"bh_round",
"bh_round_center",
"bh_round_open",
"bh_round_close",
"bh_round_content",
"bh_square",
"bh_square_center",
"bh_square_open",
"bh_square_close",
"bh_square_content",
"bh_angle",
"bh_angle_center",
"bh_angle_open",
"bh_angle_close",
"bh_angle_content",
"bh_single_quote", "bh_single_quote",
"bh_single_quote_center", "bh_single_quote_center",
"bh_single_quote_open", "bh_single_quote_open",
"bh_single_quote_close", "bh_single_quote_close",
"bh_single_quote_content", "bh_single_quote_content",
"bh_double_quote",
"bh_double_quote_center",
"bh_double_quote_open",
"bh_double_quote_close",
"bh_double_quote_content",
"bh_curly",
"bh_curly_center",
"bh_curly_open",
"bh_curly_close",
"bh_curly_content",
"bh_regex",
"bh_regex_center",
"bh_regex_open",
"bh_regex_close",
"bh_regex_content",
"bh_tag",
"bh_tag_center",
"bh_tag_open",
"bh_tag_close",
"bh_tag_content",
"bh_c_define",
"bh_c_define_center",
"bh_c_define_open",
"bh_c_define_close",
"bh_c_define_content"
],
"haxe-build-id": 0,
"syntax": "Packages/Haxe/Haxe.tmLanguage",
"translate_tabs_to_spaces": false
},
"translation.x": 0.0,
"translation.y": 1160.0,
"zoom_level": 1.0
},
"stack_index": 0,
"type": "text"
},
{
"buffer": 3,
"file": "source/Gel.hx",
"semi_transient": false,
"settings":
{
"buffer_size": 5479,
"regions":
{
},
"selection":
[
[
2892,
2892
]
],
"settings":
{
"bracket_highlighter.busy": false,
"bracket_highlighter.locations":
{
"close":
{
},
"icon":
{
},
"open":
{
},
"unmatched":
{
"1":
[
5357,
5358
]
}
},
"bracket_highlighter.regions":
[
"bh_double_quote",
"bh_double_quote_center",
"bh_double_quote_open",
"bh_double_quote_close",
"bh_double_quote_content",
"bh_default", "bh_default",
"bh_default_center", "bh_default_center",
"bh_default_open", "bh_default_open",
"bh_default_close", "bh_default_close",
"bh_default_content", "bh_default_content",
"bh_tag", "bh_curly",
"bh_tag_center", "bh_curly_center",
"bh_tag_open", "bh_curly_open",
"bh_tag_close", "bh_curly_close",
"bh_tag_content", "bh_curly_content",
"bh_c_define", "bh_c_define",
"bh_c_define_center", "bh_c_define_center",
"bh_c_define_open", "bh_c_define_open",
@ -1249,43 +1198,162 @@
"bh_unmatched_open", "bh_unmatched_open",
"bh_unmatched_close", "bh_unmatched_close",
"bh_unmatched_content", "bh_unmatched_content",
"bh_single_quote", "bh_tag",
"bh_single_quote_center", "bh_tag_center",
"bh_single_quote_open", "bh_tag_open",
"bh_single_quote_close", "bh_tag_close",
"bh_single_quote_content", "bh_tag_content",
"bh_angle", "bh_angle",
"bh_angle_center", "bh_angle_center",
"bh_angle_open", "bh_angle_open",
"bh_angle_close", "bh_angle_close",
"bh_angle_content", "bh_angle_content",
"bh_curly", "bh_square",
"bh_curly_center", "bh_square_center",
"bh_curly_open", "bh_square_open",
"bh_curly_close", "bh_square_close",
"bh_curly_content", "bh_square_content",
"bh_regex",
"bh_regex_center",
"bh_regex_open",
"bh_regex_close",
"bh_regex_content",
"bh_round", "bh_round",
"bh_round_center", "bh_round_center",
"bh_round_open", "bh_round_open",
"bh_round_close", "bh_round_close",
"bh_round_content", "bh_round_content",
"bh_square", "bh_double_quote",
"bh_square_center", "bh_double_quote_center",
"bh_square_open", "bh_double_quote_open",
"bh_square_close", "bh_double_quote_close",
"bh_square_content" "bh_double_quote_content",
"bh_regex",
"bh_regex_center",
"bh_regex_open",
"bh_regex_close",
"bh_regex_content"
], ],
"haxe-build-id": 0, "haxe-build-id": 0,
"syntax": "Packages/Haxe/Haxe.tmLanguage", "syntax": "Packages/Haxe/Haxe.tmLanguage",
"translate_tabs_to_spaces": false "translate_tabs_to_spaces": false
}, },
"translation.x": 0.0, "translation.x": 0.0,
"translation.y": 579.0, "translation.y": 650.0,
"zoom_level": 1.0
},
"stack_index": 2,
"type": "text"
},
{
"buffer": 3,
"file": "source/Gel.hx",
"semi_transient": false,
"settings":
{
"buffer_size": 6939,
"regions":
{
},
"selection":
[
[
3434,
3434
]
],
"settings":
{
"bracket_highlighter.busy": false,
"bracket_highlighter.locations":
{
"close":
{
"1":
[
3469,
3470
]
},
"icon":
{
"1":
[
"Packages/BracketHighlighter/icons/curly_bracket.png",
"brackethighlighter.default"
]
},
"open":
{
"1":
[
3361,
3362
]
},
"unmatched":
{
}
},
"bracket_highlighter.regions":
[
"bh_single_quote",
"bh_single_quote_center",
"bh_single_quote_open",
"bh_single_quote_close",
"bh_single_quote_content",
"bh_default",
"bh_default_center",
"bh_default_open",
"bh_default_close",
"bh_default_content",
"bh_curly",
"bh_curly_center",
"bh_curly_open",
"bh_curly_close",
"bh_curly_content",
"bh_c_define",
"bh_c_define_center",
"bh_c_define_open",
"bh_c_define_close",
"bh_c_define_content",
"bh_unmatched",
"bh_unmatched_center",
"bh_unmatched_open",
"bh_unmatched_close",
"bh_unmatched_content",
"bh_tag",
"bh_tag_center",
"bh_tag_open",
"bh_tag_close",
"bh_tag_content",
"bh_angle",
"bh_angle_center",
"bh_angle_open",
"bh_angle_close",
"bh_angle_content",
"bh_square",
"bh_square_center",
"bh_square_open",
"bh_square_close",
"bh_square_content",
"bh_round",
"bh_round_center",
"bh_round_open",
"bh_round_close",
"bh_round_content",
"bh_double_quote",
"bh_double_quote_center",
"bh_double_quote_open",
"bh_double_quote_close",
"bh_double_quote_content",
"bh_regex",
"bh_regex_center",
"bh_regex_open",
"bh_regex_close",
"bh_regex_content"
],
"haxe-build-id": 0,
"syntax": "Packages/Haxe/Haxe.tmLanguage",
"translate_tabs_to_spaces": false
},
"translation.x": 0.0,
"translation.y": 738.0,
"zoom_level": 1.0 "zoom_level": 1.0
}, },
"stack_index": 1, "stack_index": 1,
@ -1303,15 +1371,15 @@
"semi_transient": false, "semi_transient": false,
"settings": "settings":
{ {
"buffer_size": 851, "buffer_size": 814,
"regions": "regions":
{ {
}, },
"selection": "selection":
[ [
[ [
577, 457,
624 457
] ]
], ],
"settings": "settings":
@ -1323,15 +1391,15 @@
{ {
"1": "1":
[ [
850, 458,
851 459
] ]
}, },
"icon": "icon":
{ {
"1": "1":
[ [
"Packages/BracketHighlighter/icons/curly_bracket.png", "Packages/BracketHighlighter/icons/double_quote.png",
"brackethighlighter.default" "brackethighlighter.default"
] ]
}, },
@ -1339,8 +1407,8 @@
{ {
"1": "1":
[ [
72, 452,
73 453
] ]
}, },
"unmatched": "unmatched":
@ -1349,70 +1417,70 @@
}, },
"bracket_highlighter.regions": "bracket_highlighter.regions":
[ [
"bh_unmatched",
"bh_unmatched_center",
"bh_unmatched_open",
"bh_unmatched_close",
"bh_unmatched_content",
"bh_default",
"bh_default_center",
"bh_default_open",
"bh_default_close",
"bh_default_content",
"bh_round",
"bh_round_center",
"bh_round_open",
"bh_round_close",
"bh_round_content",
"bh_square",
"bh_square_center",
"bh_square_open",
"bh_square_close",
"bh_square_content",
"bh_angle",
"bh_angle_center",
"bh_angle_open",
"bh_angle_close",
"bh_angle_content",
"bh_single_quote", "bh_single_quote",
"bh_single_quote_center", "bh_single_quote_center",
"bh_single_quote_open", "bh_single_quote_open",
"bh_single_quote_close", "bh_single_quote_close",
"bh_single_quote_content", "bh_single_quote_content",
"bh_double_quote", "bh_default",
"bh_double_quote_center", "bh_default_center",
"bh_double_quote_open", "bh_default_open",
"bh_double_quote_close", "bh_default_close",
"bh_double_quote_content", "bh_default_content",
"bh_curly", "bh_curly",
"bh_curly_center", "bh_curly_center",
"bh_curly_open", "bh_curly_open",
"bh_curly_close", "bh_curly_close",
"bh_curly_content", "bh_curly_content",
"bh_regex", "bh_c_define",
"bh_regex_center", "bh_c_define_center",
"bh_regex_open", "bh_c_define_open",
"bh_regex_close", "bh_c_define_close",
"bh_regex_content", "bh_c_define_content",
"bh_unmatched",
"bh_unmatched_center",
"bh_unmatched_open",
"bh_unmatched_close",
"bh_unmatched_content",
"bh_tag", "bh_tag",
"bh_tag_center", "bh_tag_center",
"bh_tag_open", "bh_tag_open",
"bh_tag_close", "bh_tag_close",
"bh_tag_content", "bh_tag_content",
"bh_c_define", "bh_angle",
"bh_c_define_center", "bh_angle_center",
"bh_c_define_open", "bh_angle_open",
"bh_c_define_close", "bh_angle_close",
"bh_c_define_content" "bh_angle_content",
"bh_square",
"bh_square_center",
"bh_square_open",
"bh_square_close",
"bh_square_content",
"bh_round",
"bh_round_center",
"bh_round_open",
"bh_round_close",
"bh_round_content",
"bh_double_quote",
"bh_double_quote_center",
"bh_double_quote_open",
"bh_double_quote_close",
"bh_double_quote_content",
"bh_regex",
"bh_regex_center",
"bh_regex_open",
"bh_regex_close",
"bh_regex_content"
], ],
"haxe-build-id": 0, "haxe-build-id": 0,
"syntax": "Packages/Haxe/Haxe.tmLanguage" "syntax": "Packages/Haxe/Haxe.tmLanguage"
}, },
"translation.x": 0.0, "translation.x": 167.0,
"translation.y": 0.0, "translation.y": 0.0,
"zoom_level": 1.0 "zoom_level": 1.0
}, },
"stack_index": 4, "stack_index": 3,
"type": "text" "type": "text"
} }
] ]
@ -1446,7 +1514,7 @@
"cols": "cols":
[ [
0.0, 0.0,
0.683596500179, 0.661046630274,
1.0 1.0
], ],
"rows": "rows":
@ -1502,7 +1570,7 @@
], ],
"width": 0.0 "width": 0.0
}, },
"selected_group": 1, "selected_group": 0,
"settings": "settings":
{ {
}, },

View File

@ -1 +1 @@
307 315

View File

@ -4,8 +4,6 @@ import flixel.FlxG;
import flixel.util.FlxTimer; import flixel.util.FlxTimer;
class Clock { class Clock {
private var _hours:Int = 0;
private var _timer:FlxTimer; private var _timer:FlxTimer;
public var HourPassed:Bool = false; public var HourPassed:Bool = false;
@ -19,7 +17,7 @@ class Clock {
// DEBUG // DEBUG
FlxG.watch.add(_timer, "progress", "Day Completion:"); FlxG.watch.add(_timer, "progress", "Day Completion:");
FlxG.watch.add(_timer, "loopsLeft","Hours Left:"); FlxG.watch.add(_timer, "loopsLeft","Hour:");
} }
public function update():Void public function update():Void

View File

@ -28,14 +28,16 @@ class Gel extends FlxSprite
public var _isAsleep:Bool = false; public var _isAsleep:Bool = false;
// Menu Locks // Menu Locks
public var Wait:Bool = false;
private var _hasStudied:Bool = false; private var _hasStudied:Bool = false;
// Mood/Needs // Mood/Needs
public var CurrentMood:Mood = NEUTRAL; public var CurrentMood:Mood = NEUTRAL;
public var CurrentNeed:Need = NONE; public var CurrentNeed:Need = NONE;
// // Sleep Timer
public var Wait:Bool = false; private var _hoursAsleep:Int = 0;
// Gels internal clock // Gels internal clock
private var _clock:Clock; private var _clock:Clock;
@ -71,6 +73,7 @@ class Gel extends FlxSprite
FlxG.watch.add(this, "Sleepiness"); FlxG.watch.add(this, "Sleepiness");
FlxG.watch.add(this, "_isTired"); FlxG.watch.add(this, "_isTired");
FlxG.watch.add(this, "_isAsleep"); FlxG.watch.add(this, "_isAsleep");
FlxG.watch.add(this, "_hoursAsleep");
} }
override function update(elapsed:Float):Void override function update(elapsed:Float):Void
@ -90,12 +93,17 @@ class Gel extends FlxSprite
private function checkMood():Void private function checkMood():Void
{ {
if (Happiness >= 61) if (_isAsleep)
CurrentMood = HAPPY; CurrentMood == SLEEPING;
else if (Happiness >= 40 && Happiness <= 60) else
CurrentMood = NEUTRAL; {
else if (Happiness <= 39) if (Happiness >= 61)
CurrentMood = ANGRY; CurrentMood = HAPPY;
else if (Happiness >= 40 && Happiness <= 60)
CurrentMood = NEUTRAL;
else if (Happiness <= 39)
CurrentMood = ANGRY;
}
} }
private function checkNeed():Void private function checkNeed():Void
@ -109,14 +117,20 @@ class Gel extends FlxSprite
_isHungry = false; _isHungry = false;
// Waste Check // Waste Check
if(Waste > 75 && Waste < 100) if (Waste > 75 && Waste < 100)
_wasteReady = true; _wasteReady = true;
else if (Waste >= 100) else if (Waste >= 100)
makeWaste(); makeWaste();
else else
_wasteReady = false; _wasteReady = false;
// Sleepy Check
if (Sleepiness >= 90)
_isTired = true;
else
_isTired = false;
// Sets active needs
if (_isHungry) if (_isHungry)
CurrentNeed = HUNGRY; CurrentNeed = HUNGRY;
else if (_wasteReady) else if (_wasteReady)
@ -127,7 +141,6 @@ class Gel extends FlxSprite
CurrentNeed = NONE; CurrentNeed = NONE;
} }
public function EatFood():Void public function EatFood():Void
{ {
Wait = true; Wait = true;
@ -136,14 +149,14 @@ class Gel extends FlxSprite
if ((Fullness + 25) > 100) if ((Fullness + 25) > 100)
{ {
Happiness -= 5; // Unhappy from over feeding Happiness -= 5; // Unhappy from over feeding
Discipline -= 5;
// TODO: Play ashamed animationx // TODO: Play ashamed animationx
// TODO: Add another penelty
} }
else else
{ {
Fullness += 25; Fullness += 25;
Happiness += 10; Happiness += 10;
Discipline -=5; //Discipline -=5;
Waste +=5; Waste +=5;
} }
} }
@ -155,6 +168,7 @@ class Gel extends FlxSprite
{ {
Intellect++; Intellect++;
Happiness -= 5; Happiness -= 5;
Fullness -= 5;
Sleepiness += 15; Sleepiness += 15;
} }
_hasStudied = true; _hasStudied = true;
@ -162,7 +176,17 @@ class Gel extends FlxSprite
public function Sleep():Void public function Sleep():Void
{ {
if (!_isTired)
{
Happiness -= 5;
// TODO: Play ashamed animation
}
else
{
_isAsleep = true;
_isTired = false;
Sleepiness = 0;
}
} }
public function Praise():Void public function Praise():Void
@ -228,27 +252,63 @@ class Gel extends FlxSprite
_madeWaste = true; _madeWaste = true;
_wasteReady = false; _wasteReady = false;
} }
private function wakeUp():Void
{
_isAsleep = false;
_hoursAsleep = 0;
// Reset back to one of the 3 normal moods
checkMood();
if (CurrentMood == Mood.HAPPY)
Happiness -= 15;
else if (CurrentMood == Mood.NEUTRAL)
Happiness += 10;
else if (CurrentMood == Mood.ANGRY)
Happiness += 15;
Fullness -= 50;
Waste += 10;
checkRange();
}
private function newHour():Void private function newHour():Void
{ {
Fullness -= 10; if (!_isAsleep)
Sleepiness += 5;
if (!_madeWaste)
Waste += (FlxG.random.int(2, 5) * 5);
// TODO: Add other stat changing conditions
if (_isHungry)
Happiness -= 10;
if (_isTired)
{ {
Happiness -= 10; Fullness -= 10;
Discipline -= 5; Sleepiness += 5;
if (!_madeWaste)
Waste += (FlxG.random.int(2, 5) * 5);
// TODO: Add other stat changing conditions
if (_isHungry)
Happiness -= 10;
if (_isTired)
{
Happiness -= 10;
Discipline -= 5;
}
if (_madeWaste)
{
Happiness -=10;
Discipline -=10;
}
} }
if (_madeWaste) else
{ {
Happiness -=10; if (_hoursAsleep >= 9)
Discipline -=10; wakeUp();
else if (_hoursAsleep > 5 && _hoursAsleep < 9)
{
// Discipline determines chance of early wake up
if (FlxG.random.bool(Discipline))
wakeUp();
}
else
_hoursAsleep++;
} }
// Unlock menu options // Unlock menu options
_hasStudied = false; _hasStudied = false;

View File

@ -11,6 +11,7 @@ using flixel.util.FlxSpriteUtil;
// TODO: Make sure the HUD is just displaying & triggering Gel stuff // TODO: Make sure the HUD is just displaying & triggering Gel stuff
// TODO: Display in-game time
class HUD extends FlxTypedGroup<FlxSprite> class HUD extends FlxTypedGroup<FlxSprite>
{ {
// Top // Top
@ -178,6 +179,8 @@ class HUD extends FlxTypedGroup<FlxSprite>
_gel.animation.play("happy", false); _gel.animation.play("happy", false);
else if (_gel.CurrentMood == Gel.Mood.ANGRY) else if (_gel.CurrentMood == Gel.Mood.ANGRY)
_gel.animation.play("angry", false); _gel.animation.play("angry", false);
else if (_gel.CurrentMood == Gel.Mood.SLEEPING)
_gel.animation.play("sleeping", false);
if (_gel.CurrentNeed == Gel.Need.NONE) if (_gel.CurrentNeed == Gel.Need.NONE)
_sprThoughts.animation.play("none", false); _sprThoughts.animation.play("none", false);
@ -246,27 +249,33 @@ class HUD extends FlxTypedGroup<FlxSprite>
// FEED // FEED
case 1: case 1:
feedGel(); if (!_gel._isAsleep)
feedGel();
// TRAIN // Study
case 2: case 2:
studyGel(); if (!_gel._isAsleep)
studyGel();
// REST // REST
case 3: case 3:
sleepGel(); if (!_gel._isAsleep)
sleepGel();
// CHEER // CHEER
case 4: case 4:
praiseGel(); if (!_gel._isAsleep)
praiseGel();
// SCOLD // SCOLD
case 5: case 5:
scoldGel(); if (!_gel._isAsleep)
scoldGel();
// WIPE // WIPE
case 6: case 6:
wipeGel(); if (!_gel._isAsleep)
wipeGel();
// CONFIG // CONFIG
case 7: case 7:
@ -293,7 +302,7 @@ class HUD extends FlxTypedGroup<FlxSprite>
private function sleepGel():Void private function sleepGel():Void
{ {
itemJoin("S"); itemJoin("R");
_gel.Sleep(); _gel.Sleep();
_sprInteraction.fadeOut(2, itemLeave); _sprInteraction.fadeOut(2, itemLeave);
} }

View File

@ -3,9 +3,7 @@ package;
import flixel.FlxG; import flixel.FlxG;
import flixel.FlxSprite; import flixel.FlxSprite;
import flixel.FlxState; import flixel.FlxState;
import flixel.text.FlxText; import flixel.system.debug.FlxDebugger;
import flixel.ui.FlxButton;
import flixel.math.FlxMath;
class PlayState extends FlxState class PlayState extends FlxState
{ {
@ -15,6 +13,9 @@ class PlayState extends FlxState
private var _hud:HUD; private var _hud:HUD;
// DEBUG
FlxG.debugger.setLayout(FlxDebuggerLayout.RIGHT);
override public function create():Void override public function create():Void
{ {
_sprBackground = new FlxSprite(0, 0, AssetPaths.background__png); _sprBackground = new FlxSprite(0, 0, AssetPaths.background__png);