Sunday 1 May 2011

collection sorted now to sort the score update

i luckly found this in the google api documentation
google.maps.geometry.spherical.computeDistanceBetween(latlng pointA, latlng pointB);
which calculates the distance in meters between to points which allowed me to found out the distance of the user from all the collectables i then did

if (distance < R)
{
colls.setMap(null);
}
R = a radius around the user
distance = the distance returned from google.maps.geometry.spherical.computeDistanceBetween

so now as the user comes into contact with the collectables they are removed from the map
win
now i just need to add something like

send score(+10) or something to update a score

nearly there however i dont think i will have the time to make the ghost but i will try i have a bit of script that animates a mark alone a poly line so i should be able to change that to make my ghost but will have to see if i have time

No comments:

Post a Comment