+atari2600land #1 Posted October 24, 2009 I'm making a new puzzle game. The object is to put all the Tetris-like shapes on the screen into a 6x6 box. I need a way to find out if the box is full so you can move on to the next puzzle. I tried but it wouldn't work. fillin.bas.bin fillin.bas Quote Share this post Link to post Share on other sites
RevEng #2 Posted October 25, 2009 (edited) Nice concept! The easiest way to do is to check the 6 high bits of the appropriate playfield vars... temp7=var4 & %11111100 if temp7 < %11111100 then goto notsolved temp7=var8 & %11111100 if temp7 < %11111100 then goto notsolved temp7=var12 & %11111100 if temp7 < %11111100 then goto notsolved temp7=var16 & %11111100 if temp7 < %11111100 then goto notsolved temp7=var20 & %11111100 if temp7 < %11111100 then goto notsolved temp7=var24 & %11111100 if temp7 < %11111100 then goto notsolved rem if we're here then the puzzle was solved! goto levelsolved notsolved ...but if you later decide to move the puzzle area you'll need to adjust the code. Edited October 25, 2009 by RevEng Quote Share this post Link to post Share on other sites
RevEng #3 Posted October 25, 2009 (edited) On second thought, provided the playing area stays where it is, you can do that without the mask and make it even faster... if var4 < %11111100 then goto notsolved if var8 < %11111100 then goto notsolved if var12 < %11111100 then goto notsolved if var16 < %11111100 then goto notsolved if var20 < %11111100 then goto notsolved if var24 < %11111100 then goto notsolved rem if we're here then the puzzle was solved! goto levelsolved notsolved Edited October 25, 2009 by RevEng Quote Share this post Link to post Share on other sites
+atari2600land #4 Posted October 26, 2009 (edited) On second thought, provided the playing area stays where it is, you can do that without the mask and make it even faster... <BR>if var4 < %11111100 then goto notsolved<BR>if var8 < %11111100 then goto notsolved<BR>if var12 < %11111100 then goto notsolved<BR>if var16 < %11111100 then goto notsolved<BR>if var20 < %11111100 then goto notsolved<BR>if var24 < %11111100 then goto notsolved<BR>rem if we're here then the puzzle was solved!<BR> goto levelsolved<BR>notsolved<BR> Cool! Thanks! I've added a puzzle as well as a choose a puzzle screen. Go left or right to change the puzzle number (which is the score) and press fire to start. There's only 2 puzzles so far. fillin.bas.bin fillin.bas Edited October 26, 2009 by atari2600land Quote Share this post Link to post Share on other sites
RevEng #5 Posted October 26, 2009 I think this is quite a good start for a neat puzzle game. A few suggestions... It's a bit frustrating that there's no undo or fix a solution you've worked on without a total restart. This is especially true since you can drop pieces outside of the solution area. Once you've reached the last piece can the fire button go back to the first? Also frustrating, but less so, is the fact that I can't move my new piece past any placed ones. Is this a technical problem, or an intentional game element? That said, I enjoyed it despite these nitpicks, so I think you're on a good track. I know it would be a fair bit harder, but if the puzzles could be randomly generated it would add to the replay value infinitely. Quote Share this post Link to post Share on other sites
+batari #6 Posted October 26, 2009 On second thought, provided the playing area stays where it is, you can do that without the mask and make it even faster... if var4 < %11111100 then goto notsolved if var8 < %11111100 then goto notsolved if var12 < %11111100 then goto notsolved if var16 < %11111100 then goto notsolved if var20 < %11111100 then goto notsolved if var24 < %11111100 then goto notsolved rem if we're here then the puzzle was solved! goto levelsolved notsolved Wouldn't this work? temp1=var4 & var8 & var12 & var16 & var20 & var24 if temp1 < %11111100 then goto notsolved rem if we're here then the puzzle was solved! goto levelsolved notsolved Quote Share this post Link to post Share on other sites
RevEng #7 Posted October 26, 2009 Nice technique! That will come in handy! Quote Share this post Link to post Share on other sites
+atari2600land #8 Posted October 26, 2009 I think this is quite a good start for a neat puzzle game. A few suggestions... It's a bit frustrating that there's no undo or fix a solution you've worked on without a total restart. This is especially true since you can drop pieces outside of the solution area. Once you've reached the last piece can the fire button go back to the first? I wouldn't know how to do that, since the piece has been placed outside of its predesignated space. I can however, make it so that you can only drop pieces in the square. Also frustrating, but less so, is the fact that I can't move my new piece past any placed ones. Is this a technical problem, or an intentional game element? That said, I enjoyed it despite these nitpicks, so I think you're on a good track. I know it would be a fair bit harder, but if the puzzles could be randomly generated it would add to the replay value infinitely. This is intentional. I think randomly generated puzzles is beyond my programming know-how. Thanks for the input and compliments, I'll continue to work on this and add in the suggestions. Quote Share this post Link to post Share on other sites
+atari2600land #9 Posted October 27, 2009 OK, I changed the way this works a little. All the pieces you get will stay on the board, but you can only move the current piece, which always starts just to the right of the box, so no more constantly pressing left to finally get your piece to the box. Also, the only way to finalize where a piece goes is if it is fully inside the box. I've also added a little feature: If you get sick of a puzzle, press level select to go back to the title screen and try a new one. fillin.bas.bin fillin.bas Quote Share this post Link to post Share on other sites