![]() ![]() It will be hard, but let’s try to keep the code and program simple and pragmatic. ![]() In this case, however, we have a pretty clear idea of what we want our game to look like: It’s a simple infinite runner, where a couple of obstacles spawn from time to time and the score is directly based on how much time we can succesfully avoid them. In these kinds of contexts, (over-)engineering the code to be prepared for future implementations seems like the correct way to go. It’s very easy to overshoot when scoping any piece of software, especially when you can clearly see many ways in which your software can be expanded which is the case for pretty much any kind of game (power-ups, sound effects, types of entities, etc.). Here’s what it looks like if you don’t feel like clicking the above link: Keep in mind that the code is much more commented on this article since it’s meant to be as explicit and educating as possible. ![]() You can play the finished game here and review the code here. I thought we could take this chance to learn a little bit about web-based game development and create a small clone of the game. In doing so, you will be getting rid of one of the cheekiest features in any browser: The dinosaur game. If you are like me and are looking into getting out of Google’s ecosystem, chances are that you switched (or are thinking on switching) from Chrome to another browser. ![]()
0 Comments
Leave a Reply. |