Workbook7

Page 1

Year 7 Computing

student


Contents PAINT EXERCISES

4

SPREADSHEET ART CHALLENGE

10

SPREADSHEET BATTLESHIPS

11

CYBER-BULLYING

15

POWER-POINT

19

PRESENTATIONS

19

PRESENTATION SOFTWARE

21

TASKS – ANIMATION

22

ICT AND THE INTERNET

24

ZOO PROJECT

25

TASK 1: ZOO LOGO

25

TASK 2: FACT SHEET

25

TASK 3: THE SPREADSHEET

26

TASK 4: THE PRESENTATION

27

IT ROOM POSTER

29

SO YOU THINK YOU CAN USE THE MS PAINT PROGRAM 1?

30

SO YOU THINK YOU CAN USE THE MS PAINT PROGRAM 2?

31

LOGO

32

SCRATCH

46

STEPS TO CREATING THE GAME

60 2


MAKE THE BACKGROUND

60

MAKE KATNISS

62

MAKE KATNISS FLASH

62

MAKING KATNISS MOVE

64

STOPPING KATNISS GO THROUGH WALLS

64

ADDING FOOD FOR KATNISS

65

ADDING A SCORE FOR FOOD

66

ADDING MORE FOOD SPRITES

66

ADDING WATER

67

MAKING THE WATER AND FOOD RUN OUT (OH NO!)

67

ADDING THE ‘YOU LOSE’ AND ‘YOU WIN’ SCREEN

69

ADDING THE ‘YOU WIN’ SCREEN

71

ADDING TRIBUTES

71

WELL DONE !

ERROR! BOOKMARK NOT DEFINED.

SCRATCH: DOG AND CRAB

73

SHARK COSTUME MOUSE-FOLLOWING SHARK RANDOM MOVEMENT SPRITE CREATE A VARIABLE TO HOLD THE SCORE BROADCAST A MESSAGE WHEN THE SHARK EATS THE YELLOWFISH CONTROL THE SHARK EATING YELLOWFISH BEHAVIOUR RESET THE YELLOWFISH AFTER IT HAS BEEN EATEN CREATE THE RED FISH SPRITE CONTROL THE SHARK EATING REDFISH BEHAVIOUR

76 77 78 79 80 80 80 81 82

3


Paint exercises: How to draw a hamster, dog, seahorse, horse, rat, Marilyn Monroe (Andy Warhol)

The hamster is one of the cutest and easiest characters to draw. Start by drawing a large circle for the body and a smaller circle for the head. ................................................................................................................................................... The ears, arms and legs are also a combination of circles and lines. Draw a small oval for each ear, connecting the top of each oval to the head with a straight line. Draw two more ovals over the middle of the body for paws and another set of ovals for his feet. Connect the paws and feet to the body with curved lines. ................................................................................................................................................... In this step you can add some detail on his paws and face. An upside down triangle with two curved lines makes the nose and mouth. Add some longer curved lines for the whiskers. Two ovals make the eyes. ................................................................................................................................................... Your hamster is almost ready. Add some colour and expression to bring your hamster to life. WELL DONE!

4


Start by drawing three circles. The top circle for the head, below that a larger circle for the dog's shoulders and the smallest circle for its hind legs. ............................................................................................................................................ ....... Next, draw an oval across the head to create a muzzle. Make the neck by joining the head to the shoulders. Then draw some joining lines between the shoulders and the hind legs to make the body. ............................................................................................................................................ ....... Time to draw in the legs. Now dog legs can be tricky, especially the back ones, so try copying the bumps and curves in the picture. Include some ovals at the bottom for paws. ............................................................................................................................................ ....... Now add the ears and a tail. The ears are two triangles with a line down the middle and the tail is a curvy line, whatever length you like. ............................................................................................................................................ .......

Remove some of the lines that you don't need.

............................................................................................................................................ ....... For your dog's face, add the eyes and an upside down triangle for the nose. Draw a few lines onto the paws for detail. ............................................................................................................................................ .......

With some colour your dog is finished. Woof!

5


