Android SQLite and GAME MODE Logic
I have a game and I want to add modes to it. What I can't figure out is if I need a separate database for each mode, or if I can structure the DB to h开发者_运维技巧ave multiple scores for each mode and pass the mode and score in a sort of if else if statement.
Could any body shed some light or point me in the right direction?
if the only difference is the type of game mode played, but the rest of the score data is the same or similar, i'd just add a field to the highscores table so it might be: (_id, mode, date, name, score) if the data is very different (like in one mode you just have a traditional high score but in another you track many different metrics, a different table might be in order.
in the first scenario, you don't need an if else statement, you just say insert into highscores (mode, date,name,score) values ("easy",'4/14/11',jkhouw1,'over 9000')...
then when you get the scores back, you just query where mode=yourDesiredMode
精彩评论