How do you create a counter using variables?

#1

I’m making a clicker game. I need help

1 Like

#2

Declare your score tracking variable.

var score =0;

Then, inside the button press code, increase the
value of score.
score +=1;

0 Likes

#3

Here’s a quick example that should help!
cookieClicker.wick (1.8 KB)

0 Likes

#4

Also, you may want to look at the button and interactive text tutorial video!

The general idea is

  1. Create a button that can be clicked
  2. Create a variable in the project that we can store a number in.
  3. Increase that number everytime a click happens!

After we do this, we can use those points to create a purchasing system, prizes, etc… Let us know if you’d like help at that step!

1 Like

#5

Thanks for the help! :smiley:

1 Like