Start by drawing two overlapping circles for your horse's head. Below that draw a larger circle for the shoulders and another for its hindquarters ............................................................................................................................................ ....... Next, draw some joining line on the head to create a muzzle. Make the neck by joining the head to the shoulders. Then draw some joining lines between the shoulders and the hindquarters to make the body. ............................................................................................................................................ ....... Onto the legs. Horse legs can be a bit tricky so try copying the bumps and curves on the picture. Include some ovals at the bottom for hooves. Draw two triangles for the ears make the closest one the bigger. Then draw on the tail. You can make it as long and wavy as you like. ............................................................................................................................................ ....... Clean off some of the lines you don't need. Add a couple of circles for the eye and nose. And let's not forget to add in the mane. You might like to square off the bottom of your horse's hooves ............................................................................................................................................ .......

Add some colour to your horse and it is finished. This one is a chestnut with white blaze and muzzle.

6


How to draw a seahorse The seahorse looks like a complicated character but is really just a combination of circles and wavy lines. Start by drawing a big circle for the head and a smaller one below it for the tail. Add some curved lines between the two for the body. ........................................................................................................................................... ........

Let do the tail first as that's the tricky part. Follow the picture by drawing a spiral shape inside the smaller circle.

........................................................................................................................................... ........ Next erase the some of the lines of the circle you no longer need for your tail. Then draw in a wavy line all the way down the back of your seahorse, from head to tail. This will become its fin. ........................................................................................................................................... ........ Add a smooth rectangle will make the snout - remembering the upturned nose. Triangle shapes on either side of body will become the seahorse's flippers. Next to add some detail and character to the face. ........................................................................................................................................... ........

Draw a large oval for the eye, inside that draw a smaller oval, you can also add a tiny dot for the very inside of the eye if you like. A few lines on the flippers and our seahorse is starting to take shape.

........................................................................................................................................... ........ Time to give your seahorse colour. Add some shading to the fin down the seahorse's back. You might like to split it into two just like the drawing. Coloured spots on the head and tail look like scales, two small circles for nostrils and some more shade to the fins and neigh - your seahorse is away!

7


Our rat is one of the cutest and easiest characters to draw. Start by drawing a large circle for the body and two smaller overlapping circles for the head and snout. ........................................................................................................................................... ........ Draw two small circles for ears. Another two ovals over the middle of the body make the paws. Add another two ovals for the feet. You can connect the paws to the body with curved lines. Don't forget your curvy rat-tail! ........................................................................................................................................... ........ Next, clean off some of the lines you don't need. Add some longer curved lines for the whiskers and a little black dot for the end of the snout makes a nose. ........................................................................................................................................... ........ In this step you can add some detail on the paws and face. A tiny rectangle gives this rat some teeth. To draw the eye, start by drawing the large, outside circle. Inside that, draw another circle leaving the centre clear. ........................................................................................................................................... ........

Next, add some colour and expression to bring your rattie character to life. WELL DONE!

8


VIRTUAL SCREEN PRINT Andy Warhol, whose portraits of movie stars, world leaders, soup cans and other American icons made him one of the most emulated artists of his time. Credited with single-handedly reviving portrait art, Warhol made his mark by using Polaroid snapshots, news photos and photo booth prints -- sometimes hundreds of them -- and reproducing them on silkscreen prints. He used repetition as social commentary on mass culture and consumption, showing art as a product.

Visit the Andy Warhol website for inspiration. You can make a virtual silk screen-print online and email it to yourself. Print it and stick it here:

http://www.warhol.org

Create a Warhol inspired Pop Art!

9


Spreadsheet Art Challenge

1. You are going to create the spreadsheet then try the challenge 2. Make cells B1 to N14 lilac 3. Add the instructions on the right hand side. 4. Then create the drawing by following the instructions. 5. What was it? 6. Can you create your own spreadsheet drawing for others to try out?

10


Spreadsheet Battleships

11


12


13


14


Cyber-bullying

15


16


17


18


Power-point

http://www.youtube.com/watch?v=ORxFwBR4smE

PRESENTATIONS You should use each word only once. plan

projector

title templates storyboard

content conclusion

websites slides

presentation hand-outs power-point

Microsoft _________________ is a _________________program that lets you make and show slide shows. These can be viewed on the computer screen or through a multimedia _____________. Copies of the presentation, called ‘______________’ can be printed out and given to the audience so that they can make their own notes.

Presentations are made up of a series of pages, called ‘____________’. As well as text, slides may incorporate graphics, animated images, sound and video clips, graphs, charts and even links to _________________. Most presentation packages provide a set of themes and ______________ which make it easy to create professional looking presentations with little skill or knowledge. There is also the facility to 19


