0 Favourites

Setting score in relation to player movement speed

  • I have a a car that is driving. Every .25 secs that the speed is greater than 100, it adds 1 to the player score variable. However, if the player slows down (hitting a wall), I want the score speed to slow down. Is there an easy way for me to link the rate at which 1 is added to the score variable in relation to the player speed?

  • What do you want the score to do when you slow down or stop?

  • Here the example

    Capx file:

    https://drive.google.com/file/d/0B9uHUU ... sp=sharing

    Thank you, this is how I currently have my score set up. I want it to speed up and slow down, not just >100

    What do you want the score to do when you slow down or stop?

    Ideally I would like the score to increase with the speed of the player. So if they slow to a crawl, so will the score. I guess I want the score to be linked to the RPMs instead of setting it to every .25 seconds

  • >

    > Here the example

    > Capx file:

    > https://drive.google.com/file/d/0B9uHUU ... sp=sharing

    >

    Thank you, this is how I currently have my score set up. I want it to speed up and slow down, not just >100

    > What do you want the score to do when you slow down or stop?

    >

    Ideally I would like the score to increase with the speed of the player. So if they slow to a crawl, so will the score. I guess I want the score to be linked to the RPMs instead of setting it to every .25 seconds

    OK yes you will need a global variable and use Every Tick to set that to the players speed.

  • OK yes you will need a global variable and use Every Tick to set that to the players speed.

    But how? If I set every tick, check player speed and add to score, I'm going to get some crazy numbers (max speed is 1000). My current work around is this, but it does not give me accurate readings.

    Every 1 second if speed is greater than 100 add 1 to score

    Every 0.5 second if speed is greater than 400 add 1 to score

    Every 0.25 second if speed is greater than 900 add 1 to score

    Is this the only way for me to do what I am trying? Just have to add more speed checks, maybe for every 100 speed?

  • If you don't want it checked every tick and added to score the you will have to set limits as you have done and every 50 or 100 would work.

    I would have to see your game capx to tell you more as I am not sure how your game is played to give you any more suggestions.

  • If you don't want it checked every tick and added to score the you will have to set limits as you have done and every 50 or 100 would work.

    I would have to see your game capx to tell you more as I am not sure how your game is played to give you any more suggestions.

    I can share it later once its a little more put together.

    I don't mind it checking it every tick, I just dont understand how to add points to the score in smaller increments. If the player is driving and their speed is 687, is it going to add 687 to the score, then 688, then 689, etc.? That score will go off the charts very quickly. I wanted to keep the score raising, in the single to double digits, not triples and quadruples.

  • Then you will need to set a speed number to check instead of every tick.

    You use global variables for that

    Global Variable SPEEDCHECK =0

    Every Tick Set SPEEDCHECK to Player Speed

    On SPEEDCHECK = 25 Add 25 to Player Score Set SPEEDCHECK to 1001

    On SPEEDCHECK = 50 Add 50 to Player Score Set SPEEDCHECK to 1001

    On SPEEDCHECK =0 Subtract 100 from Player Score Set SPEEDCHECK to 1001

    It all depends on how you want your game played but those are the events and you just have to set them how you want your game played.

    You have to set SPEEDCHECK to a number you are not checking after each speed check event or it will keep adding to the score as long as the player maintains that speed.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)