This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-06-12 20:07:31

Nick60
Scratcher
Registered: 2007-06-17
Posts: 100+

Java Tut: Voids

In java you will be 100% hit with public voids.
Public voids are in a way a place to clear up things..
Let's take this for an example..

if(objectID="573) {
callobject();
}

callobject();   is the "calling" card for the public void..
You have to declare it and you will be doing that by going to ethier the begining of the file, or the end (doesnt matter really)

public void callobject() {
if anim = 30 {
sendMessage("Hello");
setanim = 30;
  }
}

instead of writing the whole statement, you only put callobject(); which means the same thing as the public void.

It's good for big things that repeat..
Like if we wanted to use it for object 574, and make it do the same thing, we will use publics voids to clean up the file and make it smaller.


Let's  Be Blue!

Offline

 

Board footer