Something went wrong. Try again.
Bring back the colours and save the world!
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437<!--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>-1</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>///Initializeif(instance_number(ShadowController) > 1) { //No duplicates instance_destroy();}shadows = noone;current[0] = noone;wallCount = 0;newRoom = false;</string> </argument> </arguments> </action> </event> <event eventtype="7" enumb="5"> <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>///Clear surfacesfor(var i = 0; i < array_length_1d(current); i++) { if(surface_exists(current[i])) { surface_free(current[i]); }}</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>///Always redraw on new roomnewRoom = true;for(var i = 0; i < instance_number(Lightbulb); i++) { current[i] = surface_create(2048, 2048);}</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>///Free surfacesif(surface_exists(shadows)) { surface_free(shadows);}for(var i = 0; i < array_length_1d(current); i++) { if(surface_exists(current[i])) { surface_free(current[i]); }}</string> </argument> </arguments> </action> </event> <event eventtype="8" 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>///Draw shadows of wallsvar redraw = newRoom;newRoom = false;if(webgl_enabled == true || os_browser == browser_not_a_browser) { if(!surface_exists(shadows)) { shadows = surface_create(2048, 2048); redraw = true; } else if(instance_number(Wall) != wallCount) { wallCount = instance_number(Wall); redraw = true; } else { with(Wall) { if(moved) { redraw = true; moved = false; } } with(Lightbulb) { if(beenlit) { redraw = true; beenlit = false; } } } if(Controller.colours[BLACK]) { if(redraw) { surface_set_target(shadows); draw_clear_alpha(c_black, 0); draw_set_color(c_black); draw_set_alpha(1); //Straight below with(Wall) { if(visible) { draw_rectangle(bbox_left, bbox_bottom, bbox_right + (webgl_enabled && os_browser != browser_not_a_browser), room_height, false); } } surface_reset_target(); //Each light for(var i = 0; i < instance_number(Lightbulb); i++) { if(array_length_1d(current) <= i) { current[i] = noone; } if(!surface_exists(current[i])) { current[i] = surface_create(2048, 2048); } var inst = instance_find(Lightbulb, i); surface_set_target(current[i]); if(inst.lit) { draw_clear_alpha(c_black, 0); with(Wall) { var x0 = bbox_left, x1 = bbox_right, y0 = bbox_top, y1 = bbox_bottom; if(visible) { //From top edge var m = 0, dist, dest; dist[1] = 0; dest[1] = 0; if(y0 >= inst.y) { if(inst.y != y0) { m = (x0 - inst.x) / (y0 - inst.y); } else { m = 0; } if(inst.y < y0) { dist[0] = (room_height - y0) * m; dest[0] = room_height; } else if(inst.y > y0) { dist[0] = y0 * -m; dest[0] = 0; } else { dist[0] = 0; dest[0] = y0; } if(inst.y != y0) { m = ((x1 + 1) - inst.x) / (y0 - inst.y); } else { m = 0; } if(inst.y < y0) { dist[1] = (room_height - y0) * m; dest[1] = room_height; } else if(inst.y > y0) { dist[1] = y0 * -m; dest[1] = 0; } else { dist[1] = 0; dest[1] = y0; } draw_primitive_begin(pr_trianglestrip); draw_vertex(x0, y0); draw_vertex(x1 + 1, y0); draw_vertex(x0 + dist[0], dest[0]); draw_vertex(x1 + 1 + dist[1], dest[1]); draw_primitive_end(); } //From bottom edge if(y1 <= inst.y) { if(inst.y != (y1 + 1)) { m = (x0 - inst.x) / ((y1 + 1) - inst.y); } else { m = 0; } if(inst.y < (y1 + 1)) { dist[0] = (room_height - (y1 + 1)) * m; dest[0] = room_height; } else if(inst.y > (y1 + 1)) { dist[0] = (y1 + 1) * -m; dest[0] = 0; } else { dist[0] = 0; dest[0] = (y1 + 1); } if(inst.y != (y1 + 1)) { m = ((x1 + 1) - inst.x) / ((y1 + 1) - inst.y); } else { m = 0; } if(inst.y < (y1 + 1)) { dist[1] = (room_height - (y1 + 1)) * m; dest[1] = room_height; } else if(inst.y > (y1 + 1)) { dist[1] = (y1 + 1) * -m; dest[1] = 0; } else { dist[1] = 0; dest[1] = (y1 + 1); } draw_primitive_begin(pr_trianglestrip); draw_vertex(x0, y1 + 1); draw_vertex(x1 + 1, y1 + 1); draw_vertex(x0 + dist[0], dest[0]); draw_vertex(x1 + 1 + dist[1], dest[1]); draw_primitive_end(); } //From left side if(x0 >= inst.x) { if(inst.x != x0) { m = (y0 - inst.y) / (x0 - inst.x) } else { m = 0; } if(inst.x < x0) { dist[0] = (room_width - x0) * m; dest[0] = room_width; } else if(inst.x > x0) { dist[0] = x0 * -m; dest[0] = 0; } else { dist[0] = 0; dest[0] = x0; } if(inst.x != x0) { m = ((y1 + 1) - inst.y) / (x0 - inst.x); } else { m = 0; } if(inst.x < x0) { dist[1] = (room_width - x0) * m; dest[1] = room_width; } else if(inst.x > x0) { dist[1] = x0 * -m; dest[1] = 0; } else { dist[1] = 0; dest[1] = x0; } draw_primitive_begin(pr_trianglestrip); draw_vertex(x0, y0); draw_vertex(x0, y1 + 1); draw_vertex(dest[0], y0 + dist[0]); draw_vertex(dest[1], y1 + 1 + dist[1]); draw_primitive_end(); } //From right side if(x1 <= inst.x) { if(inst.x != (x1 + 1)) { m = (y0 - inst.y) / ((x1 + 1) - inst.x) } else { m = 0; } if(inst.x < (x1 + 1)) { dist[0] = (room_width - (x1 + 1)) * m; dest[0] = room_width; } else if(inst.x > (x1 + 1)) { dist[0] = (x1 + 1) * -m; dest[0] = 0; } else { dist[0] = 0; dest[0] = (x1 + 1); } if(inst.x != (x1 + 1)) { m = ((y1 + 1) - inst.y) / ((x1 + 1) - inst.x); } else { m = 0; } if(inst.x < (x1 + 1)) { dist[1] = (room_width - (x1 + 1)) * m; dest[1] = room_width; } else if(inst.x > (x1 + 1)) { dist[1] = (x1 + 1) * -m; dest[1] = 0; } else { dist[1] = 0; dest[1] = (x1 + 1); } draw_primitive_begin(pr_trianglestrip); draw_vertex(x1 + 1, y0); draw_vertex(x1 + 1, y1 + 1); draw_vertex(dest[0], y0 + dist[0]); draw_vertex(dest[1], y1 + 1 + dist[1]); draw_primitive_end(); } } } } else { draw_clear(c_black); } surface_reset_target(); surface_set_target(shadows); draw_set_blend_mode_ext(bm_dest_color, bm_src_color); draw_surface_ext(current[i], 0, 0, 1, 1, 0, c_black, 1); draw_set_blend_mode(bm_normal); surface_reset_target(); } /* surface_set_target(shadows); draw_set_blend_mode_ext(bm_dest_color, bm_src_color); for(var i = 0; i < array_length_1d(current); i++) { if(surface_exists(current[i])) { draw_surface_ext(current[i], 0, 0, 1, 1, 0, c_black, 1); } } draw_set_blend_mode(bm_normal); surface_reset_target(); */ } draw_surface_ext(shadows, 0, 0, 1, 1, 0, c_black, 0.3 + (0.1 * (os_browser != browser_not_a_browser))); }} else { if(Controller.colours[BLACK]) { if(instance_number(Wall) != wallCount) { wallCount = instance_number(Wall); redraw = true; } else { with(Wall) { if(moved) { redraw = true; moved = false; } } with(Lightbulb) { if(beenlit) { redraw = true; beenlit = false; } } } var walls = "", lights = ""; for(var i = 0; i < instance_number(Wall); i++) { var inst = instance_find(Wall, i); if(inst.visible) { walls += string(inst.bbox_left) + " " + string(inst.bbox_top) + " " + string(inst.bbox_right) + " " + string(inst.bbox_bottom) + " "; } } for(var i = 0; i < instance_number(Lightbulb); i++) { var inst = instance_find(Lightbulb, i); if(inst.lit) { lights += string(inst.x) + " " + string(inst.y) + " "; } } shadow_shadow(walls, lights, redraw); }}</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/></object>