Cocoa Basics Tutorial - College Of Engineering

11m ago
13 Views
1 Downloads
858.41 KB
51 Pages
Last View : 1d ago
Last Download : 3m ago
Upload by : Maleah Dent
Transcription

Tutorial for Cocoa:

Cocoa Basics Tutorial Welcome to the Cocoa Basics Tutorial. We'll create a simple world you can play, enhance, and even share with your friends on the Web! You need to have downloaded and installed Cocoa before taking this tutorial. Table of Contents Introduction Puzzle to try Create a Piece Go to the Beyond the Basics section Write a "Move Right" Rule Get help with the tutorial setup Write "Jump" Rules Download all the movies in the tutorial (430K--You can open them with MoviePlayer) Example world (Note that the hyperlinks indicated on these pages do not work, but they would work on the online version of this Tutorial) Copyright 1997 Apple Computer, Inc. Apple, the Apple logo, and Cocoa are trademarks of Apple Computer, Inc. registered in the United States and other countries. Maintained by the Apple Cocoa DR Team. Last updated Fri, June 20 1997. E-mail cocoa@apple.com with problems or questions.

Page 1 basicforPDF.html Welcome to the Basics Tutorial for Cocoa! The Basics section will help new users learn the basics to building worlds in Cocoa. Please open your copy of Cocoa and follow along with the steps described in the tutorial. Some words on these pages are linked to the Tutorial Word List: click on a word if you'd like to see a definition of it. Click on the BACK button in your browser to return to the Tutorial. ABOUT COCOA In Cocoa, only pieces on the board can act in a world. You show your pieces how to act by writing rules of behavior. All pieces which have rules and are on the board get a chance to try their rules on every clock tick. There are 2 steps to getting started: 1. Create a piece and its appearance. 2. Write a rule that makes the piece do something. This tutorial will show you how to build an obstacle course for a piece to move around. You'll make a piece and give it a rule that moves it to the right. You'll then give it rules for jumping on and off of obstacles that get in its way. And, if you want to see what else your piece can do, you can build a world with more obstacles in it and give your piece more ways to get through it. You can download the "Starter World" to your computer. It's about 8K and will take less than a minute to download. When you open Cocoa, click the "Open Saved World" button. Mon, Jun 23, 1997 12:10 PM

Page 2 basicforPDF.html Then open the "Starter World" to follow along with this tutorial. TO CREATE A NEW PIECE In Cocoa, you start by creating a piece and giving it an appearance. Try not to spend too much time drawing. You can use a picture that has been drawn in another program or one from the Scrapbook. 1. Click on the. . create tool The cursor turns into the create tool. Click anywhere above the ground pieces to create new piece on the board. A new piece looks like a splat of paint. Mon, Jun 23, 1997 12:10 PM

Page 3 basicforPDF.html What a piece looks like is called its appearance. You can change a piece's appearance with the paint tool. 2. Click on the. . paint tool The cursor turns into the paint tool. Click on the piece with the paint tool. This opens the Appearance Editor where you can draw an appearance. 3. Click on . Mon, Jun 23, 1997 .to clear this appearance out of the Appearance Editor. 12:10 PM

Page 4 basicforPDF.html You can draw any appearance you like, or paste in any picture copied from another program into the Appearance editor. Use an appearance that takes up only one square on the Cocoa grid. 4. Use the painting tools to draw the appearance or paste one in that you copied from another program. You're done with the appearance. Click the. .appearance done button. TO WRITE A "MOVE RIGHT" RULE The second step is to write a rule that shows your piece what to do. You want your pieces to act a certain way when they are in a certain situation. To get through the obstacle course, the first thing your piece has to know how to do is move to the right. You show it how to do that by writing a rule. Here, we want to set up this situation: If there's an empty space to the right of your piece, it will move right. Mon, Jun 23, 1997 12:10 PM

