Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How Do I? (http://www.alice.org/community/forumdisplay.php?f=28)
-   -   "New" keyword in Alice (http://www.alice.org/community/showthread.php?t=7772)

mcgski 12-09-2011 08:23 PM

"New" keyword in Alice
 
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.

mcgski 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;

legolizard 12-11-2011 03:17 PM

You must instatiate all objects[within the world] before using them in code.

TauTrumpsPi 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: [url]http://alice.org/community/showthread.php?t=6831[/url]


All times are GMT -5. The time now is 11:05 PM.

Copyright ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.