add slide transitions, timings and animations which help bring a presentation ‘to life’. When creating a presentation, it is a good idea to __________ it before you begin. Some people create a ‘_____________’ on paper. Each slide is represented as a box and a rough sketch of the contents are recorded. A short presentation will often include around six slides. The first slide is usually a ‘___________ slide’ or a brief introduction. Slides 2, 3 and 4 normally contain the _____________ of the presentation. This may be presented as bullet points, a block of text and or images. The final slide is usually a ______________, summary or an ending.

20


Presentation Software

The table below should be printed and used as a check list to make sure you are fully aware of being able to carry out the skills required. It lists what you must be capable of doing: Your Name Area for Assessment Set up presentation Create presentation pages

Use graphical information

Use transitions Use animation facilities Save and print presentation

Skills that will be needed to complete the area for assessment

Tick

Set up a Master slide placing images, text, logos, slide footers, automated slide numbering, font styles, heading styles, colour scheme Areas for headings, subheadings, bullets, images, charts; colours, text boxes, presenter notes, audience notes Headings, subheading, bulleted list, font styles, font types (e.g san serif), point sizes, text colour (selected from presentation colour scheme), text alignment, enhancements (bold, italic, underscore) Consistently applied font styles, point sizes and colour schemes Resize, position, crop, copy, contrast, Brightness Create within the package, import from spreadsheet, from contiguous or non contiguous data, title, legend, segment labels, segment values, percentages, category axis labels, value axis labels, scales Symbols, lines, arrows, call out boxes Consistent between slides, range of features Text, images, consistent between objects

File compression (zip files) floppy disk, presenter notes, audience notes and handouts Use screen shots to show features like animation, transition and builds

21


Tasks – Animation

pp2.pptx

Directions 1. Open the document - double click on the file you downloaded. PowerPoint should load a file

with a picture of an owl. This task develops your animation skills. As with WordArt, it is very important you don't go over the top with animation. Clever and effective use will make a great presentation, but if you use too much the presentation will look amateur and disjointed. 2. The presentation has six slides. You need to add in subtle animation, page transitions and timings. This is easy! 3. There are a number of ways to add animation. One easy way is to click on the Animations menu and then click on the object (the owl in our case). Once the object is selected you will see small squares or circles around its edge.

4. Select “Custom Animation” and make sure that the "Custom animation" dialogue box appears to the right of the

22


5. This is a very powerful tool that most people

overuse. To animate your object select "Add effect" or select an effect from the menu at the top of the screen. There are many different options to choose from, but explore these later. Just select one effect and experiment with the options available.

6. Work through the other five slides and animate each object. When you have completed

this, press F5 to view your slideshow. 7. You move through each slide by clicking the mouse or pressing a key. We can do better than

that. You can add in slide transitions and tell the slideshow to automatically move on. 8. Try some of the following actions on this slide show: a. From the "Slide Show" option on the menu bar, select "Slide Transition" and

experiment with some SLIDE TRANSITIONS so that as you move from slide to slide the effects alter. b. At the moment your presentation advances with a mouse click. Change this by altering your slide show so that slides "Automatically" play through. Give each slide 4 seconds display and LOPP them around. c. View your slideshow again - this time it should move on automatically! If it doesn't, work through the otions again until it all works as required – it will take the form of a slide show.

23


ICT and the Internet: http://www.davidroyall.com/presentation/internet/

This practical provides you with a further chance to develop PowerPoint presentation skills and explore the use of ICT and the INTERNET. Work through each stage in the order they appear As usual, when working through the presentation, follow some simple rules:

1. 2.

Read the instruction carefully and do not rush Be inventive and creative, which means you should not be afraid to experiment 3. Save your work every 5 minutes and especially at the end of each stage Stage 1 – The Master Slide Stage 2 – Introductory Slide Stage 3 – Internet Service Providers (ISP’s) Stage 4 – Web Site Usage Stage 5 – Web Browsers Stage 6 – Web Navigation Stage 7 – Social Networking Stage 8 – Information Highway Stage 9 – e-Commerce Stage 10 – The Dark Side of the Internet Stage 11 - Finishing Touches

24


Zoo Project You are in charge of a new zoo opening in your City. There are a number of tasks that you need to complete before you open and whilst you are open. Your first two tasks are DTP tasks. All businesses will attempt to create a brand name and a brand identity. This will help them to become known across a wider range of people. This brand identity can be created by coming up with a good name and logo.

