How to add speedometer?

BranFlizGamesBranFlizGames Member Posts: 91
edited November -1 in Working with GS (Mac)
How do I add a speedometer to my game so people can see how fast the vehicle is going?

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Hey there,

    Assuming you have an attribute already in your game for the speed.
    Example: 500.

    Just make another actor called speed show.
    Put a display text behavior in that actor. Then, in the place that says 'Hello World!' put your attribute for your speed. It will then show your speed in game.
  • BranFlizGamesBranFlizGames Member Posts: 91
    I dont have an attribute for speed..please tell me how to do it with the step of the attribute
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Well maybe that won't work.

    How are you controlling the speed then?
  • BranFlizGamesBranFlizGames Member Posts: 91
    like how am i getting the vehicle to move? and i want the speedometer to follow the speed that the vehicle is moving so when its stopped its at 0 but when it goes it shows the current speed
  • dmilinovichiiidmilinovichiii Member Posts: 620
    BranFlizGames said:
    like how am i getting the vehicle to move? and i want the speedometer to follow the speed that the vehicle is moving so when its stopped its at 0 but when it goes it shows the current speed

    I'm not certain, but I think you need vectors for this. I think vectors are supposed to be coming this winter.
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Have an integer attribute for the speed.
    Set that attribute for the speed in your car or whatever.

    Example: Move: game.speed to 500

    Then, create another actor called display speed and put a display text behavior in that.
    Put the game.speed attribute in there and move your stuff onto the scene, that should do it.
  • BranFlizGamesBranFlizGames Member Posts: 91
    Braydon_SFX said:
    Have an integer attribute for the speed.
    Set that attribute for the speed in your car or whatever.

    Example: Move: game.speed to 500

    Then, create another actor called display speed and put a display text behavior in that.

    Put the game.speed attribute in there and move your stuff onto the scene, that should do it.

    ok then how do i make it where when the car goes in reverse it shows its reverse speed? because i have the speed for forward 75 and reverse 35
  • BranFlizGamesBranFlizGames Member Posts: 91
    so i am trying to get it to say the speed of the truck when it is going backwards..it works but the only problem is that there is a zero behind it....that zero is there because i have it "when game.gas(pedal) is false" "display text 0"

    to reverse you have to use the brake pedal (game.brake)

    how do i get rid of the zero when i press the brake pedal without getting rid of the zero when no pedals are pressed
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    You already started a thread about the speedometer here:

    http://gamesalad.com/forums/topic.php?id=32966

    Lets just keep it to one thread please.
  • BranFlizGamesBranFlizGames Member Posts: 91
    i know but that one was on how to make it...this is help with it..i just thought it needed a new one because it seemed different..sorry
  • BranFlizGamesBranFlizGames Member Posts: 91
    ok i am having problems with it...i get it to say 75 when i press gas pedal and when im not pressing anything it says 0..but when i press the reverse pedal the 35 comes up but the 0 doesnt go away
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    I merged your two speedometer threads. I left the artwork one separate since it makes sense too.

    in order to keep the forum tidy, we try to keep all topics together. it's one thing to post a topic, then a week later another topic on a slightly different subject, but if you're posting them so close together, they probably ought to be in the same thread.
  • BranFlizGamesBranFlizGames Member Posts: 91
    alright sorry...but can someone help me with getting rid of the zero when i reverse?
  • BranFlizGamesBranFlizGames Member Posts: 91
    here is what i mean
  • BranFlizGamesBranFlizGames Member Posts: 91
    i fixed it..you can close thread now
Sign In or Register to comment.