Building Clicker/Idle Games

14

Index

Attached Files

The following files have been attached to this tutorial:

.c3p

basic-clicker-game.c3p

Download now 83.37 KB
.c3p

polished-clicker-game-v2.c3p

Download now 196.33 KB

Stats

10,380 visits, 22,175 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 18 Mar, 2020. Last updated 24 Mar, 2020
.C3P

polished-clicker-game-v2.c3p

Download now 196.33 KB
Subscribe to Construct videos now

The backbone of the polished clicker is the same as that of the basic. Over time, you accrue currency, which you can also gain by tapping on the screen – all tracked by global variables. The key differences between the two versions are the addition of touch panning controls, moving the product purchasing into a separate shop layer and replacing the multiplier upgrade with a random bonus system.

The game uses the same touch controls as in the Construct 3 Panning demo (available on the Start Page) and it allows the user to move around the layout using swipe controls. The viewport contains a deadzone underneath the HUD, so that if the player is swiping over the HUD for whatever reason, the layout will not move.

Having the HUD displays the player’s current amount of currency, amount of currency earned per tap and current multiplier in one handy place. It also holds the button for the Shop. The HUD is on a global layer, so it’s visible even when the shop is open, so that button can be used for both opening and closing the shop – done by toggling a Boolean.

If the Shop Boolean is true then the layer holding the game’s shop is set to visible and the player can purchase products and upgrades. This Boolean also disables the touch panning controls so that the level won’t move while the player is buying stuff.

Each product has its own purchase button which only becomes visible and purchasable when the player has amassed enough currency. Plus, to stop the player jumping immediately to a level three product, the button for the next upgrade is only available when the player has purchased the one before. So, you must buy level 1 to buy level 2 etc. An effect is also used to darken the buttons when they’re not ready to buy – just a cosmetic thing, but works nicely.

The shop also shows the costs of each product thanks to an instance variable and a container. By putting the button and the cost text into a container, you can be sure that the right cost is displayed. When you buy a product, the purchase function is triggered which then sets the products on the game layer to the right level and sets their variables accordingly.

The final extra thing in the polished clicker is the addition of the bonus robot. The robot is a sprite that spawns at random spawn places across the map and when the player taps it, they get a bonus either to their taps per second or their multiplier.

When the game starts, a timer is fired which tells the robot when it can start appearing. When that timer expires, the robot will pick a random spawn point on the map and become visible. A new timer will then start to tell the robot how long to be visible for. When the ‘visible’ timer expires, the robot disappears. If the player taps on the robot while it’s visible, then their bonus is applied, the robot vanishes and the cycle starts again:

Appear > Wait to be tapped > Disappear > Repeat

And that’s a broad roundup of what’s gone into these two projects. Feel free to have a look at them, watch the video and hopefully you’ll pick up some ideas!

  • 2 Comments

  • Order by
Want to leave a comment? Login or Register an account!