This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

MathManiac
MathManiac presents ...

2012/8/19

UserInfo Test

Hello,

I am here to bring you my test of UserInfo! This is my first time working with UserInfo, and I am going to run many tests with UserInfo before I get to working with it.

3422 views / 9 in the last 7 days

1 vote | 0 in the last 7 days

Tags: simulation with-source userdata

open in greenfoot
Your browser does not support the canvas tag.
danpostdanpost

2012/8/19

Please refer to it as UserInfo (not UserData). It might confuse others. Thanks.
MathManiacMathManiac

2012/8/19

Oh yeah... I got confused the two names until I looked the Greenfoot Class Documentation when I got an unidentified class error.
danpostdanpost

2012/8/19

Now you have the update info and descriptions to change also. Are you counting the number of times a user opens this scenario. If so, you will get erroneous results. Each time I click 'Reset', it increments my 'Logins' counter.
MathManiacMathManiac

2012/8/19

Exactly. I had some mislabeling of stuff..... I meant "Logging into the Scenario" :P It's meant to count how many times you run the game. If you hit "reset", then all of the initialization is reset, so I just had to live with that. Now since I know how UserInfo works, then I could create a game that uses UserInfo to "log in" and get save data (Yipee!).
danpostdanpost

2012/8/19

You would get a lesser count, if you counted the number of times the scenario was 'started'. Also, by using a boolean to flag if the scenaio was started or not, you could count how many times it was compiled!
MathManiacMathManiac

2012/8/19

Wouldn't the boolean be reset every time it's restarted? Along with overriding the World method started()?
danpostdanpost

2012/8/19

Not if you made it a class field (static). Then it is only reset upon re-compilation (or programatically).
PoliPoli

2013/2/15

could you publish a code for user info? (i want to use it in my scenario)

Want to leave a comment? You must first log in.

Who likes this?

JetLennit