Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How Do I? (http://www.alice.org/community/forumdisplay.php?f=28)
-   -   missing universal varibles (http://www.alice.org/community/showthread.php?t=9968)

jtljmeyer 03-10-2013 01:10 PM

missing universal varibles
 
I just downloaded the new update of alice 3. I made some universal variables, but I am unable to find them and use them in various procedures. For example I need to keep score between the computer character and the user. The first to ten wins. Have you moved them someplace else?

MrMoke 04-07-2013 10:47 AM

My Best Guess
 
Best Guess at this point is that the "Program" button in the "Type Hierarchy" would be a good start.

From there you can create new properties(aka: variable/constant types) that "might" be available to multiple Scenes(maybe).

If you click on the "Scene" tab, there is also a button to add new "unmanaged" properties(aka: variables/constants) to the Scene. Best guess is that these would be available as locals to the Scene, but maybe not the program?

No documentation to support my assumptions at this point.

djslater107 04-08-2013 11:43 AM

Universal variables
 
Alice 3.1 uses an object oriented implementation, designed to support learning Java. As in Java, there really is no such thing as universal variables in Alice 3. The fields that you created in the Scene class belong to the scene and not to the entire program...

Fields created in the Program belong to the Program class.

Fields that you create in the Scene must be passed as parameters to the class methods of other classes that would like to use them.


All times are GMT -5. The time now is 04:50 AM.

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