开发者

Android: which data storage and retrieval for a pokemon like game

I am making a game for Android and I'm having a tough time figuring out the best and or easiest way to implement my data storage and retrieval. As a player, you will have one monster who will be fighting other monsters 1 at a time and each monster will have a set of 4 moves (similar to pokemon). The monsters each have their own stats such as name, health, attack, defense, and moves. Each move will have a name, description, attack type (enum), and an float modifier. I will also be introducing items into the game and new moves that you will "build" using resources that drop from defeated monsters so each item and move will also have a list of required resources to make them.

So far I figured out the easiest way to handle the player's monster is with preferences and have that working. At the moment I can read in arrays from xml files开发者_运维技巧 with each array representing one stat from the monsters and every specific monster will have one shared index between all the arrays so when I retrieve the value from each array at a specific index, it corresponds to the same monster.

This probably is not the best way, but I'm still learning Java/Android programming and struggled to get the SQLite DB figured out. The moves and items seem to be the hardest because each will have certain stats like their name, type, etc but I will also have a recipe list (2 fire cores, 4 frost badges, etc to make 1 item).

What would be a good way to get this all working that would be relatively easy for someone new to Android programming? I tend to do best with tutorials that walk me through the code and files needed and will allow me to modify the code to suit my needs.


For any sort of complex data storage (such as what you describe), it will be well worth your while to learn SQL/the Android SQLlite database API. If you're new to SQL, this is a good place to start. If you've done some SQL before and you're just looking to learn the android implementation of it, the notepad tutorial on android developers is a good place to get some exposure.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