Making a speedometer

0 favourites
  • 4 posts
From the Asset Store
Make your own platformer for both the web and mobile easy with this Santas Platformer Template, FULLY DOCUMENTED
  • Hello

    I am trying to make a speedometer, but i have no idea how can i. Does anyone have an idea how to do?

    Thanks

  • maybe you san use "set angle" to your speed indicator, to point at your current speed

  • I have done this before. The way I did it is with a sprite for the needle. Then I plugged in a formula:

    every tick | set angle to 185/700*Player.Car.Speed + 45. (my needle sprite is pointed straight down, so using this formula, at 0 speed, the needle points 45 degrees past straight down which is bottom left, and at 700 (my car's max speed) it points 230 degrees (185/700*700 + 45 = 230) past straight down which is top right.

    My capx is too big to upload to the forum, but if you need to see it, I'll try to shrink it or put it on google drive or something. Just let me know.

    EDIT: Wasn't too hard to shrink. Just check out the every tick event and the needle sprite.

    [attachment=0:1o1y0jyv][/attachment:1o1y0jyv]

    (W for gas, S for brake)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have done this before. The way I did it is with a sprite for the needle. Then I plugged in a formula:

    every tick | set angle to 185/700*Player.Car.Speed + 45. (my needle sprite is pointed straight down, so using this formula, at 0 speed, the needle points 45 degrees past straight down which is bottom left, and at 700 (my car's max speed) it points 230 degrees (185/700*700 + 45 = 230) past straight down which is top right.

    My capx is too big to upload to the forum, but if you need to see it, I'll try to shrink it or put it on google drive or something. Just let me know.

    EDIT: Wasn't too hard to shrink. Just check out the every tick event and the needle sprite.

    [attachment=0:21qfx56k][/attachment:21qfx56k]

    (W for gas, S for brake)

    Thanks a lot! I will check it out.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)