How do I Make a Idle Game

Get help using Construct 2

Post » Sat Jan 17, 2015 6:42 pm

So The features I'm looking to be able to do is, click on a object which adds to a total.

Click on an upgrade which adds to the total every second.

Anyhelp?
B
3
Posts: 1
Reputation: 177

Post » Sun Jan 18, 2015 9:39 pm

first thing to do is to add 2 buttons, 2 texts and the mouse object.
give one text object the following instance variable(you can add these in the properties menu on the left of the screen). Call the variable Score, this will be a number starting from 0.
Give the other text object the variable UpgradeCost also starting from 1

in the event do the follow thing:
Code: Select all
Mouse > On object clicked > left clicked on "first button"

This will perform an action when a user clicked on the button

The action will be:
Code: Select all
"text with the score variable" > add to > 1 to Score.
"text with the score variable" > set text > "Score: " &[name of the button].Score

This will add 1 to score every time the button is pressed.

The other button will upgrade the automatic scoring. The event will be:
Code: Select all
Mouse > On object clicked > left clicked on "second button".
"text with the upgrade variable" > Compare instance variable > Upgrade equal or larget then "int(self.Upgrade^1.5+1)"

The action will be:
Code: Select all
"text with the upgrade variable" > add to > 1 to upgrade.
"text with the upgrade variable" > set text > "Upgrade cost: " & int([name of the 2nd button].Upgrade^1.5 + 1)

This will add 1 to upgrade every time Upgrade has been "upgraded". The price of the upgrade will be raise with the formula 'Upgrade ^ 1,5 + 1'

Thats it. Try change the formula to your own to make the game interesting
B
15
S
4
Posts: 43
Reputation: 1,022

Post » Thu Jun 04, 2015 5:02 pm

303Mark wrote:first thing to do is to add 2 buttons, 2 texts and the mouse object.
give one text object the following instance variable(you can add these in the properties menu on the left of the screen). Call the variable Score, this will be a number starting from 0.
Give the other text object the variable UpgradeCost also starting from 1

in the event do the follow thing:
Code: Select all
Mouse > On object clicked > left clicked on "first button"

This will perform an action when a user clicked on the button

The action will be:
Code: Select all
"text with the score variable" > add to > 1 to Score.
"text with the score variable" > set text > "Score: " &[name of the button].Score

This will add 1 to score every time the button is pressed.

The other button will upgrade the automatic scoring. The event will be:
Code: Select all
Mouse > On object clicked > left clicked on "second button".
"text with the upgrade variable" > Compare instance variable > Upgrade equal or larget then "int(self.Upgrade^1.5+1)"

The action will be:
Code: Select all
"text with the upgrade variable" > add to > 1 to upgrade.
"text with the upgrade variable" > set text > "Upgrade cost: " & int([name of the 2nd button].Upgrade^1.5 + 1)

This will add 1 to upgrade every time Upgrade has been "upgraded". The price of the upgrade will be raise with the formula 'Upgrade ^ 1,5 + 1'

Thats it. Try change the formula to your own to make the game interesting


how do you add offline earning?
B
3
Posts: 6
Reputation: 189

Post » Fri Aug 21, 2015 4:45 am

So.. I believe you can do it the way adventure capital does it... When you log out of the game saves the time, then when they log in compare the time difference. I'm using an add-on for time I can't remember the name of that allows for better comparisons. Basically your checking the last time something was updated, then adding the value to score when they really load... I'll try and remember to post the add-on name when I'm close to my CPU and not phone.

Their may be a more efficient way, but this seems to work for me so far
B
9
S
2
Posts: 54
Reputation: 638

Post » Fri Aug 21, 2015 4:56 am

@WumpusThumper Hey there, welcome to the forums! I will first put in a little plug for my idle/clicker game template you can get on the store (https://www.scirra.com/store/games-with ... e-game-666), pretty cheap and a couple examples of ways to do what you are asking for with commenting for each of the parts.

But I know a lot of people don't wanna buy anything on the store and learn themselves, so as what @MythStylz said there is a great plugin from @RexRainbow that I used in the template (http://c2rexplugins.weebly.com/rex_time_awayl.html)...actually just go through and download a ton of RexRainbow's plugins, they help a ton. But the TimeAway plugin will set a timer when you leave or close the game and when you come back you can just calculate the difference.

Good luck!
Twitter: https://twitter.com/pudgyplatypus

Learn to make a clicker game for cheap!
https://www.scirra.com/store/games-with ... e-game-666

Try out Pixel Golf on the Scirra Arcade!
https://www.scirra.com/arcade/sports-ga ... el-golf-67

Pudgy Platypus Games website!
www.pudgyplatypus.com
B
59
S
20
G
5
Posts: 212
Reputation: 7,390

Post » Fri Aug 21, 2015 4:57 am

Yeah that's the one
B
9
S
2
Posts: 54
Reputation: 638


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, R0J0hound, tarek2, Yahoo [Bot] and 15 guests