namragog
Guest
|
|
« Reply #419 on: May 23, 2012, 12:33:00 PM » |
|
I'm using Game Maker with Easylighting, but It should work. I see no reason why it isn't.
It just stopped working for everything at once.
oInitLight create: //Initializes the lighting system lt_sysset(1, -1, make_color_rgb(60, 60, 60), 1, false, 1, 0, 0); // ^This changes the color of the background where you have no lighting
//This executes the code from each lamp object with (Streetlamp) { //Note that centerlights_s is a sprite that I added lampLight = lt_lightadd(centerlights_s, 0, x , y-20 , 0.4, 0.4, 0, c_yellow, 1, false); // ^This changes the color of your lamp lights }
SunLight = lt_lightadd(solarisX, 0, x , y , 1, 1, 0, c_white, 0, false);
//This executes the code from each lamp object with (floureslights) { //Note that centerlights_s is a sprite that I added floLight = lt_lightadd(Spr_flourescent, 0, x , y , 1, 1, 0, c_white, 1, false); // ^This changes the color of your lamp lights }
with (Spark) { //Note that centerlights_s is a sprite that I added myLight = lt_lightadd(Spark, 0, x , y , 1, 1, 0, c_white, 1, false); // ^This changes the color of your lamp lights }
Step: //Executing code from each lamp object with (Streetlamp) { //If they successfully created a light... if (lt_lightexists(lampLight)) { //Move the light within small range to create flicker effect lt_lightset_x(lampLight, x + choose(random(2), -random(2)) )//- view_xview[0]); lt_lightset_y(lampLight, y-20 + choose(random(2), -random(2)) )//- view_yview[0]); } else { ///Else try creating the light again lampLight = lt_lightadd(centerlights_s, 0, x - view_xview[0], y - view_yview[0], 0.4, 0.4, 0, c_yellow, 1, false); } }
//Executing code from each lamp object with (generator) { //If they successfully created a light... if (lt_lightexists(myLight)) { //Move the light within small range to create flicker effect lt_lightset_x(myLight, x + choose(random(0), -random(0)) - view_xview[0]); lt_lightset_y(myLight, y + choose(random(0), -random(0)) - view_yview[0]); } else { ///Else try creating the light again myLight = lt_lightadd(centerlights_s, 0, x + generator.hspeed[0], y + generator.vspeed[0], 0.6, 0.6, 0, c_white, 1, false); } }
if (instance_exists(helios640)) { //If they successfully created a light... if (lt_lightexists(SunLight)) { if (! lt_lightget_on(SunLight)) { lt_lightset(SunLight, solarisX, 0, helios640.x - view_xview[0], helios640.y - view_yview[0], 1, 1, 0, c_white, 1, false); } //Move the light within small range to create flicker effect lt_lightset_x(SunLight, helios640.x + choose(random(2), -random(2)) - view_xview[0]); lt_lightset_y(SunLight, helios640.y + choose(random(2), -random(2)) - view_yview[0]); } else { ///Else try creating the light again SunLight = lt_lightadd(solarisX, 0, helios640.x - view_xview[0], helios640.y - view_yview[0], 1, 1, 0, c_white, 1, false); } }
if (instance_exists(solaris640)) { //If they successfully created a light... if (lt_lightexists(SunLight)) { if (! lt_lightget_on(SunLight)) { lt_lightset(SunLight, solarisX, 0, solaris640.x - view_xview[0], solaris640.y - view_yview[0], 1, 1, 0, c_white, 1, false); } //Move the light within small range to create flicker effect lt_lightset_x(SunLight, solaris640.x + choose(random(2), -random(2)) - view_xview[0]); lt_lightset_y(SunLight, solaris640.y + choose(random(2), -random(2)) - view_yview[0]); } else { ///Else try creating the light again SunLight = lt_lightadd(solarisX, 0, solaris640.x - view_xview[0], solaris640.y - view_yview[0], 1, 1, 0, c_white, 1, false); } }
//Executing code from each lamp object with (Spr_flourescent) { //If they successfully created a light... if (lt_lightexists(floLight)) { //Move the light within small range to create flicker effect lt_lightset_x(floLight, x + choose(random(0), -random(0)) )//- view_xview[0]); lt_lightset_y(floLight, y + choose(random(0), -random(0)) )//- view_yview[0]); } else { ///Else try creating the light again floLight = lt_lightadd(Spr_flourescent, 0, x - view_xview[0], y - view_yview[0], 1, 1, 0, c_white, 1, false); } }
//Executing code from each lamp object with (OBJ_Spark) { //If they successfully created a light... if (lt_lightexists(myLight)) { //Move the light within small range to create flicker effect lt_lightset_x(myLight, x + choose(random(0), -random(0)) - view_xview[0]); lt_lightset_y(myLight, y + choose(random(0), -random(0)) - view_yview[0]); } else { ///Else try creating the light again myLight = lt_lightadd(Spark, 0, x +OBJ_Spark.hspeed[0], y + OBJ_Spark.vspeed[0], 1, 1, 0, c_white, 1, false); } }
//Executing code from each lamp object with (OBJ_ExitBlock) { //If they successfully created a light... if (lt_lightexists(ExitLight)) { //Move the light within small range to create flicker effect lt_lightset_x(ExitLight, x + choose(random(0), -random(0)) - view_xview[0]); lt_lightset_y(ExitLight, y + choose(random(0), -random(0)) - view_yview[0]); } else { ///Else try creating the light again ExitLight = lt_lightadd(centerlights_s, 0, x + OBJ_ExitBlock.hspeed[0], y + OBJ_ExitBlock.vspeed[0], 0.6, 0.6, 0, c_teal, 1, false); } }
There's more in the moving objects, but that may be irrelevant.
|