How to Make a Clicker Game

Материал из Поле цифровой дидактики
Описание Руководство по созданию игр типа clicker-game
Область знаний Информатика
Область использования (ISTE)
Возрастная категория 12


Поясняющее видео
Близкие рецепту понятия
Среды и средства для приготовления рецепта: Scratch

Idle games, also called clicker games or clicking games, are video games of which the gameplay consists of the player performing simple actions (such as clicking on the screen) repeatedly to gain currency. This can be used to obtain items or abilities that increase the rate at which currency increases.

Instructions for Creation

Clickables

First, the project will need a clickable. It can easily be made by first picking a costume, and then creating the following script.

whenclickedsetObtainable1to0whenthisspriteclickedchangeObtainable1by1

However, there is a flaw within that script. If a building or upgrade to make the clicking power increase was created, the previous script wouldn't work.

whenclickedsetClickingPowerto1whenthisspriteclickedchangeObtainable1byClickingPower

Buildings

In order to make the buildings, a decision must be made. The buildings could be shown next to the clickable or they could be shown after using a button. For the button, see Button Section.

Button Section

First, make 2 costumes, one for entering shop and one for exiting.

whenclickedsetcostumeto1switchcostumetocostume1whenthisspriteclickedifcostume=1thenbroadcastshopopennextcostumesetcostumeto2elsebroadcastshopexitnextcostumesetcostumeto1end

Now the shop button works.

Continuing Buildings Section

Create a cost variable, a sprite for the building, and a variable for the number of that building the user owns.

whenclickedsetCostto15setOPSto0.1setBuildingNo.#to0foreverchangeObtainable1byOPS*BuildingNo.#endwhenthisspriteclickedifObtainable1>Cost-1thenchangeObtainable1by-15changeCostbyCost*1.15changeBuildingNo.#by1end

Button Section Continued

Add the following script to the buildings.

whenclickedhidewhenIreceiveshopopenshowwhenIreceiveshopexithide

Achievements

Achievements are very hard to create a tutorial on, as they are triggered by different things which is why this section is so small.

Upgrades

Upgrades are hard to make, but this section will walk you through it.

whenclickedsetUpgradeCost1to100hidesethiddento1waituntilBuildingNo.#=1

It is easy to notice that this section is unfinished. That is because if a button is made, the Button section should also be seen.

Button Section

Add the following blocks in their corresponding places.

sethiddenSpecialto0Snapontothewhengreenflagclicked.sethiddenSpecialto1Snapontotheend.

Then, add the following script.

whenIreceiveshopopenifhiddenSpecial=1thenshowendwhenIreceiveshopexithideend

Upgrades Continued

Next, add the following script.

whenthisspriteclickedifObtainable1>99thenchangeObtainable1by-100setOPStoOPS*2end

Use of Cloud Variables

Cloud Variables can be used to count the global total number of clicks. They can also be used to save high scores on the server.