How to make mini game on Scratch ?

scratch

什麼是Scratch?
https://scratch.mit.edu
一種程式語言(Programming Language)
創造互動故事、動畫、遊戲、音樂和藝術等等

Scratch is a drags-and-drops programming language for creating interactive stories, animations, game, music and art.

Creating a program in Scratch does not require any typing at all. Rather, there are blocks of computer instructions that the student drags-and-drops together to create an entire program. The benefit of this approach is it is not possible to create a syntax error (for example a missing semi-colon or parenthesis in the wrong spot), which can be a tremendous hurdle for first time programmers.

小遊戲
例子:
Washabili熊仔食蕉仔

Example for mini game:

Washabili eats banana

washabili game shot

https://scratch.mit.edu/projects/54984288/

MV
例子:
Washabili係旺角唱歌

Scratch MV

Control the sprite to dance with music

https://scratch.mit.edu/projects/56267184/
Cap screen 後放上 YouTube

Choose the backstage picture or design your own one using graphic design software like Adobe Illustrator or PhotoShop.
Backstage size is 480 X 360 pt

Choose your backstage

beach1 background-01  beach2 background-01  helicopter background-01  road background-01 Sakura background-01  milk house background-01

What are sprite?

Sprites are the things in your program that move around. They are the things that the program interacts with. For example the cat that you see in all the examples above is a sprite that all Scratch programs start off with. Any commands that you create in Scratch will affect a sprite. To create a new sprite click on the sprite icon that is shown in the picture on the bottom left.

Sprite movement

sprite move

Washabili:

washa eat  washa left  washa right

 

Lazy harp seal:

seal1   seal2   seal3

Things for your sprite to eat

apple grapegrapefruitorangepineapplestawberry

burger  hotdogcoke egg fries

milk  cheese

scratch map

 

Drag the command from the middle panel contains the various instruction blocks that are available for use. Snapping these together in the right panel allows control of the various characters on the stage on the left.

To delete, drag the command back to the middle panel.

To do multiple commands, drag each command on top of another one to create a chain of commands as shown. Run the code by pressing on the chain!

The eater (Washabili) script:

 

washabili script

The food (banana) script:

banana script

Make the banana sprite move with in X(-200 to 200) and Y(-200 to 200) randomly, the sprite will not be off-screen or hidden.

sprite scale

 

When the colour of banana touches the colour of Washabili’s mouth

 

 

 

Screen Shot 2015-04-24 at 12.20.16 pm

 

Washabili eats banana mini game

I attended Hour of Code at CITYU APPS LAB last weekend, the workshop at the afternoon introduced this user-friendly online programme, Scratch , to create your own interactive stories, games, and animations — and share your creations with others in the online community.

It is very inspiring and I used Scratch to create this mini game! Credit goes to the friendly help from their genius team! Please check out their page: Hour of Code in HK and Facebook for updates.

 

Scratch mini game code

——————————————

This is the mini game I created called <Washabili eats banana>

Tropical breeze at the beach and it’s a great time to catch bananas as much as Washabili can!
Press < spacebar >to open Washabili’s mouth to eat the banana!
See how many you could catch! Oh!! .V. The naughty running banana!

Inspired by the YouTube tutorial of Ghost catching candies.
Watch it and you can make it too!
In the video you will learn how to use variables blocks, sensing blocks, broadcasting and layers to a project.