Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

INNOVATIVE MINDS

BUDDING CODERS
ASSESSMENT PROJECT - FRUIT NINJA
Click on the fruits
to start the game

Checkout the game on below link:


https://forkphorus.github.io/app.html?id=530908907
STEPS INVOLVED
1. Make a start screen and create sprites

2. Creating clones for the bomb and the fruit sprite

3. Select Fruit sprite ; Design & name the costumes

4. Code for the fruits and design the costumes .

5. Make the un cut fruits go up and fall down.

6. Give a condition to slice the fruit

7. When sliced make the splash to appear { Additional Assignment}

8. Create a bomb

9. Set Score

10. Set a Timer


START SCREEN

1. Choose a backdrop and create a start sprite.(Eg: Start

button)

2. Once the start sprite is clicked, the game should start.


Creating CLONES for BOMB & FRUIT
{Give the below instructions in backdrop }

Fruits should appear on the screen and once in a while

the bomb should appear.

1. Bomb should appear less number of times.

2. Give a condition:

Example: if the chosen random number is equal to 1

then create a clone of bomb else create a clone of fruit.

The more you increase the range, the less will be the

frequency of the bomb appearing in between the fruits


Creating CLONES for BOMB & FRUIT
3. Repeat the condition the based on the number of fruits

chosen for this game.

4. Wait for few seconds and repeat the blocks forever


DESIGN THE FRUIT COSTUMES
1. Select a fruit of your choice and name the costume

with a number.

2. Duplicate it to create a costume of sliced fruit.

{Hint: Convert the picture to bitmap and use the

select tool to get the sliced look of the fruit}

3. Repeat the step 1 and 2 for other fruits.

{Hint: Make sure the uncut fruits are having odd

number names and the sliced fruits are having even

number names }
PICK THE UNCUT FRUIT COSTUME

1. When the fruit starts as clone, a random uncut fruit

costume is to be chosen.

2. When the fruit goes up it should be as a uncut fruit,

not a sliced one.

3. Check the costume number & name of the uncut

fruits.

{Hint: Rename the uncut fruit costumes in odd number}


LOGIC TO CHOOSE UNCUT FRUIT COSTUME

1. Use the basic operator blocks and try to get a odd

number, as the fruits are having odd numbers ,switch

the costume as per it

{Hint: ( x * 2 )-1 always give an odd number where x

is any random number based on number of fruits used in

this project} }
FRUIT GOES UP & FALLS DOWN (a)
The fruit is programmed to start from the bottom of the

stage initially ,has to go up and fall down.

Objective: Set the initial position of the fruit.

1. The fruit should start at the bottom of the stage.

2. Each time when it starts as a clone, it should start at

random positions along x-direction.

3. Set the direction of the fruit.


FRUIT GOES UP & FALLS DOWN (b)
Objective: The fruit has to spin and go up to a random x ,

y position at a varying speed.

1. Create 3 variables which store the values for speed in

x-direction, y-direction and rotation.

{Hint: Give smaller range for x and rotation, where as

a medium range for y}


FRUIT GOES UP & FALLS DOWN (b) cont…
Objective: The fruit has to spin and go up to a random x ,

y position at a varying speed.

2. For the fruit to spin and go up at varying speed


- Turn the fruit as per rotation speed

- Change the x-value based on the variables created.

- Change the y-value based on the variables created.


FRUIT GOES UP & FALLS DOWN (b) cont…
Objective: The fruit has to fall down

3. Wait for 1 secs and reduce the speed of y- direction by 1.

*** If the fruit comes down it has to go up again: which implies

the step2 and step3 should repeat if the fruit is touching the

bottom.{Hint : place the step code and step 3 code in repeat until block}
CONDITION TO SLICE THE FRUIT
The fruit should be chopped/sliced only if it is a uncut fruit,

mouse is pointing to it and is clicked .

1. Create a variable which can store the value of yes and no.

{Hint: If fruit is sliced “yes” .If fruit is uncut “no”}

2. Set the initial value of the variable to “no”.

3. If the mouse is pointing and mouse is clicked and slicing is

no

then switch to next costume and set slicing to yes


CONDITION TO SLICE THE FRUIT
Checklist:
1. Give the above instructions for fruit when it will start as
clone.
2. Hide and delete the clone of fruit once all the instructions
are over.
CREATE A BOMB
A bomb has to appear similar to the fruit which has to go up
and fall down.
1. Create a bomb sprite.
2. Set a random x value, fixed y value and a value for
direction.
3. Set the x direction speed, y-direction speed and rotation
speed.
{Hint: Use the speed variables}

4. Make the bomb go up and fall down.


{Hint : Use the same instructions as the fruit sprite to
make the bomb go up and fall down}
CONDITION FOR GAME OVER
When the bomb is click the game is over.
1. If the mouse is pointing the bomb and the bomb is clicked
then the game is over.

Checklist:
1. Give the above instructions for bomb when it will start as
clone.
2. Hide and delete the clone of bomb once all the instructions
are over
SCORE
Score should be increased after the slicing of the fruit.

1. Create a variable which can store the value of score.

2. Set the initial value of the score to zero.

3. If the slicing is yes

then increase the score value


TIMER
Timer should start with a particular second and is to be

reduced

1. Create a variable which can store the value of time.

2. Set the initial value of the time to 60 sec.

3. The value of timer should be reduced after one sec, which is

to be repeated forever.

{Hint: wait for 1 sec and reduce the value of timer by 1}


ADDITIONAL ASSIGNMENT
Use your creativity and logical thinking to make a splash when

the fruit is sliced.


(This additional assignment will gain you extra scores in your course completion certificate.)
Happy
Coding !!!

You might also like