Page 5 basicforPDF.html 1. Click on the. . rule recording tool. The cursor turns into the rule recording tool. Click on your piece with the rule recording tool. This opens the Rule editor. It shows the before and after sides of a rule. The board is dark and you can see the grid in the background. A spotlight lights up the area around your piece. Before you do anything, the before and after sides in the Rule Editor are the same as what's in the spotlight on the board. When you're writing a rule and you do something with your piece, those actions get recorded as a rule. You can show your piece what to do either in the spotlight on the board or the after side of the Rule Editor. Mon, Jun 23, 1997 12:10 PM

Page 6 basicforPDF.html Before a rule will work, the left side of the Rule Editor must match what's on the board. It's called the BEFORE SIDE of the rule. When a rule works, the actions that were recorded when you wrote the rule get done. Those recorded actions are shown on the right side of the Rule Editor. It's called the AFTER SIDE of the rule. In this rule, the piece moves to the right if the space is empty. The action is shown both on the board and on the after side of the Rule Editor. Notice that the spotlight shows only 2 spaces. That's all your piece needs to know: as long as there's 1 empty space next to it, it will keep on moving right. Here's how to write this "Move Right" rule. 2. Drag the spotlight handles to include ONE empty space to the right. This shows your piece the area you're interested in. It only sees what's in the spotlight and will ignore everything outside the spotlight. To show that you want your piece to move to the right, move it into the space to the right. Put the mouse over the piece, click down on the mouse button and drag. 3. Drag your piece into the empty space to the right. You have now written a rule that says: If the space to the right of me is empty . . . then move into it. Mon, Jun 23, 1997 12:10 PM

Page 7 basicforPDF.html You're done with this rule. Click the. You can now see the rule run. Press on. .rule done button. .to run the clock and. .to stop the clock. Your piece will keep moving right as long as nothing gets in its way. Now you can put in some obstacles for your piece to jump around. TO BUILD AN OBSTACLE COURSE To build a world, you break up the actions into small steps and you write rules for the pieces to perform the small steps. In the obstacle course world, you create obstacles and you write rules that will tell your piece to jump ON and OFF an obstacle. It takes 2 small jumps rather than one big leap over an obstacle. LOOK BEFORE YOU LEAP! Your pieces only know what you tell them to do. You want your pieces to act a certain way when they are in a certain situation. Sometimes you have to try one way before you realize you might want your pieces to act differently. Don't be afraid to write a rule and see what it does. If you don't like it you can delete it and write a new rule. After you write rules that tell your piece when to jump, you can set up an obstacle course for your piece to jump around. Mon, Jun 23, 1997 12:10 PM

Page 8 basicforPDF.html But first, you need to make a second piece to be the obstacles in this world. TO MAKE A SECOND PIECE: THE OBSTACLE 1. Click on the. .create tool. The cursor turns into the create tool. Click to the right of your piece to create a new piece on the board. A new piece looks like a splat of paint. What a piece looks like is called its appearance. You can change a piece's appearance with the paint tool. 2. Click on the. . paint tool. The cursor turns into the paint tool. Mon, Jun 23, 1997 12:10 PM

Page 9 basicforPDF.html Click on the new piece with the paint tool. This opens the Appearance Editor where you can draw an appearance. 3. Use the painting tools to draw the appearance or paste one in that you copied from another program. You're done with the appearance. Click the. .appearance Done button. Your piece knows how to move right, but put an obstacle in its way and it can't move anymore. Start the clock to see. Stop the clock when your piece gets stuck next to the obstacle. Here, we want to set up this situation: if there's a block to the right of your piece and the space above is empty, then your piece will JUMP ON the block. This is the first step to getting around obstacles. For this rule, move the block to the right side of your piece and make certain the space above it is empty. TO WRITE A "JUMP ON" RULE Mon, Jun 23, 1997 12:10 PM

Page 10 basicforPDF.html 1. Set up the board, then click on the. . rule recording tool. The cursor turns into the rule recording tool. Click on your piece with the rule recording tool. This opens the Rule Editor where you record a rule. 2. Drag the spotlight handles to include the block in the space to the right and the empty spaces above your piece and the block. 3. Then drag your piece on top of the block. The board has a grid pattern and you can only move pieces into spaces marked by the squares of the grid. You have now written a rule that says: If there's a block to the right of me and the space above is empty . . . then jump on the block. Mon, Jun 23, 1997 12:10 PM

