• No results found

Uploading Your Project

In document Hacking Raspberry Pi 2013 (Page 173-177)

Now that you’ve completed your project, it is time to share your work with the Scratch community.

Why do this? Here are a few good reasons:

You’re proud of your work. You just invested time and effort in creating your Scratch game.

Thus, you want to get the application in front of as many sets of eyeballs as possible. This is a natural and honorable motive of any self-respecting software developer.

Share and share alike. The spirit of open source software is to share your work with other developers to solicit their feedback. By contrast, you are expected to offer constructive criticism of other peoples’ Scratch projects. That’s how we all learn!

Task: Share Your Scratch Project

Sharing your Scratch project with other Scratch users around the world is the best way to get your game (and underlying code) in front of as many eyes as possible. You’ll be able to garner feedback from other Scratchers, and the sense of accomplishment you’ll feel when other users create remixes of your work is indescribable.

1. With your project open in Scratch, click Share, Share This Project Online or click the Share This Project button on the main toolbar. The interface is shown in Figure 9.11.

FIGURE 9.11 You can upload your Scratch project to the Projects website directly from within the Scratch application.

2. Fill in the fields in the Upload to Scratch Server (scratch.mit.edu) dialog box as completely as possible. Let me help you understand what’s involved:

Your Scratch website login name and Password: As with most things Scratch-related, you must have a free Scratch account to upload a project. Click Create account to, well, create a new user account.

Project name and Project notes: These fields are automatically populated based on the .sb project file name and any project notes you added. I highly recommend you add

project notes (welcome message, instructions, and so on) to help people understand and use your Scratch app more efficiently and effectively. You can add your project notes either in this dialog box or by clicking File, Project Notes in Scratch.

Tags; More tags: Tags are keywords that make it easier for Scratchers to find projects on the Scratch website. You can select any of the six prebuilt tags and/or define your own.

Compress sounds and images: This option is a good idea because it makes your Scratch program smaller. A smaller .sb file means that the app runs faster in the web browser and takes less time for your users to download from the Scratch website.

As you saw in Figure 9.2, the MIT Media Lab developers give you a dedicated web page for each app you upload. Be sure to check out the page and perform the following actions on a regular basis:

Read comments left by other Scratchers and take their criticism constructively.

Proofread and potentially edit your project notes. You can do this directly from within the web browser, provided you are logged into the site with your Scratch account.

Consider adding additional tags as they occur to you. There is no upper limit on how many tags a Scratch project can have associated with it. To that point, other Scratchers can tag your

project as well.

Remixing

Sometimes you’ll come across a Scratch project that is so good it leads you to think, “I’ll bet I can make this good app great!” This notion is perfectly legal as well as in keeping with the open source community spirit shared by Scratch and other public domain frameworks.

In Scratch nomenclature, a remix is a Scratch project that is based on somebody else’s Scratch project. When you publish a remix, a link to your remix is accessible on the original app’s home page. By contrast, viewers of your app can click a link that takes them back to the original app’s home page at scratch.mit.edu.

Remember that the name of this program, Scratch, derives from the disc jockey (DJ) term of moving vinyl records back and forth to create rhythmic sounds. Similarly the term remix refers to the method by which musical artists re-record their songs by using the same melody but changing the style.

Note: About Licenses...

Scratch apps fall under not the traditional GPL license like Raspberry Pi does, but instead under the related Creative Commons Attribution-ShareAlike 2.0 license. You can read the user-friendly license details at the Creative Commons website at http://is.gd/FAsiS7).

Task: Create a Remix

1. Download another Scratcher’s project from the Scratch Projects website.

2. Modify the project as needed.

3. Upload the project using the method described earlier in the task, “Share Your Scratch Project.” The bi-directional linking and notifications between the original author’s project and your remixed project happens automatically, or as my old friend Jeff Kane used to say, “automagically.”

Chapter 10. Programming Raspberry Pi with Python—Beginnings

If you emerged from Chapters 7 and 8 relatively unscathed, you are ready to embark on a more comprehensive programming adventure.

Scratch is a lot of fun to program, but the environment hides all of the programming complexity; this is by design, as previously discussed. Many educators consider Python to be an ideal first “true”

programming language for the following reasons:

Python’s syntax and data typing are relatively intuitive and fairly forgiving of rookie mistakes.

Python is heavily documented; you can find easy-to-follow tutorials just about anywhere.

Python’s interactive interpreter makes learning new stuff fast and fun.

Python offers an amazing number of importable code libraries that give beginning programmers tools to build any kind of application.

Python is called a “general-purpose, high-level programming language” whose overarching design principle is code readability. In fact, you would be well-advised to read what Python fans consider to be their fundamental, guiding principles: the Zen of Python (http://is.gd/sXV6IU). Let me share with you my favorite entries from the Zen document:

Explicit is better than implicit.

Simple is better than complex.

Readability counts.

For three simple sentences, that’s quite a bit of wisdom, right? As a programmer, you are much better off writing code that is as straightforward as possible and documented in such a way that any other Python programmer can read your code and instantly understand how your program works. To be sure, if you’ve been practicing with Scratch, you already understand how important community support is when you’re developing software projects.

Python’s focus on clarity and readability probably weighed heavily into the Raspberry Pi Foundation’s decision to build the Raspberry Pi development platform around Python. If you ever saw C or C++ code, you will instantly appreciate how much more approachable Python is on almost every level.

Note: Where It Began

Just a tad bit of history before we dive in: The Python programming language was invented by the Dutch programmer Guido van Rossum in the late 1980s. Rossum needed a fast, intuitive scripting language to help him automate administrative tasks, and he wasn’t getting very far with the tools he had in front of him at the time. Thus, Guido adapted the ABC programming language that was popular in the Netherlands at that time to a new language that focused on simplicity and readability without sacrificing power—enter Python!

What’s so cool about Python is its flexibility—some call Python a scripting language because you can write and test code quickly without the need for binary compilation. On the other hand, because Python has grown into a robust language that supports enterprise-level concepts such as object orientation, the term high-level programming language seems more appropriate for Python.

The way I want to teach you Python in this chapter and the next one (itself a hugely daunting task), is to jump right in and get your hands dirty with the environment. At the end of this chapter I give you some hand-selected online and print resources with which you can take the next steps in your development as a Python programmer.

To that point, however, I strongly encourage you to pick up Sams Teach Yourself Python Programming for Raspberry Pi, written by my Pearson colleagues Richard Blum and Christine Bresnahan. Their book touches briefly on the material we deep-dive into (the innards of the Pi), while my book does the same thing with regard to Python programming. I think that Richard and Christine’s book and my book complement each other quite nicely, thank you very much!

Let’s get to work.

In document Hacking Raspberry Pi 2013 (Page 173-177)