Idle games seem to have a pretty addictive nature to them when they are well done, also making a basic one for starters is not so hard. There are many features that come to mind that I think just about any idle game should have, but for this one I am going to keep things very basic. In idle games there is often a way to get a kind of resource by way of a manual action such as clicking a button of some kind. There are also a wide range of other features that I think any idle game should have including resource gains over time, resource gains gained over time while away, upgrades, and so forth. However for now maybe I should focus on just what the core of the game is for starters.
For this vue example I am going to want to have just a single vue instance, but I think I will also want to pull a lot of the logic into at least one other separate object all together that will serve as a main game state object module of sorts. So then this game module will have to have at least one public method that will create and return a new game state object. In addition to the main create method of the game module I am also going to want to have a few additional public methods that have to do with the mutation of that main state object. For now maybe just a public method that will preform a single mine event for the game state, and then another method that will be used to sell an amount of a mined resource.
Now that I have a main game module I will now want to use that module with a vue instance. The main create state method of the game module is what I will be using to create a new vue data object for the vue instance. I will then want to have buttons in the template for this vue example, and for now there are just two kinds of buttons on that will preform a mine event for the game state, and others for each mineral that will be used to sell all of the mineral for money.
I am now just going to want to have a little html and css in order to tie everything together. For most vuejs example I often just have a single element that will serve as a mount point, and this example is no exception. There is just a single div element with an id that I use with the vue el option in the vue instance as a way of mounting the vue instance to this html. On top of that I am just lining to a copy of vuejs of course, and the additional files that I covered in this example.
That is it for now when it comes to this vuejs example of a basic idle game, this week I think I will be working on a few more examples and maybe nay of them should be additional examples like this. There is way more that can be added on top of this example just when it comes to a basic set of features for an idle game, and maybe I will but a little more time into this example, and this post as well. However I would like to have at least a few vue examples of idle games that are just very basic, clean, staring points actually. So if I am going to add more to this example I still think I will only want to add so much more, I have a bad habit of going overboard with features sometimes.