Something went wrong. Try again.
Bring back the colours and save the world!
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!--><object> <spriteName><undefined></spriteName> <solid>0</solid> <visible>-1</visible> <depth>-50</depth> <persistent>-1</persistent> <parentName><undefined></parentName> <maskName><undefined></maskName> <events> <event eventtype="0" enumb="0"> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///Don't make duplicate controllersif(instance_number(Controller) > 1) { instance_destroy();}// Don't allow game jolt to be initialized many timesinitGameJolt = true;</string> </argument> </arguments> </action> </event> <event eventtype="2" enumb="0"> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///Restart the game after the endaudio_stop_all();event_perform(ev_other, ev_game_start); //Clear valuesroom_goto(rSetup);</string> </argument> </arguments> </action> </event> <event eventtype="3" enumb="2"> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///Change backgrounds and tilesetsif(room == rWhite) { if(GameJolt && useGameJolt) { gj_trophy_add("11575"); } image_blend = c_white; background_color = c_white;}if(GameJolt && useGameJolt) { switch(coltonum(image_blend)) { case BLACK: gj_trophy_add("11569"); break; case RED: gj_trophy_add("11570"); break; case GREEN: gj_trophy_add("11571"); break; case BLUE: gj_trophy_add("11572"); break; case YELLOW: gj_trophy_add("11573"); break; case BROWN: gj_trophy_add("11574"); break; } }background_color = image_blend;if(coltonum(image_blend) != noone && coltonum(image_blend) != 100) { colours[coltonum(image_blend)] = true;} else if(coltonum(image_blend) == 100) { if(room == rPit || room == rCavern || room == rCavernExit || room == rSecretPassage || room == rCave) { background_color = c_dkgray; } else if(room == rHouse) { background_color = make_color_rgb(255, 204, 153); } else { background_color = image_blend; }}if(instance_exists(ColorLimit)) { ColorLimit.colours[coltonum(image_blend)] = true;}set_tiles();</string> </argument> </arguments> </action> </event> <event eventtype="3" enumb="0"> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///Choose message based on state and room and stuffvar prevMsg = msg; if(room == rGreenStart || room == rValley) { switch(state[2]) { case S_BEGIN: msg = "This is a nice valley. Maybe there is a colour down there."; break; case S_GREENFALL: msg = "Falling again...\nYay."; break; case S_VALLEYBOTTOM: if(room == rGreenStart) { msg = "I hope this is the bottom..."; } else { msg = "I think I see a spark on that ledge. How do I get up there?"; } break; case S_TORCHES: if(room == rValley) { if(colours[GREEN]) { msg = "Ahh. Good to have this one back. I like green a lot."; } else { msg = "That is very cool. I wonder how it works.\nAnd now I can reach the ledge!"; } } else { msg = "It's a long way back up... I'd best get going."; } break; case S_VALLEYOUT: msg = "Finally made it. That was a lot of work...\nBut for the green it was worth it."; break; }} else if(room == rYellowStart || room == rFarmHouse) { switch(state[1]) { case S_BEGIN: msg = "That looks like an orchard! I wonder if the farmer is nearby.\nHe might know where to find a colour."; break; case S_FARMER: if(!colours[RED] || !colours[GREEN] || !colours[BROWN]) { msg = '"You there! My apple trees have gone all white. Help me fix them!\nMaybe I will give you something..." - The Farmer'; } else { msg = '"The colours have returned to the trees! Whoever did this\ncome speak to me" - The Farmer'; } break; case S_HAPPYFARMER: if(room == rFarmHouse) { msg = "I wonder what he has in here for me. I hope it's good!"; } else { msg = '"Was it you who fixed the trees? Go inside,\nI have something there for you." - The Farmer'; } break; case S_FARMERYELLOW: if(room == rFarmHouse) { msg = "Wow. He has yellow in his barn! It's still so bright..."; } else { msg = '"Thank you very much for fixing the trees. You have saved my orchard!"\n- The Farmer'; } break; }} else if(room == rBrownStart || room == rBrownFind || room == rBrownOut) { switch(state[3]) { case S_BEGIN: if(room == rBrownStart) { if(colours[BROWN]) { msg = "Now to get back out. It must have something to do with the boxes."; } else { msg = "An underwater cave... It's very damp in here.\nI wonder what colour might be down there."; } } else if(room == rBrownFind) { if(colours[BROWN]) { msg = "Oh. That box is floating. I guess brown weighs less?"; } else { msg = "I see it over there. The brown.\nI wonder what it does."; } } else if(room = rBrownOut) { msg = "I haven't been here before... Maybe it goes up."; } break; case S_BROWNFALL: msg = "This doesn't seem like up... I guess I have to go forward now."; break; case S_PUZZLE: msg = "This is quite complicated. Who would have built a place like this?"; break; case S_BROWNTORCH: msg = "It feels like something moved somewhere. I should look around."; break; case S_BROWNEXIT: if(room == rBrownOut) { msg = "I see the door down there. I guess this was the way out."; } else { msg = "I think this is almost it. The exit shouldn't be far now..."; } break; }} else { switch(state[0]) { case S_BEGIN: msg = "What's that thing over there? It isn't white... Should I touch it?\nI think I use the Arrow Keys to walk."; if(Mobile) { msg = "What's that thing over there? It isn't white... Should I touch it?\nI think I touch the sides of the screen to walk."; } break; case S_BLACK: msg = "Whoa. That's new... I think I'll call this black.\nWhat's that up on the ledge?"; if(Mobile) { msg = "Whoa. That's new... I think I'll call this black.\nWhat's that up on the ledge? I should try touching both sides."; } break; case S_SOUND: if(image_blend == c_black) { msg = "I thought I lost these headphones long ago.\nAnd they still work too!"; } else if(image_blend == c_white) { msg = "There's a door up there now! I wonder what's outside..."; } break; case S_DOOR: msg = "There's another one over there! I should go get it!"; break; case S_FALL: if(room == rLongFall) { msg = "Well. Looks like I'll be late for dinner tonight...\nLet's look around down here."; } else if(room == rBottom) { msg = "That one looks funny. Its not white or black. Maybe... red?"; } break; case S_RED: msg = "Those things on the ground... They changed too.\nI wonder what else I can do."; break; case S_SWITCH: msg = "What does that switch do. I should try it."; break; case S_ENTERCAVE: if(room == rCaveEntrance) { msg = "Well that was disappointing.\nThis cave looks more interesting though."; } else if(room == rCave) { msg = "It's really dark in here... I'll have to be careful."; } else { msg = "I should go check out that cave."; } break; case S_CAVE: msg = "Why do I keep falling down things.\nI hope there's a way out of this cave."; break; case S_GREEN: msg = "Hey another spark. This one feels kind of like...\nGreen"; break; case S_LIFT: if(room == rCave) { msg = "Wow, this one actually works.\nI wonder if it's because of the green?"; } else if(room == rCaveEntrance) { msg = "Maybe this lift will work now too..!"; } else if(room == rMountain) { msg = "Looks like a long way up..."; } break; case S_BLUE: msg = "This one I will call blue.\nWhere are all these coming from?"; break; case S_WATER: if(room == rMountain) { msg = "This passage is new... Why is it so wet in here?"; } else if(room == rMountainLake) { msg = "There's a whole lake hidden on this mountain.\nAm I the first person to ever come here?"; } break; case S_PIRATE: if(room == rMountainLake) { msg = '"YARR! I be a pirate! I also be stuck on this ledge!"\n- The Pirate'; } else if(room == rField) { msg = "I guess that pirate is in a bit of a jam.\nI should try and help him out later."; } break; case S_PIT: if(room == rPit) { msg = "Really? Again? They should block off some of these holes..."; } else if(room == rCavern) { msg = "I guess I'll have to work on finding a way out of here now."; } break; case S_TOODARK: msg = "What's that thing? If only there was more light in this cave."; break; case S_YELLOW: msg = "This one is really bright. It's so... yellow."; break; case S_LIGHTS: msg = '"WHA! Who turned on the lights? They should be broken...\nIs the Machine not working any more?" - The Mechanic'; break; case S_MACHINE: if(room == rCavern) { msg = '"It was you! You broke the Machine! The colours cannot come back!"\n- The Mechanic'; } else if(room == rCavernExit) { msg = 'He said "The colours cannot come back"... Does that mean...\nThere used to be colours and he stole them all? How terrible.'; } break; case S_FIXING: if(room == rCavernExit) { msg = "I can hear him starting to fix it... I'll have find a way to stop him.\nLet's look around outside."; } else if(room == rBeach) { msg = "Wow. That's a lot of water. It's really pretty.\nThis would be a nice place to live. Maybe someone is nearby?"; } else if(room == rHouse) { msg = '"Hello? Who just barged into my house? Show yourself!"\n- The Old Guy'; } break; case S_ELDER: msg = '"Oh hello there young one. I see the colours are returning!\nI remember when there used to always be colour." - The Old Guy'; break; case S_BROWN: case S_SHAKING: if(room == rHouse) { msg = "This wasn't here a moment ago... Let's call it brown.\nI wonder if there are any more that will appear."; } else if(room == rBeach) { msg = "Wow. Everything looks so nice. I like these colours!"; } break; case S_COLGONE: if(room != rHouse) { msg = '"HELP! Everything is just white again!"\n- The Old Guy'; } else if(room == rHouse) { msg = '"Young one, you have returned! Come here!"\n- The Old Guy'; } break; case S_INTROOVER: if(room == rHouse) { msg = '"I believe the Mechanic has fixed the Machine again...\nI trust you to break it once and for all!" - The Old Guy'; } else if(room == rBeach) { msg = "Break the Machine huh. I guess I have to go back to that cavern then."; } else if(room == rCavern) { if(background_color == c_black) { msg = '"Welcome back. I fixed the Machine. The colours will never return!"\n- The Mechanic'; } else { msg = '"Oh no. You better not be about to..."\n- The Mechanic'; } } break; case S_DESTROYED: if(room == rCavern) { msg = '"You FOOL! The parts for the Machine are extremely rare.\nThere is no way I will ever repair it again..." - The Mechanic'; } else if(room == rSecretPassage) { msg = "Wow there's a secret passage in here.\nWhat's on the other side?"; } else if(room == rSplit) { msg = "Oh. Lots of stuff. How did I get sucked into this whole thing.\nI've started now, so I guess I have to save the colours."; } break; case S_SEARCHSTART: if(room == rSplit) { msg = "I have to find all the 5 colours. Which way next?"; } else if(room == rBlueStart) { if(colours[BLUE]) { msg = "The blue! The water is probably good now. Maybe it will lead me out."; } else { msg = "I wonder if there is a colour somewhere in this cave..."; } } else if(room == rRedStart) { if(colours[RED]) { msg = "So the red can also make heat. And I remember yellow can make light.\nMaybe the other colours have special properties too."; } else { msg = "Brr... It's cold up here. I hope there's a colour somewhere nearby."; } } else if(room == rRedDown) { if(colours[RED]) { msg = "I found red! Now how will I get back up there?"; } else { msg = "Looks like a long way down. I don't have much choice though..."; } } break; case S_COLBACK: if(room == rSplit) { msg = "That's all of them. The world is so beautiful!\nTime to go back to the other side of the mountain."; } else if(room == rSecretPassage) { msg = "The secret passage has caved in! Must have been all that\nshaking down below. I guess I have to go up there then..."; } else if(room == rCavein) { msg = "I can probably make it out through here...\nIt might be difficult though..."; } break; case S_FIRSTTRIAL: if(room == rFirstTrial) { msg = "The colours are gone! Some of them anyway... How strange."; } else { msg = "It's still colourful out here..."; } break; case S_SECONDTRIAL: if(room == rSecondTrial) { msg = "And now they're gone again!"; } else { msg = "This is very odd. The colours keep coming and going.\nMaybe they just have to settle in again?"; } break; case S_THIRDTRIAL: if(room == rThirdTrial) { msg = "How far down does this cave go? I'll never get out like this..." } else { msg = "Oh good, I made it back up. I hope there's a way out of this cave"; } break; case S_FOURTHTRIAL: if(room == rFourthTrial) { msg = "It seems there is no going back now... Maybe it's not much further!"; } else { msg = "Aha! I can finally see the exit!"; } break; case S_TRIALSDONE: if(room == rMountainLake) { msg = '"YARR! I be a pirate! The door is back, matey. I be outta here soon!"\n- The Pirate'; } else { msg = "Ugh. I don't like this cave.\nI don't think I can go back very far anyway."; } break; case S_HAPPYPIRATE: if(room == rMountainLake || room == rField) { msg = "I've been here before... I think the Old Guy isn't too far away.\nI should go find him"; } else if(room == rPit || room == rCavern) { msg = "Oh yes I remember this...\nThe Mechanic probably won't be happy to see me..."; } else { msg = "I'm pretty sure the Old Guy was the other way..."; } break; case S_ANGRYMECHANIC: if(room == rCavern) { msg = '"You are still alive?! How did you get out after I blew up the passage?"\n- The Mechanic'; } else if(room == rCavernExit) { msg = "So the cave in was because he blew up the passage...\nThat guy has something really wrong with him."; } else if(room == rBeach) { msg = "There's the Old Guy's house! I hope he's happy with all the colours back!"; } else if(room == rHouse) { msg = '"Welcome back sonny! Come up here!"\n- The Old Guy'; } break; case S_HAPPYOLDGUY: if(room == rHouse) { msg = '"The colours are all back! You did it! Go to the island just off the shore.\nI have something waiting for you there." - The Old Guy'; } else if(room == rBeach) { msg = "The island off shore, huh? I wonder what it could be."; } else if(room == rEnd) { msg = '"This door will take you back home, though it is only good one way.\nStep through when you are ready..." - The Old Guy'; } else if(room == rLongFall || room == rWhite) { msg = "That was quite the adventure... But you know what..?\nI kind of liked the world when everything was all just"; } else { msg = "This world is so nice now that the colours are all back..."; } break; default: msg = "What was I doing again?"; break; }}msg = string_replace_all(msg, "\n", "# ");if(prevMsg != msg) { msgPos = 0;}</string> </argument> </arguments> </action> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///Start the gameif(room == rSetup) { if(input_check_pressed(I_ACTION)) { if(keyboard_string != "" && GameJolt && !useGameJolt) { var username = string_copy(keyboard_string, 1, string_pos("#", keyboard_string) - 1); var token = string_copy(keyboard_string, string_pos("#", keyboard_string) + 1, string_length(keyboard_string)); GameJoltLoginHandle = gj_user_login(username, token); } instance_create(32, 416, Player); room_goto(rHome); } else if(input_check_pressed(I_JUMP)) { if(keyboard_string != "" && GameJolt && !useGameJolt) { var username = string_copy(keyboard_string, 1, string_pos("#", keyboard_string) - 1); var token = string_copy(keyboard_string, string_pos("#", keyboard_string) + 1, string_length(keyboard_string)); GameJoltLoginHandle = gj_user_login(username, token); } if(file_exists(working_directory + "white.sav")) { var in = file_text_open_read(working_directory + "white.sav"); var out = file_text_open_write(working_directory + "temp.ini"); while(!file_text_eof(in)) { file_text_write_string(out, decrypt(file_text_read_string(in))); file_text_readln(in); file_text_writeln(out); } file_text_close(out); file_text_close(in) ini_open(working_directory + "temp.ini"); var xx = ini_read_real("game", "x", -1), yy = ini_read_real("game", "y", -1), cc = ini_read_real("game", "c", -1), rr = ini_read_real("game", "r", noone), if(xx != -1 && yy != -1 && cc != -1 && room_exists(rr)) { instance_create(xx, yy, Player); image_blend = cc; for(var i = 0; i < array_length_1d(state); i++) { state[i] = ini_read_real("game", string(i), 0); } for(var i = 0; i < array_length_1d(colours); i++) { colours[i] = ini_read_real("game", string(i) + "_2", 0); } set_tiles(); room_goto(rr); } ini_close(); file_delete(working_directory + "temp.ini"); } }}</string> </argument> </arguments> </action> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///Shake the screenif(shake != 0) { if(shakeSound == noone) { shakeSound = audio_play_sound(aShake, 0, false); audio_sound_gain(shakeSound, 0.6, 0); } view_enabled = true; view_visible[0] = true; view_object[0] = noone; view_xview[0] = median(Player.x - view_wview[0] / 2, 0, room_width - view_wview[0]) + choose(-1, 1) * (shake / 10); view_yview[0] = median(Player.y - view_hview[0] / 2, 0, room_height - view_hview[0]) + choose(-1, 1) * (shake / 10); shake--;} else { shakeSound = noone; if(instance_exists(Player)) { view_object[0] = Player; view_hborder[0] = 1000; view_vborder[0] = 1000; }}</string> </argument> </arguments> </action> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///Run the music/* Without the position function */if(state[0] >= S_SOUND) { if(!audio_is_playing(music[WHITE])) { music[WHITE] = audio_play_sound(aWhite, 0, true); music[BLACK] = audio_play_sound(aBlack, 0, true); music[RED] = audio_play_sound(aRed, 0, true); music[GREEN] = audio_play_sound(aGreen, 0, true); music[BLUE] = audio_play_sound(aBlue, 0, true); music[YELLOW] = audio_play_sound(aYellow, 0, true); music[BROWN] = audio_play_sound(aBrown, 0, true); for(var i = WHITE; i <= BROWN; i++) { audio_sound_gain(music[i], 0, 0); } } if(coltonum(image_blend) == 100) { //Balance song nicely for the ending if(room != rWhite) { if(music_gain[WHITE] != 0.5) { audio_sound_gain(music[WHITE], 0.5, 500) music_gain[WHITE] = 0.5; } if(music_gain[BLACK] != 0.7) { audio_sound_gain(music[BLACK], 0.7, 500); music_gain[BLACK] = 0.7; } if(music_gain[RED] != 0.4) { audio_sound_gain(music[RED], 0.4, 500); music_gain[RED] = 0.4; } if(music_gain[GREEN] != 0.5) { audio_sound_gain(music[GREEN], 0.5, 500); music_gain[GREEN] = 0.5; } if(music_gain[BLUE] != 0.8) { audio_sound_gain(music[BLUE], 0.8, 500); music_gain[BLUE] = 0.8; } if(music_gain[YELLOW] != 0.8) { audio_sound_gain(music[YELLOW], 0.8, 500); music_gain[YELLOW] = 0.8; } if(music_gain[BROWN] != 0.3) { audio_sound_gain(music[BROWN], 0.3, 500); music_gain[BROWN] = 0.3; } } else { if(music_gain[WHITE] != 0) { audio_sound_gain(music[WHITE], 0, 5000); audio_sound_gain(music[BLACK], 0, 5000); audio_sound_gain(music[RED], 0, 5000); audio_sound_gain(music[GREEN], 0, 5000); audio_sound_gain(music[BLUE], 0, 5000); audio_sound_gain(music[YELLOW], 0, 5000); audio_sound_gain(music[BROWN], 0, 5000); music_gain[WHITE] = 0; } } } else if(room != rWhite) { for(var i = WHITE; i <= BROWN; i++) { if(!colours[i]) { audio_sound_gain(music[i], 0, 0); music_gain[i] = 0; } else { if(coltonum(image_blend) == i) { if(music_gain[i] <= 0.2) { audio_sound_gain(music[i], 0.5, 500); } music_gain[i] = 0.5; } else if(coltonum(image_blend) != noone) { if(music_gain[i] != 0.2) { audio_sound_gain(music[i], 0.2, 500); } music_gain[i] = 0.2; } } } }} else { //Stop only the music if the earphones aren't collected yet. Other things still make full sound if(music[WHITE] != noone) { if(audio_is_playing(music[WHITE])) { audio_stop_sound(music[WHITE]); music[WHITE] = noone; } } if(music[BLACK] != noone) { if(audio_is_playing(music[BLACK])) { audio_stop_sound(music[BLACK]); music[BLACK] = noone; } } if(music[RED] != noone) { if(audio_is_playing(music[RED])) { audio_stop_sound(music[RED]); music[RED] = noone; } } if(music[GREEN] != noone) { if(audio_is_playing(music[GREEN])) { audio_stop_sound(music[GREEN]); music[GREEN] = noone; } } if(music[BLUE] != noone) { if(audio_is_playing(music[BLUE])) { audio_stop_sound(music[BLUE]); music[BLUE] = noone; } } if(music[YELLOW] != noone) { if(audio_is_playing(music[YELLOW])) { audio_stop_sound(music[YELLOW]); music[YELLOW] = noone; } } if(music[BROWN] != noone) { if(audio_is_playing(music[BROWN])) { audio_stop_sound(music[BROWN]); music[BROWN] = noone; } }}</string> </argument> </arguments> </action> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///Pulse and shake when the machine is fixedif(state[0] == S_BROWN) { if(msgPos <= string_length(msg)) { if(string_copy(msg, msgPos, 1) == "!") { shake = 36 * 3; pulseCount = 3; pulseColor = c_white; state_set(S_SHAKING); } }} else if(state[0] == S_SHAKING) { if(pulseCount == 1) { if(power(sin(degtorad(pulseAlpha)) + 1, 2) == 4) { for(var i = array_length_1d(colours); i > 0; i--) { colours[i] = false; } image_blend = c_white; background_assign(tsUse, tsW); state_set(S_COLGONE); } }}</string> </argument> </arguments> </action> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///Close with ALT-F4if(keyboard_check_direct(vk_alt) && keyboard_check_pressed(vk_f4)) { game_end();}</string> </argument> </arguments> </action> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>/// Game Jolt stuffif(useGameJolt) { if(!gameJoltTimer--) { gj_session_ping(true); gameJoltTimer = 30 * room_speed; }}</string> </argument> </arguments> </action> </event> <event eventtype="7" enumb="62"> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///Game Jolt API call returnsvar resultID = gj_result_id();if(resultID = GameJoltLoginHandle) { if(gj_result_status() == 1) { if(gj_user_isloggedin()) { useGameJolt = true; } } else { GameJoltLoginFailedTimer = room_speed * 5; }}</string> </argument> </arguments> </action> </event> <event eventtype="7" enumb="4"> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///Move Player to doorif(instance_exists(Player)) { if(destID != -1) { with(Door) { if(thisID == other.destID) { Player.x = x; Player.y = y; } } }}destID = -1;</string> </argument> </arguments> </action> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///Change state for various events//Start searching for colours againif(room == rRedStart || room == rBlueStart || room == rGreenStart || room == rYellowStart || room == rBrownStart) { state_set(S_SEARCHSTART);}if(room == rYellowStart) { if(colours[YELLOW]) { state_set(S_COLBACK); }}if(room == rFirstTrial) { state_set(S_FIRSTTRIAL);}if(room == rSecondTrial) { state_set(S_SECONDTRIAL);}if(room == rMountainLake) { state_set(S_TRIALSDONE);}</string> </argument> </arguments> </action> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///Events for ending and title screens//Fade in textif(room == rSetup || room == rWhite) { image_alpha = 0;} else if(room == rLongFall && state[0] >= S_HAPPYOLDGUY) { image_alpha = -1;}
//Return to beginning after a whileif(room == rWhite) { alarm[0] = room_speed * 10;}</string> </argument> </arguments> </action> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///Save on room startif(room != rSetup && room != rWhite && room != rHome) { save();}</string> </argument> </arguments> </action> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///Mobile stuffif(Mobile) { if(room != rSetup) { virt_key_left = virtual_key_add(0, 0, display_get_width() / 2, display_get_height(), vk_left); virt_key_right = virtual_key_add(display_get_width() / 2, 0, display_get_width() / 2, display_get_height(), vk_right); virt_key_down = virtual_key_add(0, 0, 0, 0, vk_down); virtual_key_delete(virt_key_up); } else { virt_key_up = virtual_key_add(0, 0, display_get_width(), display_get_height() / 2, vk_up); virt_key_down = virtual_key_add(0, display_get_height() / 2, display_get_width(), display_get_height() / 2, vk_down); } view_enabled = true; view_visible[0] = true; view_wview[0] = 640; view_hview[0] = display_get_height(); view_wport[0] = view_wview[0]; view_hport[0] = view_hview[0]; if(instance_exists(Player)) { view_object[0] = Player; view_hborder[0] = 1000; view_vborder[0] = 1000; view_hspeed[0] = -1; view_vspeed[0] = -1; } surface_resize(application_surface, view_wport[0], view_hport[0]);}</string> </argument> </arguments> </action> </event> <event eventtype="7" enumb="3"> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///End Game Jolt stuffif(GameJolt && useGameJolt) { gj_session_close(); gj_user_logout();}</string> </argument> </arguments> </action> </event> <event eventtype="7" enumb="2"> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///InitializeuseGameJolt = GameJolt;gameJoltTimer = 0;GameJoltLoginFailedTimer = 0;GameJoltLoginHandle = noone;GameJoltTrophyHandle = noone;if(initGameJolt && useGameJolt) { //Set in Create to prevent being initalized twice gj_init("35169", "5be9b80b7ebd9a82c2715aa84e3357c3"); // Game Jolt API gj_user_autologin() if(!gj_user_isloggedin()) { // Check for user login by Quick Play useGameJolt = false; } if(useGameJolt) { gj_session_open(); } keyboard_string = ""; initGameJolt = false;}
virt_key_left = noone;virt_key_right = noone;virt_key_up = noone;virt_key_down = noone;
c_brown = make_color_rgb(75, 50, 25);
shake = 0;shakeSound = noone;
pulseCount = 0;pulseColor = noone;pulseAlpha = 0;
msgPos = 0;msgSpd = 2;msg = "";
state[3] = S_BEGIN;state[2] = S_BEGIN;state[1] = S_BEGIN;state[0] = S_BEGIN;
/*background_save(tsW, working_directory + "tsW.png");background_save(tsBW, working_directory + "tsBW.png");background_save(tsBWG, working_directory + "tsBWG.png");background_save(tsBWR, working_directory + "tsBWR.png");background_save(tsBWRG, working_directory + "tsBWRG.png");background_save(tsBWRN, working_directory + "tsBWRN.png");background_save(tsBWRGY, working_directory + "tsBWRGY.png");background_save(tsBWRGN, working_directory + "tsBWRGN.png");background_save(tsBWRGYN, working_directory + "tsBWRGYN.png");
background_replace(tsUse, working_directory + "tsW.png", true, false);*/
destID = -1;
colours[BROWN] = false;colours[YELLOW] = false;colours[BLUE] = false;colours[GREEN] = false;colours[RED] = false;colours[BLACK] = false;colours[WHITE] = true;
music[BROWN] = noone;music[YELLOW] = noone;music[BLUE] = noone;music[GREEN] = noone;music[RED] = noone;music[BLACK] = noone;music[WHITE] = noone;
music_gain[BROWN] = 0;music_gain[YELLOW] = 0;music_gain[BLUE] = 0;music_gain[GREEN] = 0;music_gain[RED] = 0;music_gain[BLACK] = 0;music_gain[WHITE] = 0;
musicResetOk[BROWN] = true;musicResetOk[YELLOW] = true;musicResetOk[BLUE] = true;musicResetOk[GREEN] = true;musicResetOk[RED] = true;musicResetOk[BLACK] = true;musicResetOk[WHITE] = true;
image_blend = c_white;
randomize();
//Optimization//draw_set_alpha_test(true);//draw_set_alpha_test_ref_value(0);if(os_browser != browser_not_a_browser) { if(!webgl_enabled) { application_surface_enable(false); } sprite_set_cache_size(sPlayer, ceil(sqrt(116))); sprite_set_cache_size(sBird, 5); sprite_set_cache_size(sButterfly, 5);}</string> </argument> </arguments> </action> </event> <event eventtype="8" enumb="64"> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///Title Screenif(room == rSetup) { draw_set_font(fTitle); draw_set_halign(fa_center); draw_set_color(c_black); draw_text(room_width / 2, 100, "White"); draw_set_font(fDefault); image_alpha = min(image_alpha + 1/room_speed, 1); draw_set_alpha(image_alpha); draw_text(room_width / 2, 200, "Press the Down Arrow key to begin"); if(file_exists(working_directory + "\white.sav")) { draw_text(room_width / 2, 150, "Press the Up Arrow key to load"); } if(GameJolt && !useGameJolt) { draw_text(room_width / 2, 250, "GameJolt login? Type username, hit Enter, and then token."); if(keyboard_check_pressed(vk_enter)) { keyboard_string += "#"; } if(string_count("#", keyboard_string) > 1) { //Clip anything past the first # keyboard_string = string_copy(keyboard_string, 1, string_pos("#", keyboard_string) + string_pos("#", string_copy(keyboard_string, string_pos("#", keyboard_string) + 1, string_length(keyboard_string))) - 1); } draw_text(room_width / 2, 282, keyboard_string + "_"); } draw_set_alpha(1); draw_set_halign(fa_left);}</string> </argument> </arguments> </action> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///End Screenif(room == rWhite) { draw_set_font(fTitle); draw_set_halign(fa_center); draw_set_color(c_black); image_alpha = min(image_alpha + 1/(room_speed * 3), 1); draw_set_alpha(image_alpha); draw_text(room_width / 2, 100, "White"); draw_set_font(fDefault); draw_set_halign(fa_right); draw_set_valign(fa_bottom); draw_text(room_width - 5, room_height - 5, "(c) 2014 - A Game by Cameron Eldridge."); draw_set_alpha(1); draw_set_halign(fa_left); draw_set_valign(fa_top);} else if(room == rLongFall && state[0] >= S_HAPPYOLDGUY) { image_alpha = min(image_alpha + 1/136 * 2, 1); draw_set_alpha(image_alpha); draw_set_color(c_white); draw_rectangle(0, 0, view_wview[0], view_hview[0], false); draw_set_alpha(1);}</string> </argument> </arguments> </action> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///Pulse colorsif(pulseColor != noone) { pulseAlpha = (pulseAlpha + 10) % 360 draw_set_alpha(power(sin(degtorad(pulseAlpha)) + 1, 2) / 4); draw_set_color(pulseColor); draw_rectangle(0, 0, window_get_width(), window_get_height(), false); draw_set_alpha(1); if(pulseAlpha == 0) { pulseCount--; if(pulseCount == 0) { pulseColor = noone; } }}</string> </argument> </arguments> </action> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///Draw thoughtsif(room != rSetup) { draw_set_color(c_ltgray); draw_set_font(fDefault); var alphas, cAlpha = 0, cX = 5, cY = 5, substr = ""; msgPos = min(msgPos + 1, string_length(msg) - 1 + 10); alphas[msgPos] = 0; for(var i = msgPos; i >= 0; i--) { alphas[i] = cAlpha; cAlpha += 0.1; } for(var i = 0; i < min(msgPos, string_length(msg)); i++) { substr = string_copy(msg, i + 1, 1); if(substr == "#") { cX = 5; cY += string_height("A"); } else { draw_set_alpha(alphas[i]); draw_text(cX, cY, substr); cX += string_width(substr); } } draw_set_alpha(1);}</string> </argument> </arguments> </action> <action> <libid>1</libid> <id>603</id> <kind>7</kind> <userelative>0</userelative> <isquestion>0</isquestion> <useapplyto>-1</useapplyto> <exetype>2</exetype> <functionname></functionname> <codestring></codestring> <whoName>self</whoName> <relative>0</relative> <isnot>0</isnot> <arguments> <argument> <kind>1</kind> <string>///Draw error if Game Jolt login failedif(GameJolt && GameJoltLoginFailedTimer != 0) { draw_text(32, view_hport[0] - 32, "Game Jolt login failed. Restart the game to try again."); GameJoltLoginFailedTimer--;}</string> </argument> </arguments> </action> </event> </events> <PhysicsObject>0</PhysicsObject> <PhysicsObjectSensor>0</PhysicsObjectSensor> <PhysicsObjectShape>0</PhysicsObjectShape> <PhysicsObjectDensity>0.5</PhysicsObjectDensity> <PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution> <PhysicsObjectGroup>0</PhysicsObjectGroup> <PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping> <PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping> <PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction> <PhysicsObjectAwake>-1</PhysicsObjectAwake> <PhysicsObjectKinematic>0</PhysicsObjectKinematic> <PhysicsShapePoints> <point>12,32</point> <point>16,16</point> </PhysicsShapePoints></object>