Page 11 basicforPDF.html You're done with this rule. Click the. .rule done button. Remember, you break up the actions into small steps. The next step is to write a rule that will get your piece down off of the block. TO WRITE A "JUMP DOWN" RULE Now you will write a rule for you piece to jump down. Here's the situation: if your piece is on top of a block and the space to the right of the block is empty, then your piece will jump down off of the block into that space. For this rule, your piece is already in the position you want, so you can go ahead and write the rule. 1. The board is already set. Click on the. . rule recording tool. The cursor turns into the rule recording tool. Click on your piece with the rule recording tool. This opens the Rule Editor where you record a rule. 2. Drag the spotlight handles to include the block below your piece and the empty space to the right. Mon, Jun 23, 1997 12:10 PM

Page 12 basicforPDF.html 3. Then move your piece down off of the block. You have now written a rule that says: If I'm on top of a block and the space to the right of the block is empty . . . then jump down off of the block. You're done with this rule. Click the. You can now see the rule run. Press on. .rule done button. .to run the clock and. .to stop the clock. Your piece will move right until it reaches the block. It will jump on and off the block and then continue to move right. Now you can put more blocks on the board and see if your piece can make it through the obstacle course you build. Also, you can name the pieces to avoid confusion later. Mon, Jun 23, 1997 12:10 PM

Page 13 basicforPDF.html 1. Go to the PIECE menu and select "Show Types." 2. Name the Block and your piece in Types window. 3. Drag more blocks from Types window to the board. Anytime you want to name your types of pieces or get more pieces of any type, go to the PIECE menu and select "Show Types." TRY THIS ON YOUR OWN! In this world, your piece can move around in different ways. Set up the board like the example shown here to see how your piece can use these 3 rules - move right, jump on and jump down - to move through these different obstacles. It can jump over and off a pile of blocks It can jump over and off a row of blocks Mon, Jun 23, 1997 12:10 PM

Page 14 basicforPDF.html Try some of your own experiments by moving or adding more blocks. What's the largest number of obstacles your piece can move around without going off the right side of the screen? SAVING YOUR WORLD You have 3 options for saving Cocoa worlds. Go to the Saving Options page to see how. GET A COPY OF THIS WORLD You can download the "Obstacle Course" world to your computer. It's about 15K and will take less than 1 minute to download with a 14.4 speed modem. It has the rules already written for the Cocoa mascot. You can open it and start the clock to see the the Mon, Jun 23, 1997 12:10 PM

basicforPDF.html Page 15 Cocoa mascot run through this obstacle course. TRY THESE PUZZLES Add new obstacles and rules to your piece to make it run through a different obstacle course: Here are some rules you can try. Go down under a new piece, for instance, a circle. Go up around the new piece. SAVING YOUR WORLD You have 3 options for saving Cocoa worlds. Go to the Saving Options page to see how. Mon, Jun 23, 1997 12:10 PM

basicforPDF.html Page 16 GET A COPY OF THIS WORLD You can download the "More Obstacles" world to your computer. It's 20K and will take about 1 minute to download with a 14.4 speed modem. You'll see that by adding some rules your piece can get around almost any obstacle you build with the blocks. Try some of your own experiments by adding different obstacles and giving rules for your piece to do more. Mon, Jun 23, 1997 12:10 PM

