Jeretris now has ARE, IRS and IHS. It uses a queue to store left and right motion, rotation, and holds. The input system is still naive, but once it's got DAS, that will queue as well. Happy New Year!
Ah, that. The processes that involve gravity and piece manipulation are separate. If you hold down a rotate key and a move key at the same time, the piece will rotate and move, and then fall. The falling process cannot interrupt the processes resulting from simultaneous key presses. ...because I care...
Ah. The queue runs through the stored piece manipulations sequentially, and independently of gravity. So gravity can have no effect while the queue is being processed. "Queue" sounds like an asynchronous process, but this one is just a while loop iterating over a list.
Okay, last question before I start asking about timing and scoring (which I'd prefer to put in a new thread): Where's the best place around the well to put the next pieces and hold piece? I've put them on the side before, but if there's an advantage to placing them at the top, then I'll do that.
Hold piece left, next piece right. Or hold piece at the top left, and next piece at the top right. I don't think you're starved for space (like on Tetris DS where they had to squeeze everything into 256x192 pixels) so I'd put them at the top.
I just thought of something crazy. The well's aspect ratio is 1:2. If you add a 1:1 next-piece display and a 1:1 hold-piece display, you could arrange them in various ways What if Jeretris rearranges them each time you start a new game?
I experimented a couple years ago with rotating the game. Though I can set it at a slight angle, I'd rather keep it relatively straight.
Oh wow, there's an even crazier idea that I'm gonna go with. You'll see it soon. UPDATE: Here we go! Still doesn't look too impressive, being black and white and all, but you can still get the picture. The next pieces and hold piece can be read from the corner of your eye.
Positive: Initial orientations in the playfield are correct. Rotation appears correct, including the T-spin triple. Constructive criticism: When I right-click the Flash app, I can't set "Quality" to low, medium, or high depending on my CPU/graphics speed. (My computer recently celebrated its seventh birthday.) The ghost piece is always green. I expected it to be the proper SRS color. Orientation in preview doesn't match orientation in playfield. For example, I is vertical in preview but horizontal in playfield. It isn't even consistent: L and T are pointed right in the preview, but J is pointed left. DAS initial delay is way too short compared to the repeat period. Worse, sometimes I can press a key and release it and have the piece not react at all, so I have no idea how long to hold down the key. It appears you're using the same "sampling" input algorithm as Tetripz. In both your game and Tetripz, after I press the key once to move a piece, I have to look at the screen to see if it moved 0, 1, or 2 cells before I drop it. (This was one of the three complaints about Tetripz that led me to write TOD in the first place.) In general, if you're making a slow-DAS game (15 Hz or less), the initial delay should be 2 to 3 times the repeat period. Holding right toward the wall, tapping left, and releasing both keys leaves the piece touching the wall, while I expected it to leave the piece one cell from the wall. Keyboard players are used to the behavior of the PC keyboard driver: track only one direction's DAS at once, even if both left and right. Try putting the insertion point into your browser's address bar and then pressing left and right at the same time to see how players expect the piece to move.
having the previews in different orientations is surprisingly annoying--more importantly, the input is shoddy enough to make it unplayable. as mentioned, i tap a key and have no idea if it is going to move 1, 2, or even 0 spaces. also, when you hold a piece, it doesn't show up in the hold box until the next piece has entered the well. which is confusing. awesome rotation effect! love it. edit: the hold thing is weirder than i thought it was--i can't focus well enough to figure out exactly what it's doing, but it's really weird.
The input system is still naive, but it looks like you've pointed out a flaw in the system even underlying that. No big deal, just a little disappointing. I'll strip that out and redo it. At any rate, all the input and game event timing stuff will be discussed in a new thread (to keep things tidy), when I get to it which will be tomorrow, at this rate. So hang tight! Bright green = placeholder data. The color system (that's right, there's a whole system) is one of the last things to do after putting the interface together, but while things are black and white, some stuff is gonna have to be green, just so I can see it. Visual quality will become an option in the Settings menu. Heck, I'll do that now. If identical orientation on and off the playfield is important (and it appears that it is), then I'll do it. Thanks again! Lots of feedback with this one. Where do you guys think the score should go? Forget piece stats, I'm just going to display the score. EDIT: And I think I'm downgrading the randomizer back to bag, starting with no S or Z. The pieces don't feel random enough for me.
That was what I was afraid of when you explained your idea to me. It didn't seem very random at all .
You live and learn... Next-piece orientations, hold-piece orientations, smoothing and toggling the ghost on and off are now implemented. Link. Giving the pieces the same orientations really does help.
It's actually quite playable now. But I'm not sure if I should have remapped the keys ARS-style, because the initial orientations are SRS. But not remapping the keys was even worse, lol BAH! Tetlag! I quite like the black and white, reminds me of gameboy tetris .