Distributing Scratch Projects

Scratch is an interpreted programming language. This means that unlike some programming languages, such as Visual Basic and C++, which compile their applications into an executable file that can then be run on other computers without requiring that the programming language be installed, Scratch applications can only execute when run within the Scratch IDE (or on the Scratch website at http://scratch.mit.edu). Therefore, if you want to distribute your Scratch applications and have them execute on someone else’s computer, you must first see to it that Scratch is installed on the other computer, or you must create a special application distribution CD that includes Scratch system files required to run your application when Scratch has not been installed.

Note

You can also share access to your Scratch application projects by posting them on the Scratch website and pointing your friends to that website, where they can view and run them using a Java-enabled web browser. You will learn all about the steps involved in sharing your Scratch applications this way in Chapter 13, “Sharing Your Scratch Projects Over the Internet.”


Distributing Scratch Applications to Windows Computers

The files that you need to burn to your distribution CD-ROM vary, depending on whether you are working with Microsoft Windows or Mac OS X. When working with Microsoft Windows, you will need to burn the following files identified in Figure 4.25, as well as a copy of your Scratch application, to a CD-ROM.

Figure 4.25. Burn a copy of the files shown in this figure along with your Scratch application file to create a distributable Windows CD-ROM.


Each of the files listed can be found in the folder in which you installed Scratch, which on Microsoft Windows is C:Program FilesScratch by default.

  • Scratch.exe

  • Scratch.image

  • Scratch.ini

  • ScratchPlugin.dll

  • Mpeg3Plugin.dll

  • License.txt

Note

The reason for including the License.txt file, which is Scratch’s license document, is to ensure that anyone you distribute your CD-ROM to will know the terms of the license agreement. Including this file will also keep you out of legal trouble.


Distributing Scratch Applications to Mac OS X Computers

If you are working with Mac OS X and want to create a distribution disc to share your creations with other Mac users who do not have Scratch installed on their computers, you may do so by burning a CD-ROM containing your Scratch application projects as well as the following Scratch system files, all of which are available in Scratch’s installation folder.

  • Scratch.app

  • Scratch.image

  • License.txt

Instructions for Executing Your Application from a CD-ROM

Once you have burned a CD-ROM for your Scratch application, you need to tell your friends how to execute it, which can be done by double-clicking on Screatch.exe (Windows) or Scratch.app (Mac OS X), which will start the Scratch IDE, after which your application can be accessed by clicking on the IDE’s Open button.

Alternatively, for Windows users, you might want to consider adding a batch file for each application that you added to the CD-ROM that when executed will run one of your Scratch applications. You can do this by opening your preferred text editor (such as Notepad) and keying in a single statement using the following syntax.

Scratch.exe Scratch.image ScratchProject.sb

Here, Scratch.exe is the name of the Scratch executable that starts Scratch. Scratch.image is a required Scratch system file, and ScratchProject.sb represents the name of a Scratch application that you have added to the CD-ROM. Note that the .sb file extension has been included. Once you have typed in this statement, save the text file with a filename that ends with a .bat file extension (MrWiggly.bat, HelloWorld.bat, etc.).

When a batch file is added to the CD-ROM along with all of the files already listed, your friends can start your Scratch application by double-clicking on it. Once double-clicked, the batch file will open Scratch and load your Scratch application project into it, making it ready for execution.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.133.54