Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   The Lounge (http://www.alice.org/community/forumdisplay.php?f=4)
-   -   Assign4-TT (http://www.alice.org/community/showthread.php?t=10852)

thien 09-23-2014 04:01 AM

Assign4-TT
 
1 Attachment(s)
This assignment is not difficult, however it's a little time consuming. My character is a tiger. He walks from the left of the screen to the middle, greets his audience, then starts singing. At first I have him jump at random heights during the same song, however after re-reading the instruction, I made him jumps at the same randomly set height throughout the whole song. I'm much more comfortable working with parameters and variables now. Again, making him walk is still the most tricky part. I did not make him a stage, poor tiger!

By the way, does anybody know exactly what is the difference between functions and methods in Alice?

MrMoke 09-23-2014 10:17 AM

A Little Different
 
They both contain code that does something. The main difference is that Functions return a value "Type" that's pre-defined when it's created. Thus, if you create a [U]Boolean[/U] function, parameters can be passed into it, it rolls through some logic, and returns a true or a false.

RavenOfCode 09-23-2014 06:49 PM

Functions
 
Functions return a value, methods do stuff, functions are not seen on the screen they are back round process's that process and give us information such as "is the monkey blue". However methods are seen, they perform an action, such as "moving an object".

Does that clear it up?

relliott44444 09-24-2014 07:08 AM

In answer to your question, a function returns a some item to the caller (the return item may be an object too). A method, in contrast performs a defined capability for the object.


All times are GMT -5. The time now is 02:53 AM.

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