Page 1 beyondforPDF.html Beyond the Basics Your piece can do many different things. Choose one of the following to see how to write a rule to do it. After you've seen one, you can come back and choose a different one. Change my appearance - "Turning Around" Delete another piece - "Eating Food" Move another piece - "Moving Obstacles" Create another piece - "Creating Obstacles" Say a Sound - "Making Sound" Use Rule Sets - "Group Rules Together" If you'd rather skip the tutorial, you can get these worlds now. See below. GET A COPY OF THESE WORLDS You can download the "Beyond Basics" worlds to your computer. It's 95K and will take about 2 minutes to download with a 14.4 speed modem. You will get a folder with all the worlds ready for you to see. Each world has the rules already written for the Cocoa mascot. You can open one and start the clock to see the mascot run through the obstacle course. Start a new world by copying the "Obstacle Course" world done in the "Basics" section. If you skipped that section, download the "Obstacle Course" world and start with it to go on with this section. To avoid confusion, rename the new world "Turning Around" before opening it. Mon, Jun 23, 1997 12:11 PM

Page 2 beyondforPDF.html CHANGE MY APPEARANCE Your piece already knows how to move right when it has a certain appearance and when its in a certain situation. Appearances are important. If the appearance changes, the situation changes and your piece will need new rules for the new situation. In this world, you will write a rule for your piece to turn around if there are 2 blocks in its way. This will give your piece more ways to get around the obstacle course. First, you'll need to make a second appearance that your piece will have when it's moving left. Then you'll write the rule that tells your piece when to change its appearance. CREATE A SECOND APPEARANCE 1. Select your piece on the board (it looks dark), go to the APPEARANCE menu and select "Show Appearances." This opens the Appearances window. Any time you want to see all the appearances a piece has, just go to the APPEARANCE menu and select "Show Appearances." 2. Go to the APPEARANCE menu and select "New Appearance." This opens the Appearance Editor for your piece with a COPY of the first appearance it had. You can change this new appearance so that your piece faces to the left. Mon, Jun 23, 1997 12:11 PM

Page 3 beyondforPDF.html In this example, the appearance will be flipped so that the Cocoa mascot is facing left. 3. Go to the PAINT menu and select "Flip Left-Right." Now, the Cocoa mascot is facing left. You're done with the appearance. Click the. .appearance done button. Your piece has 2 appearances: appearance 1 faces right and appearance 2 faces left. Mon, Jun 23, 1997 12:11 PM

Page 4 beyondforPDF.html Now that your piece has 2 appearances, you can write the rule that will change your piece's appearance. TO WRITE "TURN AROUND" RULE You want your pieces to act a certain way when they are in a certain situation. Appearances are important. Your piece has rules for when its appearance is facing right, but we want to change that. If the appearance changes, the situation changes and your piece will need new rules for the new situation. Here, we want to set up this situation: if your piece is moving to the right, but there are 2 blocks in its way, it turns around to the left. For this rule, put 2 blocks, one above the other, in the space to the right of your piece. Your piece should still be facing right. (If your piece is facing left, go to the APPEARANCE menu and select "appearance 1" at the bottom of the menu.) 1. Set up the board, then click on the. . rule recording tool. The cursor turns into the rule recording tool. Click on your piece with the rule recording tool. This opens the Rule Editor where you write the rule. 2. Drag the spotlight handles to include the 2 blocks to the right. Mon, Jun 23, 1997 12:11 PM

Page 5 beyondforPDF.html Now you show that you want the appearance to change. 3. Drag appearance 2 (facing left) onto the piece. It has to go on the AFTER side of the Rule Editor. This says that you want to change the appearance from facing right to facing left. You have now written a rule that says: If I'm moving right and there are 2 blocks, one above the other, to the right of me . . . then I'll turn to the left. You're done with this rule. Click the. .rule done button. AN IMPORTANT NOTE ABOUT APPEARANCES If you dragged the Cocoa mascot's "appearance 2" onto the Block in the rule, the Block wouldn't change its appearance to look like the Cocoa mascot. When you're changing appearances, be careful to check who's Appearances you're using and which piece you're dragging that appearance onto. Mon, Jun 23, 1997 12:11 PM

Page 6 beyondforPDF.html TRY THIS ON YOUR OWN! Now that your piece has turned to the left, it doesn't know what to do next. If you run the world, it will not move. Appearance is important, so now you need to tell it what to do next. The easiest thing to do is give it a rule that tells it to move left when its facing left. If you need help, go back to the Move Right section to see how that rule was done, but, this time, write a rule to move the piece left. The next thing your piece might do is jump on then off the block when it's moving left. If you need help, go back to the Jump section, to see how that was done. Here are some rules you can try. Mon, Jun 23, 1997 12:11 PM

