# How can i make the game start with specif points based on my best score?

0 favourites
• 8 posts
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
• Hello!

Basically i have done that

On start of layout

If BESTSCORE>=100 set POINTS to 100

If BESTSCORE>=200 set POINTS to 200

If BESTSCORE>=300 set POINTS to 300

ecc..

ecc...

So everytime i start a game loop based on my best score the game makes me start with a determinated number of points

I'm asking if there is another way to do this exact same thing wihout coding the same thing infinite time

i hope i explained myself

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• Well i'm no maths expert but my approach would be something like :

- divide by 100

- floor the return value i.e. floor(3.9) = 3

- multiply by 100 = points

So if your score is 360, would be 3.6 = 3 = 300

• excuse me but i haven't understood anything, can you show me how that could work in code?

• That is the code. Take BESTSCORE, divide it by 100. use floor to round it down to the nearest integer. Multiply by 100. The result is POINTS.

• What is floor? what does it mean to round it to the nearest integer?

can you do a screenshot of the code from construct so i can understand better what are you saying?

• On start of layout --> System -> Set value -> points -> int(bestscore/100)*100

• On start of layout --> System -> Set value -> points -> int(bestscore/100)*100

awesome that worked thank you really much!, but what does int mean?

and can you explain a bit what this "int(bestscore/100)*100" does?

• int converts a value to an integer. If your bestscore is 283 then 283/100-> 2.83 int(2.83) gives you 2. And multiplying with 100 gives you back 200

• 8 posts