Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

[Adventurer] Persistence Pays


The level Persistence Pays is ready for playtesting.

This level takes place in the Game Dev 1 campaign, it introduces the db.add(key, value) command which allows students to persist information between plays of their game.


Interesting. Does this count anyone playing this page, or only mine?

Is it possible to track two things with the same name?

ui.track(game, 'defeated')
ui.track(db, 'defeated')

Also, what about tracing best scores?

ui.track(db, "best")

def onVictory(event):
    if game.defeated >


In this level it’s effectively just for you, but if you use these db commands in a level like Tabula Rasa, and then share the link to your game, it’ll be for everyone who plays your game.

Good idea :slight_smile: This is just the beginning. The students in Game Dev 1 don’t know how to do a lot yet, but for the more advanced folks, have fun with it!. Josh made a demo game that counted how the different ways the players were killed :wink:

We will teach more advanced uses in later Game Dev campaigns, and evolve the complexity of what the db commands can do, until it’s more like using a real database in the later courses.



In this level, you need to track the game’s defeated property, but it’s not tracking mine.

I think that this bit of code:

Show the value of the “defeated” property of the game object


Which is already there i.e. I didn’t add it. Does this, obviously it doesn’t otherwise I’d be finishing the level.

What am I missing?


Track the game`s “defeated” property , not the “defeated” property of db object.


How do I do this part?


Have you figured this out yet? I’ve tried every combination with db.set and db.add, and I still can’t get it to accept. I’m clearly doing something wrong.


Can you post the code here so we can assist you?