onUpdate, is not being called?
rickierich

Had a look at the flappy bird could you give an example of a scripted version of that tutorial. As steps like adding eventListeners etc are held out. 

You really can't look at the editor tutorials and follow the same logic for scripting. There are steps that are not clear and it does not act in the same way. Especially with setVelocity and getVelocity.

All 2 Comments
Gio

Generally speaking, in most cases you don't need to add event listeners manually.

When you add a SceneObject to the scene (with wade.addSceneObject), with no additional parameters, the object and its behaviors are scanned for functions called onUpdateonMouseMoveonClick and so on. When these functions exist (on the object or on one of its behaviors), the object will automatically listen for the corresponding event(s).

You can also add an object to the scene, and later define its event handlers. If you do it this way, you'll have to manually call myObject.listenFor('eventName').

Regarding setVelocity and getVelocity, I don't know what the problem is - I can't see why there would be any differences between an editor-created project and purely scripted one. If you can elaborate on what the problem is, I will have a look.

rickierich

Thanks for your help.

Post a reply
Add Attachment
Submit Reply
Login to Reply