Kill Box Canvas Example
While wasting some time scrolling threw you tube I can across a video on how to make a kill box in a game called RimWorld. I have found the video, other videos like it, and the game itself interesting even though I have nit played it myself just yet. This has inspired me to start a canvas canvas example of my own where I will be playing around with many of the things that where talked about in the video, because I think making just a simple striped down game based around this might prove to be a little fun.
- This canvas example is in alpha state for now
As of this writing my kill box example needs a lot more work until I have something that is really worth writing about. So for now this post is just a brief overview of what I have thus far on this one. If I get some time I will get around to fixing this one up a bit, as I do not even have the basic idea I hand in mind done. So it might be best to check out some of my other canvas examples and not wast your time reading about something that is not done yet.
1 - The utils framework for this kill box canvas example
So for this canvas example I have a general utility framework that just has two methods for now, one to get a canvas relative position in a canvas element when working with pointer events. The other method that I have in the utility library is a bounding box collision detection method.
|
|
2 - The object pool module
I know that I will want to have an object pool module for this canvas example. If you do not know what and object pool is then I have made another canvas example in which I get into the topic of object pools in detail. However simple put an object pool is just a way to create and update a fixed pool of objects that are often used for sprites and other display objects that are used in a game.
|
|
3 - The map module
For this kill box example I am also going to want a map module that will be used to create a map of cell objects.
|
|
4 - The game module
Many of these canvas examples of mine will contain a game module that is the module that is used to create and update a main game object.
|
|
5 - the draw module
I also take the time to make a stand alone draw module for my canvas examples. This is a way to pull code that has o do with drawing to the canvas element away from code that is used to create an update a main state object of the game.
|
|
6 - the main.js file and state machine.
Now that I have all the files that I want and need to create my main state object I now need a little more javaScipt code that will have to do with a main update loop, creating the canvas, and setting up a state machine.
|
|
7 - Conclusion
As of this writing I am not happy with the current state of this canvas example, there is much more work that needs to be done with this one. I would like to get to at least 50 or so canvas examples before pouring more attention in updating these, and when I do this one sure does need some work. I think that the basic idea that I have in mind might prove to be fun though when I do manage to get this up and running.