Task 1: Zoo Logo Your task is to create a logo for your zoo. You need to think about what would be appropriate to go on the logo. Does it need the Zoo Name? Does it need an image? If so what would be a suitable image? What colours should you use and how many colours? You need to also remember the rules for a good logo. 1. 2. 3. 4. 5.

Eye Catching Unique Relevant 2/3 Colours Memorable etc

Your logo should be suitable to go on all staff uniform and products that your Zoo sells.

Task 2: Fact Sheet Each animal needs to have a fact sheet that children can take home so they can learn more about each of the animals. Your second task is to choose an animal and find the facts below and put them onto your sheet. You will need to search the internet to find accurate and reliable information on the animal. Your fact sheet must include: 

      

The animal’s habitat. The animal’s lifespan. The animal’s weight and size (height or length depending on animal). The animal’s country or continent. Is the animal an Endangered Species? At least one suitable image of the animal. An activity (e.g. Word search, colouring in picture, quiz, spot the difference)

25


You must think about having a suitable layout for the fact sheet as well as having a suitable colour scheme for the animal on the fact sheet.

Task 3: The Spreadsheet Your Zoo needs to spend money feeding all of the animals. This can cost a zoo a lot of money and can be difficult to keep track of. When they are offered new animals, they need to think very carefully about whether they can afford to feed the new animal. You need to create a system that can be used to check whether or not you can afford a new animal.

The spreadsheet above can be used to discover whether you can afford a new animal or not. You will need to use formulas in your spreadsheet so that it automatically updates whenever you input new information. Remember all formulas start with the = symbol

Tasks and Questions Each question follows on from the previous question. For example, if you have changed the spreadsheet for question 1, keep those changes for question 2 a. b. c. d.

The cost for 1 Zebra meal increases to ÂŁ6.50. What is your new Grand Total? The zoo gives 6 penguins to another zoo. What is your new Grand Total? The cost for preparing 1 elephant meal doubles. What is your new Grand Total? The zoo is told that the Lions aren't eating enough meals. You are told to feed them 1 more time a day. What is your new Grand Total? e. Create a Bar Graph to show the animals and their total costs per week. Remember to label both axis and give you chart a title. f. Create a Pie Chart to show the percentage split of animals in the zoo.

26


Task 4: The Presentation Now create a 5 slide presentation that include the following: A Master slide with the following: a. Your logo b. Your Name c. A suitable title Slide 1 should introduce your zoo and state where the zoo is located The next few slides (4 at least) should have ONE animal with some basic facts about them. Place detailed information from a web site into the notes section of each slide. These notes will not appear in the presentation, but they serve a use to the presenter. Carry out some use animation on each of the slides

27


28


IT ROOM POSTER Look at these facts! 

There are more bacteria on a Computer´s keyboard than on a toilet.

There is enough electricity in a computer to kill you with an electric shock!

Water is a “bad conductor” of electricity.

The majority of crimes are now committed using computers.

Sitting at the computer all day without a break can give you health problems.

There are 5 million different types of computer viruses in the world today and that number increases everyday.

TASK We need to understand that we must behave in a responsible manner when we are in the IT Room. We are going to design a “poster” that will highlight the rules we need follow. Things to do: 1. Look for images that are suitable to use in our poster. 2. Save these images to your folder on the computer. 3. Open a new publication in MS Publisher. 4.

Insert your image or images and then enter between 6 and 8 different rules we should use in the computer room.

5. Save your file as MyPoster

29


So you think you can use the MS PAINT Program 1? The Pizza Challenge STAGE 1 SET UP YOU SHEET SO IT WILL PRINT PROPERLY 1) Open PAINT 2) FILE>PAGESETUP change orientation to landscape 3) Now click on the edge of the white box and make it fill the screen 4) FILE> PAGESETUP again and for to 1 page x 1 page STAGE 2 SET UP YOUR PIZZA BASE 1) Put in your pizza base use shapes tool. 2) Create a COLOURS>EDIT COLOURS>DEFINE CUSTOM COLOURS to get the base colour just right. Use the paint pot to fill the shape. STAGE 3 ADD THE TOMATO SAUCE 1) Create a custom colour for your tomato sauce 2) Then use the airbrush spray tool STAGE 4 ADD YOUR CHEESE 1) Create a custom colour for your cheese 2) Now use the line tool on thickest width to add your cheese all over STAGE 5 ADD YOUR TOPPINGS 1) Choose from; ham, mushroom, pineapple, peppers, meatballs, tuna, prawns, sweetcorn, pepperoni and anything else you like that isn’t listed here. 2) Come up with creative ways of adding toppings STAGE 6 PRINTING 1) Print out a test sheet (black and white) when finished. 2) If it prints OK print in colour

