Flash Game + Awarding Points

I am trying to create a Flash game where the player will try and guess where an object is.  I have a timer and what i want to do is award points each player depending on the distance to the actual object and depending on how quick they made the guess.  I have the distance figured out and of course the time.  But i can not figure out how to award points.  I want the person with the closest guess in the shortest amount of time to have the most points.

Thanks for the help
dkilbyAsked:
Who is Participating?
 
snoldak924Connect With a Mentor Commented:
oops, forgot about time.  Just start the timer when the scene loads, and stop it when the user clicks.  Then just use it in your formula (scene dimension-distance)*(max time-user's time)
0
 
j3oneCommented:
you could use a "dart-board" type scoring system, well sort of. More like a hit area of grids, and any click witin that area would be worth X amount of points.

In other words instead of calculating the distance by pixels, then reversing the point structure so that a higher number(distance eg. 70) = lower points, wheras a closer number(pixel eg. 30)....
You can just have a grid set up where if the object is in the top left corner, and you had 25 grid sections, you would give higher point valuse to the grid areas closest to the left corner object, and decrease them as you progresed to the bottom right corner.

-> Just an idea, j3one
0
 
dkilbyAuthor Commented:
i have thought about that, but really want to go with a distance and time system.  Just can't figure out the best calcuation of doing it.
0
 
snoldak924Commented:
just add mouse coordinate variables that are set when the user clicks:
on(press){
mousex=...
mousey=...(forget at the the moment how to get mouse pos ;)
}

Then, use distance formula, d=(mousex-objectx)^2+(mousey-objecty)^2)^(1/2) to figure out the distance from mouse click to object.  Then, just use a simple (scene dimension-distance) for points.

Tell me if you need more clarification,
0
 
dutchfoxerCommented:
Sounds like the game with a football picture/photo where you see the football players but not the Ball. You need to click on the photo where you think the ball is.

So you know distance and time right? At time of click you have logged the x and y position of mouse and compared it to correct location x and y!? And you know after how many seconds.

* If distance is 0, then spot on. The lesser the distance the greater the score.

* If time is 0 then superfast. The longer the lesser the score.

So you have 10 points for starters, minus the seconds it took, minus the distance. And maybe an IF-Statement in case the score is a negative number, then score = 0 (with text for gamer "your terrible, fool!")

score = 10 - distance - duration

Sounds okay?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.