This is an example implementation of a treasure hunt game in Dart. It is meant for educational purposes to learn programming in Dart.
You can try the following example application in your browser:
- Predefined treasure destinations (in latitude and longitude). User can choose a destination.
- Uses HTML5 Geolocation API (GPS, etc.) to get the position of the user.
- Calculates distance between user and destination.
- Displays a compass to indicate the direction of the destination.
- If supported by the device, the compass is turned to always face the magnetic north.
- When close enough (e.g. 30m) to the destination, a message and an imaage is displayed.
The treasure hunt app could easily be changed into various other scenarios:
- A Geocaching client.
- A Scavenger Hunt.
- In iOS Safari the compass points in an arbitrary direction. North will point in the direction the device is facing when the app was loaded. This will be resolved when [Dart Issue 19119](is fixed).