30


So you think you can use the MS PAINT Program 2?

These paintings were done by a man called Piet Mondrain. You may already know all about him. He was a Dutch artist 1872-1912 who worked in Paris, London and New York. Today his work fetches millions at auction. You may not be able to afford the real thing, but you can make your own.... STAGE 1 SET UP YOUR CANVAS: 5) Open PAINT 6) FILE>PAGESETUP change orientation to PORTRAIT (for this example) 7) Now click on the edge of the white box and make it fill the screen 8) FILE> PAGESETUP again and for to 1 page x 1 page STAGE 2 PUT IN THE BLACK RECTANGLES 1) Select the rectangle tool and make sure its set to thickest line and 2) Choose which painting to copy and put some rectangles in STAGE 3 FILL THE COLOURS 1) Now use the paint pot to fill the correct squares STAGE 4 PRINTING 3) Print out a test sheet (black and white) when finished. 4) If it prints OK print in colour

31


So you think you can use the MS PAINT Program? 3 Spray paint Landscape STAGE 1 SET UP YOU SHEET SO IT WILL PRINT PROPERLY 9) Open PAINT from the shared drive 10) FILE>PAGESETUP change orientation to landscape 11) Now click on the edge of the white box and make it fill the screen 12) FILE> PAGESETUP again and for to 1 page x 1 page STAGE 2 SET YOUR HORIZON 1) Draw a small rectangle for the sky then fill with a custom sky colour using COLOUR>EDIT COLOURS>DEFINE CUSTOM COLOURS 2) Draw a larger rectangle for the bottom half of the screen and fill this with a soft custom colour too. STAGE 3 ADD SOME BACKGROUND FEATURES 1) Draw a sun using the shape tool 2) Add some clouds using the spray tool 3) Add Some mountains with some shadow detail STAGE 4 ADD MORE FEATURES 1) Use the spray and paint brush tool to add some grass, a tree and a path. You can put yours anywhere you like, it doesn’t have to look like the one in the picture 2) You can also add some flowers and rocks STAGE 5 PRINTING 5) Print out a test sheet (black and white) when finished. 6) If it prints OK print in colour

32


logo

33


34


35


36


37


38


39


40


41


42


43


44


Scratch

45


46


47


48


49


50


51


52


53


54


55


56


57


Basics command groups command blocks script area sprite (right click to delete) stage where your programme will run use, create or import a new sprite

Basic beginnings: 1. Motion blocks and pen blocks can be found by clicking on the appropriate command group

2. Add control block from control command group

3. Add a recorded sound

4. Right click on sprite to delete, duplicate or resize

5. Choose a new sprite and additional sprites from those available, or browse to use an image from your device, or paint a new sprite. Click on the sprite you want to program

6. Double click in stage area to bring up background tab in script area to change the stage

7. Once a sprite is selected click on costume to use different appearances of that sprite

8. Click green flag in top right to play a project, red to stop

9. Right click in script area to add a comment to explain what a block of programming will do

58


Hunger Games Scratch Game

“May the odds always be in your favour”

59


Steps to creating the game 1

2

3

•Create the Background •Create Katniss •Make Katniss Move •Stop Katniss going through walls

4

•Add Food Sprites •Add Food Score

5

•Add Water Sprites •Add Water Score

6

•Make 'You Lost Screen' •Make Katniss loss if you have run out of food or water.

7

•Make Katniss win if still alive after 1 minute •Make Winning Screen

Make the Background In scratch the background is called a STAGE, in this game the STAGE will remain the same throughout the game. You do not draw the characters onto the stage because they would not be able to move. The Characters are called SPRITES..I’ll come to that later. 1. Right mouse click on the cat sprite – we don’t need that dude. Unless you want CATNISS? Oh dear.

2. Now click on the White STAGE and then on the tab BACKGROUNDS.

60


3. You can Paint a new background, Import one (if made in serifdraw) or take a picture with a webcam…we are going to EDIT the white one. Use the tools to make a maze, it doesn’t need to look like mine but MAKE SURE THERE IS ENOUGH SPACE FOR A SPRITE TO MOVE AROUND. NB: Make it simple, you can make the game harder in other ways. Rename the BACKGROUND Maze. Click OK

61


