N
NValorz
Guest
Hey guys,
I'm working on a Paint by Colors game with a twist... a jetpack! And I'm struggling solving how to implement a portion of my game. In the picture below, "1" blocks are red, "3" blocks are yellow, "4" blocks are blue, and "0" blocks are supposed to be left blank.
However you'll see some of the "0" blocks are painted red... Once all the blocks are colored correctly, I want to check to make sure no "0" blocks are colored in with the code below in the Step event of a manager object:
I'm running out of ideas though. If I have the above code +1 to a variable every time it finds a "0" block, it just counts up infinitely since it's in the step event. The above doesn't work as it doesn't turn off the global.out_of_bounds even if all "0" blocks are white.
If anyone has any ideas, fire away! I'm close to finishing and this is one of the last things I'm on, maybe I've just been staring at it for too long and my brain's fried. Let me know if you need to see any more code!
Thanks in advance.
I'm working on a Paint by Colors game with a twist... a jetpack! And I'm struggling solving how to implement a portion of my game. In the picture below, "1" blocks are red, "3" blocks are yellow, "4" blocks are blue, and "0" blocks are supposed to be left blank.
However you'll see some of the "0" blocks are painted red... Once all the blocks are colored correctly, I want to check to make sure no "0" blocks are colored in with the code below in the Step event of a manager object:
Code:
//CHECK FOR OUT OF BOUNDS
for (var a = x; a < (32 * 17); a += 32) {
for (var b = y; b < (32 * 17); b += 32) {
var currentBlock = instance_position(a, b, obj_paint_block_parent);
if (currentBlock.paint_value = 0) {
if (currentBlock.image_blend != c_white) {
global.out_of_bounds = true;
} else {
global.out_of_bounds = false;
}
}
}
}
//END
if (level_total = global.color_is_correct && !global.out_of_bounds) { // this means all the blocks are colored correctly
instance_deactivate_all(false);
}
If anyone has any ideas, fire away! I'm close to finishing and this is one of the last things I'm on, maybe I've just been staring at it for too long and my brain's fried. Let me know if you need to see any more code!
Thanks in advance.