Jump to content
IGNORED

Checking Multiple Playfield Variables


Recommended Posts

My thoughts were that I could read the playfield as a data table and if a value is greater than zero than the level continues.

 

I just cannot remember where I had seen something similar in the forums. I remember someone helped me a while back with the conveyor belt animation in Crossdock, where I believe a data table was read and used to flip a certain pfpixel on or off. I figured something like this would be similar. I plan on playing around with this on my lunch to see if I can figure something out. 

Seems like this might work:

 

   _My_Temp = 12

__PF_Check

   temp5 = var0[_My_Temp]

   if temp5 then goto __Done_PF_Check

   _My_Temp = _My_Temp + 1

   if _My_Temp < 44 then goto __PF_Check

   goto __Level_Beat

__Done_PF_Check

 

  • Thanks 1

The playfield uses var0 - var42, not counting the scrolling row. I'd do it with a for loop personally:

 

    for temp5 = 0 to 42
    	if var0[temp5] > 0 then goto ____level_done
    next
    
    ; Level continues normally here

 

Since this consumes a lot of cycles, you might instead consider using a variable to keep track of the number of blocks or whatever on the playfield, and decrement it every time one is destroyed. This works cleanly if you know how many you start with, and it's less than 256.

  • Thanks 1
13 minutes ago, Random Terrain said:

Seems like this might work:

 


   _My_Temp = 12

__PF_Check

   temp5 = var0[_My_Temp]

   if temp5 then goto __Done_PF_Check

   _My_Temp = _My_Temp + 1

   if _My_Temp < 44 then goto __PF_Check

   goto __Level_Beat

__Done_PF_Check

 

I think this was along the lines of what I was thinking. 

 

10 minutes ago, Karl G said:

The playfield uses var0 - var42, not counting the scrolling row. I'd do it with a for loop personally:

 


    for temp5 = 0 to 42
    	if var0[temp5] > 0 then goto ____level_done
    next
    
    ; Level continues normally here

 

Since this consumed a lot of cycles, you might also consider using a variable to keep track of the number of blocks or whatever on the playfield, and decrement it every time one is destroyed. This works cleanly if you know how many you start with, and it's less than 256.

I'll  probably play around with how I were to do it. I had considered keeping track of blocks but I was getting tripped up on the playfield idea. I thought just checking the playfield would be simple and not as intensive.

 

My thoughts were to have use part of the playfield for this purpose, which is why I considered rows 12-42. The rest of the playfield would be more or less decorative or serve some minor function. I assume by keeping a variable free to keep track, I would have code where I turn off the pfpixel that just adds to that variable.

 

I'm also thinking that if I do it that way, I could make additional levels by the reverse - by turning pixels on to a certain amount. 

 

Thanks! This gives me a start to some playing around. Hopefully I learn something!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...