While some users prefer the first person view, even after adding look left/right/aback, you sometimes miss a bit of overview in the game.

Thus, I started working on a third-person perspective for Jangaron, where you can look over the lightcycle walls. To give you an early preview of how it may look like, I used Wink to produce a video of a game played with my workspace version. What you can see right at the beginning is the "camera" moving gently from the usual mid-horizon perspective to a bird's eye view above the player's lightcycle. I plan to provide keys for toggling between those two modes. As you can also see in the video, even in the third-person view, you can look in all four directions!

What do you think?

The technical challenge of this new perspective is that CSS border slants per se can only draw trapezoids where the projection of one of the parallel sides is completely contained within the other (leftmost figure). If the projection has at least a non-empty intersection, two slants (a "real" slant and a triangle) suffice (middle figure).

But what about arbitrary trapezoids? The solution is to cut the trapezoid in

a zigzag, resulting in serveral right angle triangles and one terminal slant (rightmost figure).

The worst case concerning the number of triangles is a very thin, 45 degree trapezoid. This is why I used another trick for the grid lines, which is to draw a white right angle triangle and a slightly smaller black one, so that only the white sloping line remains. I could not use that trick for the lightcycle walls, because they are drawn on top of the grid.

The question was if using this drawing technique degrades performance, but the answer seems to be "no". I use highly optimized code to update the DOM and to create the zigzag (just some linear equations; note that many coordinates can be reused!), so the overhead of projecting the wall etc. seems to outplay creating additional triangle/slant shapes. I hope to be done with the feature soon, so that you can check it out yourselves!

Subscribe to:
Post Comments (Atom)

Really, this is a completely amazing project. I so impressed with what you've done so far. Not only are the new features great (sound, rim, glance, game type), but it seems to be running much smoother too. Just incredible. Keep it up! Pretty soon I'm going want a standalone executable to play on road trips!

ReplyDelete