How do I add a speedometer to my game so people can see how fast the vehicle is going?
Comments
Braydon_SFXMember, Sous Chef, Bowlboy SidekickPosts: 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.
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
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_SFXMember, Sous Chef, Bowlboy SidekickPosts: 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.
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_SFXMember, Sous Chef, Bowlboy SidekickPosts: 9,273
You already started a thread about the speedometer here:
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
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.
Comments
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.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
How are you controlling the speed then?
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
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.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
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
http://gamesalad.com/forums/topic.php?id=32966
Lets just keep it to one thread please.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
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.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left