Page 7 beyondforPDF.html SAVING YOUR WORLD You have 3 options for saving Cocoa worlds. Go to the Saving Options page to see how. GET A COPY OF THIS WORLD You can download the "Turning Around" world to your computer to see what the finished world looks like. It's about 28K and will take about 1 minute to download with a 14.4 speed modem. This world has the rules already written for the Cocoa mascot. You can open it and run the world. Start a new world by copying the "Obstacle Course" world done in the "Basics" section. If you skipped that section, download the "Obstacle Course" world and start with it to go on with this section. To avoid confusion, rename the new world "Eating Food" before opening it. DELETE OTHER PIECE IN A RULE Your piece already knows how to move right and jump over a block. That takes a lot of energy! In this new world, your piece will delete the other piece: this is the kind of rule you write when you want one piece to "eat" the other piece to get energy. First, you'll need to make a second piece that your piece would like to eat. TO MAKE ANOTHER PIECE 1. Click on the. .create tool. The cursor turns into the create tool. Mon, Jun 23, 1997 12:11 PM

Page 8 beyondforPDF.html Click to the right of your piece to place the new piece on the board. A new piece looks like a splat of paint. What a piece looks like is called its appearance. You can change a piece's appearance with the paint tool. 2. Click on the. . paint tool. The cursor turns into the paint tool. Click on the new piece with the paint tool. This opens the Appearance Editor where you can draw an appearance. You can draw any appearance you like, or paste in any picture you draw in a painting program, then copy and paste it in as an appearance. Here, use an appearance that takes up only one square on the grid. 3. Click on the painting tools to draw the appearance or paste one in. Mon, Jun 23, 1997 12:11 PM

Page 9 beyondforPDF.html The Cocoa mascot likes to eat jellybeans. Yum, yum! You're done with the appearance. Click the. .appearance done button. TO WRITE THE "EAT FOOD" RULE You want your pieces to act a certain way when they are in a certain situation. To do this, you set up the pieces on the board BEFORE you write the rules which tell them how to act. If your pieces are not in the position that you want, move the pieces into position before you write the rule. Here, we want to set up this situation: if there's food in the space to the right of your piece, it will eat it and move right. For this rule, move the "food" to the right of your piece. 1. Set up the board, then click the. . rule recording tool. The cursor turns into the rule recording tool. Click on your piece with the rule recording tool. This opens the Rule Editor where you record a rule. Mon, Jun 23, 1997 12:11 PM

Page 10 beyondforPDF.html 2. Drag the spotlight handles to include the food piece on the right. Now we can see what your piece wants to eat. To delete a piece out of the world, you use the delete tool. 3. Click on the food with the. . delete tool. 4. Move your piece to the right. You have now written a rule that says: If there is food in the space to the right of me . . . then "eat" it and move to the right. You're done with this rule. Click the. .rule done button. Now you can put out more food for your piece to eat. Mon, Jun 23, 1997 12:11 PM

beyondforPDF.html Page 11 1. Go to the PIECE menu and select "Show Types." If you want, you can name the type "Food" in the Types window. 2. Drag more food from Types window to the board. Anytime you want more pieces of any type, go to the PIECE menu and select "Show Types." Then, you can drag out any piece you want onto the board. TRY THIS ON YOUR OWN! Set up food all around the obstacle course, wherever your piece can run into the "food" on its right. Soon your piece will eat up all the food you've put out. Try writing rules for your piece to eat food placed around the blocks. Mon, Jun 23, 1997 12:11 PM

beyondforPDF.html Page 12 Here are some rules you can try. SAVING YOUR WORLD You have 3 options for saving Cocoa worlds. Go to the Saving Options page to see how. GET A COPY OF THIS WORLD You can download the "Eating Food" world to your computer to see what the finished world looks like. It's 23K and will take about 1 minute to download with a 14.4 speed modem. Mon, Jun 23, 1997 12:11 PM

