Automated code for next lvl up
AngryBoi
Member Posts: 586
I am currently working on a clicker game and am about halfway done. I'm sure you all are aware of leveling up certain mechanics in the game to gain clicks faster and faster. I am doing the same thing, but instead of running out of times you can level up by maxing out, I want unlimited levels. Can someone help me with some code to have it automated where the next level up comes out of an equation to make the points needed more and more for ongoing levels? ... hope this makes sense
Comments
Can you give an example of this? For instance, what would the points requirement be for level 2? For level 3? For level 4? Is it a linear growth or exponential?
And example of non-linear growth would be Constrain Attribute game.pointsForNextLevel to 100*pow(game.level,2):
Level 2 --> 400
Level 3 --> 900
Level 4 --> 1600
Level 5 --> 2500
etc.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I would like the growth to be exponential.. Let's say the first upgrade is 20 points, the next is 80, the next is 200... And so on
If you play around with the expression I posted above but replace the 100 constant with a different value (e.g. 10), you may find a pattern that fits what you want.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Alright thanks
Ive been following this out of curiosity and please forgive me but i don't really understand this part, with automating the level change with constraining the points for next level, the code: "Constrain Attribute game.pointsForNextLevel to 100*pow(game.level,2):"
edit,,, I've tried to upload the zipped project but i can't seem to find how to, I'm sure you used to be able to here?
here:
http://www.mediafire.com/download/a7fvdhcq1cciv36/ClicksPerSecond_1.zip
@jay2dx By constraining the attribute to a value that changes each level, the condition for passing the next level continually changes. What I didn't mention is that you'd need a rule that says When game.points ≥ game.pointsForNextLevel then Change Attribute game.level to game.level+1.
Can you explain why you've uploaded your project? Did you have a question about it or were you offering it as a possible solution for @BetweenTheWalls?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang thanks for the reply, yeah with the project I uploaded I added stuff to take it as far as I can understand, I got a points gained system working as per the number of taps per second and also set up a rule to have this inscreese as the levels went up but I got stuck constraining a rule to change level when an amount of points are reached! Just thought someone could have a look and help out,
I have a game where a level increases system like this would help me out greatly so just wanted to understand it,
Actually it's the: (game.level,2) where level is replacing (x) and 2 is replacing (y) in the POW function! This is what's confusing me? I just don't understand where the 2 comes into it. sorry haha