View Full Version : "New" keyword in Alice

12-09-2011, 08:23 PM
Is there such a thing?

For example, if I want to instantiate a penguin class to I have to explicitly show it in my scene or is there a way to do it programatically throughout the execution of the code?

David B
12-09-2011, 09:14 PM
I am having a hard time understanding what you are asking for.

12-11-2011, 09:08 AM
I could not figure out a way to instantiate a class object in code per se. For example, if I want to fill a scene with penguins by instantiating them in code and filling an array with these objects, the only way I can see to do this is by adding the penguin to the scene first, then using the object instance.

pseudo code:

class penguin;

array penguins;

penguins [0] = new penguin;
penguins [1] = new penguin;

12-11-2011, 03:17 PM
You must instatiate all objects[within the world] before using them in code.

12-11-2011, 04:31 PM
Actually, there is no inborn way to do it with Alice, but Arty figured out a way a while ago to breed them in the world, see here: http://alice.org/community/showthread.php?t=6831