-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Right now, Leopard targets (sprites and the stage) have a .vars object. Projects converted via sb-edit have all the Scratch variables converted to key/value pairs on the vars object.
When I edit Leopard projects manually, I am constantly annoyed by this and choose to just assign things directly to the sprite itself instead, like so:
// Current
this.vars.n = 5;
// What I prefer
this.n = 5;This gives a far more "normal" JavaScript development experience, which I think is better for Leopard users who are learning to write JS code.
The only argument I can think of in favor of vars is that it provides a namespace so that you can, for example, have this.vars.x be a variable and this.x be the sprite's x-position. In my opinion, it would be better to stop using this namespace and instead have sb-edit convert to this.var_x and this.x or similar.