Lodmot #1 Posted April 22, 2013 Hello ^^ Anybody here know how to check whether the playfield is completely empty? 0: Thankies. Quote Share this post Link to post Share on other sites
+Random Terrain #2 Posted April 22, 2013 If you have an object that is destroying pfpixels all over the screen, do you know how many pfpixels will be on the screen at the start or is the number always different? Quote Share this post Link to post Share on other sites
SeaGtGruff #3 Posted April 23, 2013 Hello ^^ Anybody here know how to check whether the playfield is completely empty? 0: Thankies. If you're using a bB playfield that's stored in RAM, you could use a routine to check each playfield byte to see if it's 0-- maybe something like this: (1) Initialize a flag to 1 (i.e., pre-assume that the playfield isn't completely empty). (2) Use a loop to start checking each playfield byte. (3) As soon as a non-zero byte is detected, exit the loop with the flag still set to 1. (4) Otherwise, keep looping to check the next playfield byte. (5) If you reach the end of the loop (the last byte to be checked) and it's 0, exit the loop and clear the flag. Or the other way around: (1) Initialize a flag to 0 (i.e., pre-assume that the playfield is completely empty). (2) Use a loop to start checking each playfield byte. (3) If a byte isn't 0, set the flag to 1 and exit the loop. (4) Otherwise, keep looping until you've checked all the bytes. (5) When you eventually exit the loop-- either because of (3) or because you've checked all the bytes-- the flag will indicate whether or not the playfield is completely empty. Another idea: (1) Store the total number of playfield pixels that are "on," using as many bytes as necessary (probably 2). (2) While the game is being played, decrement the number of playfield bytes each time a playfield pixel is turned "off." (3) When the number reaches 0, you know the playfield is cleared. Quote Share this post Link to post Share on other sites
bogax #4 Posted April 23, 2013 (edited) Another possibility Or the playfield bytes together and check the result. something like temp = ((((((((((var0 | var1) | var2) | var3) | var4) | var5) | var6) | var7) | var8) | var9) | var10) | var11 if temp then pf_not_clear Of course there's more than 12 variables to the playfield. You could do them a few at a time or all at once. You need the parentheses or bB gets goofy with the stack There's no limit on the height of a sprite is there? Perhaps you could cover the play field with big sprites and check for collisions. Edited April 23, 2013 by bogax Quote Share this post Link to post Share on other sites