Page 13 beyondforPDF.html This world has the rules already written for the Cocoa mascot. You can open it and start the world. Start a new world by copying the "Obstacle Course" world done in the "Basics" section. If you skipped that section, download the "Obstacle Course" world and start with it to go on with this section. To avoid confusion, rename the new world "Moving Obstacles" before opening it. MOVE THE OTHER PIECE Your piece already knows how to move right and jump on and off a block. How about giving your piece some rules to change the obstacle course? As it moves around the board, it can move obstacles and then get around them. In this new world, your piece will be able to move a block if there are 2 stacked, one above the other, on its right and if there's an empty space to the left. TO WRITE A "MOVE BLOCK" RULE You want your pieces to act a certain way when they are in a certain situation. You can change the situation by moving obstacles, or you can give rules to your piece to move obstacles while it moves through the obstacle course. Here, we want to set up this situation: if there are 2 blocks one above the other to the right of your piece, it will move 1 block to the empty space to its left, if the space is empty. For this rule, move your piece where there is empty space to the left and to the right. In the space to the right of your piece, stack 2 blocks, one ab

Welcome to the Basics Tutorial for Cocoa! The Basics section will help new users learn the basics to building worlds in Cocoa. Please open your copy of Cocoa and follow along with the steps described in the tutorial. Some words on these pages are linked to the Tutorial Word List : click on a word if you'd like to see a definition of it.

Related Documents:

Cocoa Market Update Introduction . tons in 2008 to million metric 4.8 tons in 2012. This represents an average . Contracts are traded for delivery of cocoa beans in March, May, July, September, and December and are considered settled upon of the receipt beans.

Forever Chocolate Progress Report 2051/5fi 3. Our Goal. By 2025, we will lift more than 500,000 cocoa farmers out of poverty. Our Approach. We can only lift cocoa farmers out of poverty if we pursue nothing less than systemic change in cocoa farming. Systemic change means cocoa farming that is prospering and self-sustaining.

play. From October 2019, a new Fairtrade Minimum Price and Premium for cocoa will come into effect. We are also introducing a Living Income Reference Price for companies to work towards. But just six percent of the world’s cocoa is Fairtrade, so we can’t act alone.4 At the 2018 World Cocoa Conference, the cocoa sector

and cocoa-derived products in which food safety, efficiency and cost effectiveness are key factors alongside consumer demands for taste and quality. We all need cocoa beans which will allow us to produce products that are wholesome and comply with European legislation and other international food safety standards. As the source of unique

Cocoa & Forest Initiative . Cargill’s Action Plan. Cargill is one of the signatories of The Cocoa & Forests Initiative (CFI) – a publicprivate partnership - launched in 2017 bringing together the governments of Côte d’Ivoire and Ghana as well as leading cocoa and chocolate companies committed to end

Acknowledgements J. J. Scheu, former Chief Executive Officer of the Cocoa Merchants’ Association of America, Inc., coordinated the preparation of this guide and wrote a large part of the text. Robin Dand, specialist in cocoa logistics and author of several publications, including ITC’s Cocoa: A Shipper’s Manual (1990) , was a collaborating author and contributed essential material.

NORC Assessing Progress in Reducing Child Labor in Cocoa Production in Cocoa Growing Areas of Côte d'Ivoire and Ghana . FINAL REPORT i . Acknowledgments . We would first like to thank the governments of Côte d'Ivoire and Ghana for their continued support and transparency during the life of this project.

MATH348: Advanced Engineering Mathematics Nori Nakata. Sep. 7, 2012 1 Fourier Series (sec: 11.1) 1.1 General concept of Fourier Series (10 mins) Show some figures by using a projector. Fourier analysis is a method to decompose a function into sine and cosine functions. Explain a little bit about Gibbs phenomenon. 1.2 Who cares? frequency domain (spectral analysis, noise separation .