You are on page 1of 9

Topic : Catching the Apple Name : Abhishek Kumar

Subject : PIC Batch : 2019-20

CATCHING THE APPLE

Introduction: Scratch is a free educational programming language


that was developed by the Lifelong Kindergarten Group at the
Massachusetts Institute of Technology (MIT) with over 40 million
registered users and 42 million shared projects. It is geared
towards kids ages to 8-16 and 2nd grade to high school.
Scratch is designed to be fun, educational, and easy to learn. It has
tools for creating interactive stories, games, art, simulations, and
more, using block-based programming. Scratch even has its own paint
editor and sound editor built-in. Users program in Scratch by
dragging blocks from the block palette and attaching them to other
blocks like a jigsaw puzzle. Structures of multiple blocks are called
scripts. This method of programming (building code with blocks) is
referred to as "drag-and-drop programming"
In this Scratch, we have prepared a simple game named ‘Chasing the
Object’. It is an easy game which is made with scratch for children.
There is an evil shark and a happy starfish. The starfish is happily is
swimming in the sea but there arrives a shark who wants to swallow
the tasty starfish. So the starfish, to protect itself runs away from
the shark. The shark being big is a little slow but still reachable to
the starfish. So I have prepared this game such that the starfish is
controlled by the mouse or keypad of the PC and the shark keeps on
chasing it. There are 3 levels in this game. After a specified time
the level is changed. With every changing level the size of the shark
increases and it becomes more difficult for the starfish to get away.
If the starfish is safe till the allotted time, the user wins the game
but if it is caught and eaten up by the shark then it says game over.
Some interesting sounds are also added in the game to make it more
interesting.
So this was a brief idea about how the game works and is played. It
is not as simple as mentioned above. However, this game still remains
challenging and enjoyable.
Explanation:

The concept of the game is very simple, you have to catch as many
apples as possible in the container to proceed to next level.

So first, I took one spirit as a container which moves horizontally


according to the keyboard keys. One press moves the container 10
blocks depending on whichever key is pressed.

Image for coding of the bowl:

Next, we have to move the apple vertically from any random x


position for that, as the game starts, we will place the apple on any
random x position and move it vertically from top to bottom.

In level 1, we will have 5 apples all moving at different speeds in


vertical direction from any random x position.
Image for coding of one of 5 apples of level 1.

Next thing we have to change the score, as the game starts, we will
set the score to zero, and whenever the apple is catched the score
increases by 1.
We can see this in the above figure how score changes whenever an
apple is catched.

Now we have to write the code for the bombs which will reduce the
score by -5. The code is almost similar for bombs as for the apples.

At the starting the bombs will be set to any random x position then
they will fall vertically all with different speeds and if the container
touches the bombs then the score will be reduced by -5.
If the score reaches over 20, we will proceed to next level in the
next level we will introduce balloon which will be hidden until level 2
is reached, once level 2 is reached the balloon will show up and rest
of the code remains same as that of the apples.
Figure shows the coding for the balloon.

We will also create a self-made spirit for showing that we reached


level 2, this can be done by hiding this spirit up to score 20 and then
it will visible once the score reaches 20.
Figure shows the coding of
the self-made spirit about the level change.

If we keep hitting the bombs and the score is reduced to less than
20 then game ends and everything stops and a spirit pops which says
game over.

Figure shows the coding for


the last spirit which tells us that game is over. You can restart the
game at score = 0 by pressing the green button.
Figure shows the gameplay screenshot at level 1.

You might also like