Last post was about my attempt at explaining coordinate transforms. Progress has been slow. I've implemented many of the diagrams but I'm still having trouble with the narrative. Last time I said this was my outline:
- Show a side scrolling game with some cool camera effects.
- Introduce world coordinates vs screen coordinates.
- Solve the problem of scrolling: subtract an offset.
- Introduce transforms. (may need to be later)
- Introduce inverse transforms, for mouse clicks. (may need to be later)
- Introduce cameras. More complicated than offsets, but can do more.
- Show some cool effects with cameras. (may need to be earlier)
- Introduce chaining transforms.
- Show some cool effects with chaining.
- Demo showing all concepts together.
I've been experimenting with different orders for the topics and now think there are two intertwined "tracks": the concept track introduces mathematical concepts and terminology, and the problem solving track shows solutions to specific gamedev problems. These two tracks are paired up:
Problem solving | Concept |
---|---|
scrolling | world/screen coordinates, translate transform |
following the player | cameras, view coordinates |
tile grid coordinates | scale transform, chaining transforms |
mouse clicks | inverse transforms |
? | function composition |
? | transform matrices |
I think in each case I should start with the problem to be solved, then show the immediate solution, then explain the concept behind the solution. The concepts then lead to a reusable solution. Example:
- Problem: we want to scroll the screen
- Immediate solution: add an offset before drawing
- Concept: we're transforming world coordinates to screen coordinates
- Reusable solution: a translate transform is a function or object that converts coordinates
The next section is:
- Problem: we want to keep the player in the center of the screen
- Immediate solution: use the player plus half the screen size as the offset
- Concept: a "camera" points at the player, using view coordinates
- Reusable solution: a camera object is placed in the world, and we use that to build the translate transform
What order should I present these topics? I'm not sure. I know I want to put scrolling first. If I put mouse clicks second, then it's fairly easy to solve, and there's less motivation to learn inverse transforms. So I might put that later. If I put tile grid coordinates second, then it leads to chaining transforms together, which will be useful for following the player with a camera. Or if I put following the player second, then it leads to view coordinates, which might further motivate chaining transforms.
I think the main problem is that I'm not feeling particularly inspired right now, so I'm working very slowly.
Tiada ulasan:
Catat Ulasan