counter of meters
saadaoui59
Member Posts: 13
hello everybody
so i have a question:how to put a counter of meters?
thank you
so i have a question:how to put a counter of meters?
thank you
Answers
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
http://www.funkymunkygames.com/GameSalad/search/
It's the 'distance moved' one.
Anyone know if that demo that @codemonkey did is still around? I could use a means to measure distance for a game using a scene-wrapping background..
thanks!
-- J
@KnightStar Something to think about is what distance actually means in a game and with GameSalad. If your background is scrolling, then it is scrolling at a certain speed. Decide what formula you want to use (for example: meters=background distance in pixels divided by 10; or meters=time in seconds multiplied by 50) and then work on the math or ask questions based on a specific wording of your formula.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@Tatiang - Thanks for the insight.. I haven't started thinking about the math just yet as I wanted to see something in action before grinding away. (dunno why, but I tend to a be a visual developer in which I work better by seeing an example, etc. and adjusting accordingly to fit my needs)
That said, the concept I'm looking at is essentially the same as the Shot-Put or Hammer-Throw track & field events, in which after an interactive wind-up (e.g. tapping buttons, etc.), the objects hurdles upwards and then downwards on the screen as the background images scrolls along. The background will slowly slow down as the object decelerates and lands (bounces along) on the ground before coming to a stop.
I don't think I can use meters=time, since there will be an obvious acceleration and then deceleration from when the object is launched and then slowly bounces to a stop.
-- J
@KnightStar Oh man, I worked on a side-scrolling golf game for ages (probably 100 hours, no kidding) and it became so complex that I gave up on it... for now. It was also one of the first apps I designed so I was very adept at keeping things efficient and clear. Anyway, your description sounds like exactly what I designed. You're right that you can't use time. In that case -- and my golf game works this way -- you just constrain the number of meters to the hammer's (self.position.X-self.position.StartingX)/[some factor]. So if the hammer has traveled from x=100 to x=700, then the difference is 600. If you decide you want that to equal 200 meters, then your factor is 3 and you divide 600 by 3 to get 200. Following that example, if you then throw the hammer from x=100 to x=600, it would equal 167 meters because (600-100)/3=167.
Well, I just gave a visual learner a written explanation... some teacher I am!
I'll send you a video of the golf game so you can see it. I don't think I've ever shared it on the forums because I still want to publish it.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User