简体   繁体   中英

Android 2D game on a Map

I'd like to develop a simple game for children to let them learn their country in detail by playing a 2D game on the map of the country. Imagining to determine a start point somewhere on the map for example said "New York". The player will be asked some questions about this city, if the answers are correct, the small car staying in the boundaries of New York will move forward to Pennsylvania and so on. When the car moves to each city, that one should be coloured differently. I looked for "svg" files, some game development tools, Imagemap etc but nothing really came to me suitable for my purpose. My question may be unprofessional and im really sorry for that but hoping not to get minus points to be able to improve myself in programming by your help and really hoping for an advice. Thank you very much.

At the moment, to make controlled (ie triggered by you) animations of SVGs on Android, you would probably need to use a WebView. The WebView would be displaying an SVG that you could control via javascript.

You should have no trouble finding tutorials on how to use a WebView.

As for the animation part, questions like the following would be a good starting point.

Your Android app can invoke Javascript functions on your page using

webView.evaluateJavascript("runAnimation(1)");

Or you could have separate SVGs for each animation. Then load the appropriate one for the journey you want to animate.

An alternative to SVG animations if you have Adobe After Effects available, is to create animations with that. Then use AirBnB's Lottie library to play them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM