[Adventurer] Persistence Pays


#1

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.


#2

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 > db.best:
        db.add('best',game.defeated-db.best)


#3

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.


#4

Hi,

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

ui.track(db,“defeated”)

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?


#5

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