Hi all.
I think this post belongs here because it is more of a VBA code question than a database question.
Just for fun, I wrote a Tetris game in Access using a form and a module.
I have 200 labels on my screen that I put in an array to be placeholders for locking a piece in place when it hits bottom.
I think this is well below the allowable number of components on a form.
The grid on this game is 10 squares wide by 20 tall, with each square being 576 each way.
The game is mostly finished and is playable, but an error has started popping up.
It is error 2100: the component or subform component is too large for the area.
This error happens always when a piece is being rotated and always when the .TOP value is being assigned.
Other than that, it is random and unpredictable when it pops up, but it does come up often.
Every .TOP value that throws the error has been assigned numerous time without error, so I don't know what causes the code to perceive a problem with the value.
I checked the values when it stops on error, and there's nothing funny about them. The errors so far have not happened when I just move the pieces left or right and let them fall or drop them.
It's only when they are rotated, and then again just at random times.
For the rotation subroutine, I break it down by the different pieces and their various orientations.
I pick a single square (one of four squares that each piece has) and I make that the center point around which the piece rotates, so one piece stays in place and the other three change position accordingly.
The error isn't thrown by a particular piece or by a particular orientation or at a particular height. It seems to happen to any piece at any orientation at any height on the screen, but not consistently.
It might happen after 10 pieces fall or after 100.
Any thoughts?
Thanks.
I think this post belongs here because it is more of a VBA code question than a database question.
Just for fun, I wrote a Tetris game in Access using a form and a module.
I have 200 labels on my screen that I put in an array to be placeholders for locking a piece in place when it hits bottom.
I think this is well below the allowable number of components on a form.
The grid on this game is 10 squares wide by 20 tall, with each square being 576 each way.
The game is mostly finished and is playable, but an error has started popping up.
It is error 2100: the component or subform component is too large for the area.
This error happens always when a piece is being rotated and always when the .TOP value is being assigned.
Other than that, it is random and unpredictable when it pops up, but it does come up often.
Every .TOP value that throws the error has been assigned numerous time without error, so I don't know what causes the code to perceive a problem with the value.
I checked the values when it stops on error, and there's nothing funny about them. The errors so far have not happened when I just move the pieces left or right and let them fall or drop them.
It's only when they are rotated, and then again just at random times.
For the rotation subroutine, I break it down by the different pieces and their various orientations.
I pick a single square (one of four squares that each piece has) and I make that the center point around which the piece rotates, so one piece stays in place and the other three change position accordingly.
The error isn't thrown by a particular piece or by a particular orientation or at a particular height. It seems to happen to any piece at any orientation at any height on the screen, but not consistently.
It might happen after 10 pieces fall or after 100.
Any thoughts?
Thanks.