Jump to content
Lodmot

Question about checking playfield. owo

Recommended Posts

Hello ^^

Anybody here know how to check whether the playfield is completely empty? 0:

 

Thankies.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 by bogax

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...