GameLab needs the Data tab and Database API

Hi code.org Developers,

(Not sure where else to put this except in Uncategorized.)

In the Post AP Unit in CS Principles there is a lot of cool data concepts (Post AP, Chapter 1) and database functionality (POST AP, Chapter 2) that are introduced to the kids. For my final project, I am having the kids remix their Create PT apps to include database functionality. However, some of my kids did their Create PT project using GameLab instead of AppLap.

Question: why aren’t the Data tools available in GameLab?

I mean how else are you going to keep track of all-time high scores and the three-letter high score names?

Please consider adding the Data tools to GameLab.

Thank you.

RJB 999999

1 Like

Thank you for the suggestion. I will pass this along to the powers that be and see what they can do with it! It’s neat to see the innovative things the students are doing with the tools provided!

Thank you for the response.

(I meant to post this in CS Principles. Oops.)

Hello,
I’ve been needing this too. It’d make a great addition to the GameLab. But it would also need modifying of the library that they use for it. (p5.js) so either they’d need to have a seperate file, or rewrite some of the core library.

Data tools are available in gamelab, they are just not visible. setKeyValue and getKeyValue are all available and I have created numerous games using them.

Hello,
After reading this, I opened up a new project in GameLab and tried it out.

var testString = "test";

setKeyValue("test",testString);

getKeyValue("test", function(value) {
  console.log(value);
});

you could expect it to log “test” in the console. but instead it logs undefined.

setKeyValue has a callback, I’m not sure exactly what the term is called, but see it like this:

setTimeout(function(){x=5}, 1000)
console.log(x) // undefined

this is how to do it

setKeyValue("abc", "x", function() {
getKeyValue("abc", function(result){
console.log(result) // "x"
})
})
1 Like