Make Katniss Katniss is the heroine of the game, she is the main SPRITE. Because this is a maze game we don’t need a complicated sprite, just one you can see easily. I have choose a flashing circle with an arrow through it. 1. Click on PAINT A NEW SPRITE BUTTON.

2. Paint your symbol for Katniss using the tools.

Mine is dreadful, you can spend more time on yours! Click Ok Change her name from Sprite to Katniss.

Press this button then press Katniss on the screen and she will get smaller so she can fit through the maze

Make Katniss Flash I would like Katniss to flash on the screen as she moves so I can see her easily. 1. Make sure that Katniss is selected (you can see by the dark grey and blue box around the sprite in the bottom half of the screen. 2. Click on Costumes. 3. Click Copy Costumes. I also renamed mine Red and White, you’ll see why that helps later. 4. Click edit on the second costume and change part of the symbol to a different colour.

62


Now we are ready for some fun! Its time to start writing scripts. 5. Click on the Scripts tab (next to costume) 6. Try and make the following script by dragging the code into place. This script says WHEN THE GREEN FLAG IS PRESSED FOREVER KATNISS SHOULD SWITCH TO THE WHITE COSTUME, WAIT 1 SECOND, SWITCH TO THE RED COSTUME AND WAIT 1 SECOND (and because this is in a Forever, it will continue the whole time the game is playing. So, test your script and press the GREEN FLAG Its on the top right of the screen. Scratch uses building blocks of scripts that you can drag into your sprites script box. There are 8 categories of scripts that all have different colours. It can take a while to get the hang of it, so don’t worry, but when you do you can make really complex games.

Well done!

63


Making Katniss Move Ok, so here comes some more script. This is how you make a sprite move using the arrow key. This script says ‘When the green arrow is clicked, forever if the up arrow is pressed, point in the direction of 0 (notice the screen has x and y axis this is how you position things) and make 5 steps. Each step is mini so 5 is about right, or Katniss with be frustratingly slow ;-) You can then duplicate this script for all directions. Just change the Point in Direction and the arrow pressed. 1. Right mouse click ON the script – DUPLICATE. Drag into a bit of clear space.

2. Time to test your scripts, PRESS THE GREEN FLAG AND TRY ALL THE CONTROLS. If you have a problem now, fix it. Especially if you maze is not big enough.

Stopping Katniss go through walls This requires you to add some script to each of the Movement scripts (above), there is a picture on the next page. The scripts now say, as well as moving in the right direction when the arrow key is pressed, IF KATNISS IS TOUCHING WHITE, THEN MOVE BACK -5 STEPS. NB: Don’t put anything else that is white onto the screen! Obviously if your maze walls are a different colour then don’t put white!

64


Adding Food for Katniss So, now she can move she needs to find Food. Each piece of food is a new sprite – but the scripts they have will be the same, so we can do one sprite and then duplicate it. 1. Click on PAINT A NEW SPRITE, or you could import one (as I have done). 2. Change the name to Food1. 3. Resize the Food Sprite and move it to the position you’d like it to be in. 4. Make sure you are on Food 1 sprite and go to the Scripts tab. You can see the bananas on the screen, and two sprites below. The script says ‘When green flag clicked, show (it will show in the position you’ve put it). Forever if touching Katniss hide. SO WE DON’T HAVE A SCORE. Test this works all the same.

65


Adding a score for Food So, now we need to set up a variable called food, this will allow us to change a score when a piece of food is found by Katniss. Still in the scripts for FOOD1, click on VARIABLES and make one called ‘Food Score’

When you’ve made the variable, these options are available.

Add the ‘Change Food Score by 10’ to your script. Now when she finds food it will give her a score of 10. Test this works.

Adding more Food Sprites Now you can duplicate the food sprites so there are at least 6.

I have been very boring and only used bananas

66


Adding Water You add water in exactly the same way as the food – only call it water (drrrr) and make look like water! Not bananas because that would be silly. The scripts are the same…so you should look like this! Remember at least 6 water’s too. REMEMBER TO MAKE ANOTHER VARIABLE (FOR WATER)

Making the water and food run out (OH NO!) You’ve done really well to get this far! The idea of the game is that Katniss must stay alive for 1 min. Every time she gets a piece of food or water she get 10 points, but they are used up a point every second….if EITHER get to 0 then Katniss dies (or loses so as not to be too gruesome!). To be kind sponsors, we’ll give her 10 points of food and water to get give her some time…after that – she is on her own. 1. Make sure you are clicked onto Katniss and adding scripts to her. 2. Add the following 2 scripts (one is for water and one is for food) This script says ‘When green flag is clicked, show the score on the screen and set the food/water score to 10’

3. Now to make them run out… 4. Add the following bits to the scripts above so they look like this: 67


This script says ‘When green flag click show, set the food/water to 10, then forever wait 1 second and change the food/water by -1. Test this works

68


Adding the ‘YOU LOSE’ and ‘YOU WIN’ screen Before we can write the code to say if Katniss has Won or Lost, we need to create the screens that they will go to. These are simply BACKGROUNDS to our existing Stage. 1. Click on the STAGE (not katniss, easy to get confused here). 2. Click on the BACKGROUNDS TAB. 3. Paint 2 New Backgrounds – 1 that says ‘YOU WIN’ and one that says ‘YOU LOSE’

DON’T PANIC!!!!!!!!!!!!!!! My screen is messed up too! This is how you fix it. 1. First we need to tell the game that when we click the green flag it should go to the maze background. 2. Go to the Scripts tab of the maze and add this code.

Now for the slightly tricker bits (we are at the stage where you need to clean up as you make more scripts, it can be fiddly. 1. Make your STAGE script area look like this:

69


What we have done is say, when the green flag is clicked, go to the maze and show the scores. Forever though, if Water or Food is less than 0 switch to the LOSE screen and hide the scores. As you can see – something else needs hiding too…all those sprites are still on the screen. We can send a message to all sprites that something has happened by creating a BROADCAST. Like a tweet.

In the Stage script scree still, alter the scripts to now look like this. They are now sending a BROADCAST if either of the scores are below 0. Now we need to tell the sprite what to do when they hear LOSE. 1. Go to Katniss Script area. 2. Add the following script. Ok, so this says ‘when you hear LOSE, hide’ and so it comes back…’when green flat is clicked then show. Next step is to copy this script (you can simply drag it, onto each of the sprites – PHEW, sorry! Test now your game works to this point!

70


Adding the ‘YOU WIN’ screen Ok, this time you need to go to KATNISS SCRIPT AREAS and add the following script.

This says ‘When green flag is pressed, wait 60 seconds, if water is great than 0 and food is greater than 0 then broadcast win. Then go to the STAGE SCRIPT AREA and add the following: Which says ‘When I hear WIN, switch background, and hide the scores’

to WIN

And lastly you need to make sure the sprites hide – like with the loose screen. Katniss Script area, duplicate and alter the hide scripts and repeat for all the sprites.

remaining Go to

Well done! Test you game to this point! Well that’s almost it, but it’s a pretty easy game don’t you think….test it, all you have to do is go round getting scores – time for THE OTHER TRIBUTES (said is an devious voice!)

Adding Tributes So, now for the baddies! 1. Add a new sprite, called Tribute 1 2. Place him somewhere on your maze. 3. Add the following scripts into TRIBUTE 1 SCRIPT AREA.

71


This says ‘When Green flag is clicked go to (this position), show then glide for three seconds to the next position, wait a second, then glide back. My tribute goes up and down the right hand of the maze. You could add lots of locations to make it less predictable. The second script says ‘When green flag clicked, forever if touching Katniss Sprite, broad cast lose and hide. You may also want to add a ‘GO TO POSITION’ in Katniss’s script area so that she always starts in the centre. YOU CAN HAVE AS MANY BADDIES AS YOU LIKE.

72


Scratch: Dog and Crab Dog and Crab is an example of one of the simplest games you can make and involves two sprites using broadcast messages to to interact with each other. Press the green flag and use the mouse to get the dog to follow the crab and watch the crab run away. 1. Import two sprites using the Choose new sprite from file button and select pictures from the animals folder. Change the sprite names to dog and crab.

2. Put a green flag control event on each sprite to set up the positions at the beginning of the game. Place the crab randomly on the stage at the beginning of the game as shown below.

2. Set the dog into the middle of the stage when the game begins and add a forever loop on the main control sprite to control movement. In this case the dog follows the mouse pointer.

73


3. Add a sensing component into the forever loop for the dog to work out when things happen. In this case do some stuff when the dog touches the crab but also broadcast something so the other sprites (or the stage) can also react.

5. Add a receive event onto the crab so it runs away when the dog touches it. Messaging between sprites is much easier to control than repeating sensing on each sprite.

74


6. Add a background and voila - c'est finis (it is finished).

75


Fish! The basic principles behind of this type of game can be used to make many different games simply by changing the background and the graphics of the sprites. A game set in space with a rocket chasing astronauts and aliens would be simple to create using fish! as a base. We can build the game from scratch in simple stages: 1. Create the shark sprite and control movement with the mouse. 2. Create the yellow fish sprite with random movement. 3. Add a variable to keep the score. 4. Get the yellowfish sprite to broadcase a message if it is eaten by the shark. 5. Add shark behaviour that receives a message when a yellowfish is eaten and animates the shark to look like it is feeding. 6. Make the yellow fish disappear when it is eaten and then reappear a few seconds later. 7. Duplicate the yellowfish sprite so that there are several fish in the game. 8. Add a red fish and more broadcast and receive behaviour for the shark to get indigestion. .

Shark Costume Select the default scratch cat sprite and change the costume to look like a shark by pressing the Importbutton on the Costumes tab. Select shark-a from the animals folder and then delete the other costumes by pressing the delete buttons. You should also rename the sprite to shark.

76


Mouse-following Shark Creating sprite behaviour to follow the mouse is made easy by the point towards motion block available. Select the block and change the setting to show the mouse-pointer as shown below. A forever control loop is used to control the movement and the shark first points towards the mouse and then moves 5 steps. You can control the speed of the shark by changing this setting to speed up or slow down the action. You should attach the forever loop to the green flag so that the shark starts moving when the game starts. Notice also that the initial size of the shark is set here also.

77


Random Movement Sprite The yellow fish sprites move randomly around the screen. Create the sprite by pressing the Choose new sprite from file button.

Choose the fish3 image from the animals folder and remember to name the sprite yellowfish.

Random movement is created by using a forever loop to make the fish move at a constant speed and the random block from the Numbers section to turn the sprite a little with each loop as shown below.

78


The game now has two sprites which move around the screen. The shark sprite follows the mouse and the yellowfish sprite moves randomly around the screen.

Create a variable to hold the score We want to add to the score each time the shark eats a yellowfish so make a variable to show the score and make sure that it is made available to all sprites. Select the stage and add a green flag control block to set the score to zero each time the game starts.

79


Broadcast a message when the Shark eats the Yellowfish Add an if control block to the forever loop for the Yellowfish to sense if the fish is touching the shark and is about to be eaten. Import and play a sound and hide the sprite so it disappears from the stage. Add one to the score variable each time a yellowfish is eaten. The shark behaviour is controlled by adding abroadcast message control block and creating a new message called sharktouchingyellowfish.

Control the shark eating Yellowfish behaviour Import a second costume for the shark sprite using the shark-b image from the animals folder so that we can animate the shark to look as though it is eating. We can add a receive message control block on the shark sprite to change the costume three times so the mouth of the shark sprite moves.

This will happen each time the shark touches a yellowfish and receives the message broadcast by the fish sprite.

Reset the Yellowfish after it has been eaten The following block sequence hides the the yellowfish sprite which then reappers on one or either side of the stage after a few seconds. This behaviour waits up to five seconds and then places the sprite randomly on the left or the right of the screen by exploiting the fact the the coordinates of the 80


screen vary from -240 to +240 on the x-axis and -190 to +190 on the y-axis. This behaviour occurs just after the sprite has been eaten.

The behaviour of the yellowfish sprite is now complete but we want to have more than one fish in the game. Rightclick on the yellowfish sprite and click the duplicate option to create as many copies of the sprite as you like (older versions of Scratch do not have this feature and you need to export and reimport the sprite and edit the touching shark block).

Create the Red Fish sprite The game is nearly finished now but we need to create a bad-tasting red fish which resets the score to zero if eaten by the shark. Duplicate a yellowfish sprite and then import a different costume using the fish4sprite image and delete the original costume and rename the sprite to redfish.

81


Change just one block on the redfish script to broadcast a message called sharkeatingredfish instead of the sharkeatingyellowfish message. You can now duplicate the redfish sprite if you want to have more in the game.

Control the Shark eating redfish behaviour Import the shark-c costume from the animals folder into the shark sprite and add the following receive message control block to change the appearance of the shark and set the score to zero whenever a redfish is eaten.

Change the Background The final step is to select the stage and import the underwater image from the nature folder as the background. The game is now complete. It should be easy to change the background and sprite costumes to customise the game to whatever look and feel you want.

82


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.