Coding objects to move using javascript

I would like to create a javascript tutorial for my Year 8 (12/13 year olds) to learn some basic programming concepts such as functions, lists etc. My plan is for them to create an aquarium scene which we will then annotate to analyse the code as they have specific concepts to learn as part of the curriculum. Anyway to my immediate problem - thanks in advance for help…

When I add an object such as a turtle and run the code in the attached picture I would have thought it would have moved. I also tried to createItem() method but this only works for some objects - 3D low poly objects?


Hi Ronan,

Scene must be written with an uppercase S.

var turtle = Scene.getItem('S4W27b8Vr4');

You can catch small errors like this when you switch your editor setting to “TypeScript”.

Classic - school boy error! Thanks so much - I’ll give typescript a whirl - never used it before.

Hi Ronan,

you don’t necessarily need to learn TypeScript when switching to it in the editor. All JavaScript is also valid TypeScript, but it enhances the JavaScript language with all kinds of additional features.