ScratchJr Fruit Ninja Game

Here is a walkthrough video of how to make this game in ScratchJr – the step by step tutorial is further down the page.

Here is a downloadable pdf which includes the ScratchJr code blocks for each feature of the game.

This is a long tutorial, so to help make this project, I have created some extra videos:

How to create & code a basic joypad (up, down, left, right) in under 2 minutes

How to create & code an advanced joypad (jumping & shooting) in under 4 minutes

How to create and code a countdown timer in ScratchJr in under 1 minute

Please email me on the contact details at the bottom of the page if you would like me to send you the ScratchJr file for this game – WordPress does not let me upload this file format here 🙂

Here is the step by step tutorial and resources to allow you to create and code your own Fruit Ninja Game in ScratchJr on your mobile device.

Video transcripts:

Intro

0:00[Music]

0:05[Applause] [Music]

0:12hello and welcome back in this video I’m going to take you step by step and click by click and show you everything you

0:18need to do to create your own firsters Fruit Ninja game in scratch Jr I’m going

0:23to show you how to customize the background create a firsters hand to help you chop the fruit going to show

0:29you how to create more than one level and I’m also going to show you how to effectively and efficiently reuse your

0:35code for extra characters all you need to achieve any of this is the free scratch Junior app on either your phone

0:42or tablet to get the best results from this video follow along on either a TV tablet phone or any screen which you can

0:48access YouTube and pulls after each step I highly recommend you go through this video first step by step and actually

0:55make the game yourself then watch the video again with the child you’re teaching this will make it easy for you to guide them cuz you’ll be familiar

1:01with the steps this video is 100% child friendly with no band language or inappropriateness I will be sharing this

1:07actual video with the parents carers and children in my class if you do need any extra help or have any questions please

1:13leave a comment below or VI a contact details on my website email me and I will answer you as quickly as I can okay

How to customise the background in ScratchJr

1:20let’s start by opening up scratch creating a new

1:26 project and deleting scratch the kitten then we’re going to go to our add

1:32background and we’re going to select one that’s got some trees in it but we’re going to edit it by pressing the paint

1:38button we’re going to get rid of some of the features by pressing the scissor button there that we don’t

1:44need mainly the fruit because we want to add our own and then what we’re going to

1:49do we’re going to add a bar on the bottom where we can add our joy pad so I’m going to click on the create

1:54rectangle button there I want the black color and I’m going to aim for

2:00two squares Up drag it all the way

2:05down then press the fill button and there’s our black bar across the bottom

2:11where we’ll be able to add our joyad so let’s press the tick button and there we

2:16have our custom background next what we’re going to do is we’re going to create our hand character that’s going

How to create the ‘first person’ hand in ScratchJr

2:22to be used to chop the fruit so I go to the plus character button click on the

2:28blank character and then the paint option so we’re going to do this in two steps first of all what we’re going to

2:34do is again we’re going to create a rectangle but this time we’re going to

2:39click on the photo button there the camera button and click um inside of it so that we can

2:47there I am take a photo of ourselves but what I actually want to do is create a

2:52photo of my hand as the character so I’m going to pull it out a little bit try and get my shoulder out so look it looks

3:00like it’s chopping try to get my shoulder out don’t quite rotate that much here we go

3:07oh that’s better and press the button so there is our character if I press plus

3:14uh sorry the tick now that’s what the character look looks like it looks good but there’s also this excess background

3:21um in the background photo of the actual character then you can see that is actually what the character is so we can

3:28do a little bit better than that so I’m want to press on the paint button there then I’m going to go to the free draw

3:34option and then what I’m going to do using a green color cuz I want it sort of to match the background I’m going to

3:40very carefully go around the edge of my

3:48hand oh as close as I

3:57can so there we go you you can see that I’ve gone round the edge of my hand i’m then going to press the camera button

4:04again and click on there and I’m going to try to fit my

4:10hand into that shape that I’ve

4:16created now it’s essentially a picture on a picture so I’m then going to go to the scissor button and click on the

4:23background and that has removed the rest of it and when I press tick now not

4:28perfect but that’s a lot better so that’s a little bit more accurate a little bit tighter on the uh picture of

4:35my hand so it’s I think a better character next what I’m going to do is I’m going to create the joyad that will

How to create and code a joypad in ScratchJr

4:41control the hand character so I go to my plus character button again I’m going to go to the blank option and paint once

4:48more I’m going to go to the um I think my first one’s going to

4:53be purple go to the purple color and go to the create Square option and I’m

4:59going to use my the squares on here to create a square as best I can I’m then

5:04going to fill that and press the tick button that is one of my joyad buttons

5:10I’m just going to drag that down to there now if you’ve seen any of my previous V videos I like to use that as

5:15a template so I’m going to go to plus character again click on the purple Square I’ve previously made click on the

5:21paint option and then I’m going to fill that I think the next button is going to be

5:26red and there it is so that’s the left of right buttons I’m also going to have a swivel or chop left and right button

5:33so I need two more buttons so once again I go to the plus character button click on the button I’ve already cor uh

5:39created then go on the paint option and this one’s going to be

5:46green and I’ll drag that down and then one more time sorry one more button click on the green button go

5:53to the paint option and this one’s going to be blue

6:00and there I have my joy pad buttons next I need to code each of these buttons so I’ll start with a blue one CU it’s

6:06already selected so I go to the yellow category I’m going to select the start

6:11on tap button I’m then going to go to my send message block and I’m going to use

6:18the blue one I like to align the colors to the buttons it makes sense to me I’m

6:23then going to drag that code over to the green button change that to

6:30green I’m then going to drag that code over to the red

6:36button change that to red and then finally going to drag it over to the purple button click on there and change

6:43that to purple so each of my buttons now has an Associated send message block to

6:49it that will then trigger a movement in the hand character so I then need to go

6:54to my hand character and I need to code this so I’m going to set up the receive

How to code the hand character to move using the joypad

7:00message blocks

7:05first and again I like to space them out as they are shown on the screen because it makes it a little bit easier for me

7:12to visualize where they are so the purple button here what I

7:17want that to do when it’s pressed I want that to trigger the hand to move left

7:24one square when the red button is pressed uh and the message is received I

7:29want it to trigger the hand to go left now for the left and right chop which is the green and blue buttons what I want

7:36to happen is I want the chop to go rotate the hand to the right but then

7:43reset itself back to the middle so I want to rotate one right and then rotate

7:49back again left and the same again but this time with the

7:55um left hand chop but it’ll be the opposite way

8:00so let’s see what happens if I press the purple it moves left the hand moves left if I press the red it moves right if I

8:08press the green it chops left and sorry right and if I press the blue it chops

8:14right amazing um now those chops seem a

8:19little short to me so I’m going to change that to a

8:26two to make a bigger chop so let’s try that

8:31yes fantastic brilliant and let’s have a look at that on full screen so we move left sorry move right move left Chop

8:39right chop left amazing so chop left Chop

8:46right okay let’s go back to our screen before we create the apples I just want to slightly resize the hand so I’m going

8:54to go to my size option or my shrink option and press that a couple of times

9:00and I’m going to drag that down so that the hand is on the edge of the black bar

9:05now I’m going to create and code the apples what I want the apples to do is fall from the tree and look like they’re

How to create and code the apples

9:11coming towards me as the character and as they do that they will be rotating

9:17and getting bigger so that it looks like the perspective is being changed so I go to my plus character button scroll down

9:25I think there’s already an apple somewhere there’s an apple great and I’m going press the tick button to select it

9:31first thing I’m going to do is make it as small as I can I’m then going to position it

9:38into the tree which is there what I want also to do is add the

9:44disappear and the reappear button because I want to be able to hide the Apple at the start of the game so it

9:50just appears but when I’m editing it or work on it I want to be able to see it so that’s why I’ve added the appear

9:56Button as well so first thing I want want to do is I want it to start on the

10:02green flag so I select that I then want it to actually

10:08appear I want it to move but I want it to move quite slowly so I’m going to go

10:13to the select speed block I’m going make it its slowest setting possible then all

10:19I want it to do from the tree is move down now let’s turn our grid on it’s

10:26currently at 14 and the lowest really it’s going to get is four so I’m going to set that to

10:3510 turn grd off and I want this just to

10:44continue next what I want it to do also when the red uh sorry when the green flag is pressed is I want the Apple to

10:53rotate as if it’s rolling in the air as if it’s falling so I just want that to

10:58continue forever as well the final thing I wanted to do on

11:03the green flag is when the green flag is pressed I want it to start SW start and gradually get bigger as if it’s getting

11:10closer to us so I’ve already selected my green flag I’ll then go to the um in

11:16grow block I’m going to select that to one and I just want that

11:23oh I just want that to happen and continue continue getting bigger and bigger and bigger so there’s the start

11:31of our code let’s give that a little test see what

11:36happens fantastic so let’s stop that and reset so we can see when we press the

11:41green flag it starts to move down it’s rotating it looks like it’s Falling

11:47Towards us next what I want it to do is an

11:52action when I’m able to chop the uh Apple I want it to change direction and

11:58start to disappear so I’m going to go to the yellow category again and select the

12:04start on bump block first thing I want to happen and I’m is I want all the rest

12:09of the other code to stop so I’ve selected the stop block there then what I want to

12:16happen is I want as I chop it I want the speed of the Apple to increase as I bat

12:23it away and when I bat it away I want it to go diagonally to the right so I’m going

12:30to select my repeat block and I’m inside of that I’m going to

12:35put an up block and a right block so that should

12:41allow it to go diagonally right away from me then what I want it to do once it’s

12:48done that is to disappear and I want

12:58that to then stop so let’s try that now so I press the green button it starts to

13:03come down I go to chop it I chop it it moves away and disappears fantastic so

13:10let’s reset that but what I want to happen once I’ve chopped it and it’s disappear I want

13:16that to trigger the next apple to appear and fall so what I’m going to do is I’m

13:21going to go to the send message block there and then I’m going to add my stop

13:28block on the end of it that send block there that send message

13:33block the orange one will trigger the next apple to fall I will create the next apple in a moment so let’s test

13:39that on full screen green flag to start chop it and off it goes fantastic

13:48let’s go back to small screen and reset disappearing that Apple great now I want

13:55to add my second Apple so I go to the plus character button again scroll

14:02down to Apple and this time I want to change it up a little bit I want to change the color of the second Apple so

14:07I go to my paint option the next apple is going to be green so I’ve already got

14:12my paint option selected I’ve selected green and I let um click on there and the Apple turns green and there it is

14:19first things first let’s shrink the Apple small as it will go and I’m going to position it I want this one to be on

14:25the left hand side of the screen now I can use exactly the same code that I

14:31will modify slightly as the Red Apple so to save time I’m just going to copy all that

14:41across and there’s my Apple code there I am going to add the disappear and appear

14:47options again so it makes it easier for me to work with it now the big change I want to make is I do not want this apple

14:54to start when the green uh code to start when the green flag is triggered what I

14:59actually want it to do is start when the orange message is sent so I select this

15:05block the start on orange message block to replace where the green flags are in

15:12the Red Apple code cuz the Red Apple will start when the green flag is pressed the green apple will start or

15:19start to fall when the red apple is chopped by my hand the next thing I want

15:25to change slightly is because I want to um start a third Apple after the green one

15:32I’m going to change that we’ve already got purple used red used green used blue use and orange use so the next one is

15:39going to be a yellow message so once the I’ve chop successfully chopped the green

15:46apple it will send a start on message Yellow Block which we’ll use to trigger

15:51the third Apple so let’s disappear that let’s go full screen to test so green

15:58flag here comes the Red Apple I chop that that disappears and great that

16:03triggers the green flag which i cho now notice when I chopped the green flag it went that way and I want sorry it went

16:10that way and I actually want it to go that way so I need to edit the code slightly so here instead of a move right

16:18block I want to change that to a move left block let’s delete that reset let’s

16:24try that again green flag to start here comes my chop yes

16:31great and oh chop that yes and it goes left fantastic notice it came out this

16:36way a little bit so I think what I might need to do is let’s make that

16:42up let’s move this slightly this way disappear that so when it when I

16:49chop it it moves that way it disappears before it enters or leaves and enters the screen on the other side so one more

16:56try green flag to start chop

17:01great green chop again fantastic exactly

17:06what we want to happen let’s make that small screen again reset now let’s add our third Apple so go to the plus one

17:12more time scroll down to the Apple there it is let’s press paint to

17:19modify I want this apple to be blue okay let’s make the Apple

17:27small small is it goes bring that to the top there again we can copy across the

17:33code from the other apples and then modify it just to make life a bit

17:40easier so we know that we have to change these to Yellow because it will activate

17:46on the yellow when the yellow message is sent and what also we want to do when

17:53this one’s batted off red one goes right the left one go so the green one goes left we want this one to go just

18:00straight back up again so we can just remove that and it should just go back

18:05up when we’ve battered it off right let’s hide

18:10that and let’s reset Everything full screen let’s see what how we get on

18:16green flag to start chop the Red Apple chop the Blue app green apple

18:24here comes the blue one chopped it fantastic now that went a little bit

18:31fast let’s slow that one

18:36down okay great so there are apples

18:42coded our hand is coded our Jo joyad is coded and our background has been customized now you would have noticed on

How to create an code additional levels in a ScratchJr game

18:49the blue Apple we don’t have a start and send message for this one because we

18:54don’t have any left we’ve there’s only six colors and we’ve used of all between our pad and our triggering our apples to

19:01start so I want once you’ve successfully chopped the three apples I want that to be the end of the level and I want you

19:07to progress to level two so what we’re going to do is we’re going to add another page we’re going to

19:14delete scratch the cat we are going to go to our background we are going to

19:20select a new background one that is still got trees in it but slightly different so let’s choose that one again

19:27we are going to to edit it so let’s remove some of the bits we don’t need um

19:33I wonder if we can remove these oh we can remove the leaves great fantastic oh that takes everything

19:40out that’s fine so it’s still got trees it just looks slightly different let’s um press tick there for now and then

19:48what we’re going to do is we are going to say this is level let’s go capital letters level

19:57there it is two let’s make it as big as we

20:02can what color is it already black fantastic let’s put that here so that is

20:08now level two and level two level one was Apples level two is going to be all

20:14about the peaches so let’s find our Peach there it is and let’s press tick

20:24and there is our Peach now I’m not going to actually I will code the peach I’m going to roll the peach along from there

20:32to the right hand side of the screen so I’m going to go green flag move

20:38left keep going so I want it to keep going around and around around also green

20:44flag rotate so it looks like it’s actually rotating so let’s give that a

20:51little go yeah that looks pretty cool fantastic then we’re going to go

20:57stop and res set now to move this screen or this page to the next page we need to

21:03add the actual game plan screen for around level two so we go to plus again

21:09once again we’ll delete scratch the cat we will use the one we’ve just customized so it looks exactly the same

21:15but I will edit slightly CU I want to create that black bar at the bottom to allow us to have our joyad again so

21:22let’s go here again selecting the rectangle

21:29tool go to our fi button and create that then press tick and there is our we’ve

21:37got our level two and then we’ve got our gameplay screen so from here what I want

21:42to go do is go to the yellow category again again select the green flag and I

21:49want to go to our timer and we want to wait 2 seconds so that’s 20/10 of a

21:56second and then once that’s that time has gone it will then change pages to

22:03the third page so let’s give this a little go so we go back to our original

22:08screen reset Everything full screen green to go so here we go we chop that

22:16Apple move across chop the Apple again now once we chop this one we should go

22:22to the next level that chops and it hasn’t worked so let’s see

22:29what’s happened ah I know we didn’t add that block there so let’s add that block

22:35there as you go to the second page reset let’s try again cross

22:42chop green apple chop blue

22:48Apple chop go to level two fantastic and

22:53then ruin the final screen so let’s make that small

23:00go back to original screen and reset okay so now we need to create the characters and all the code for screen

How to copy characters and code to additional pages (i.e. levels) in ScratchJr

23:08three or level two now we could individually inut put them all but actually there’s a quicker way so we can

23:15actually copy everything across into that so we’ll click on the character drag it across into that third screen if

23:22I click on that you can see the character copies across plus all of its code which is super useful for time

23:28saving so if I go back to this one here I’m going to pull across all of the joyad

23:47buttons to copy them across as well so we’ve now got a fully

23:54working chops and everything joyad and carrot uh hand character there I do need

24:00to line these upper touch but that’s all

24:07good now the next trick is to make code in the peaches as easy as

24:13possible we’ve got apples in this screen but we want peaches so the way I found

24:19to do this is if we do drag across the apples essentially the code’s going to

24:25be exactly the same but we want peaches and not apples so what I then do is I’ll

24:32go to the plus button I’ll find the

24:38peach and add it again shrink it so it’s super

24:44small but then what I’m going to do is I’m going to go to the Apple um and I’m going to the first Apple and I’m going

24:50to copy across all of the code because actually the code is exactly the same

24:56and we’ll do exactly the same thing because the three Peach I’m going to create essentially mirror the three

25:03apples so I’ll put that peach on the right hand side there I’ll then go to my

25:11peach again and I’ll edit that so that it’s

25:17green not sure if you can get green peaches but hey we’re going to try again I’ll make that really small again I’ll

25:24put that on the right hand side where the apple is I’ll then go to my green

25:29apple and copy all that code

25:35across and then finally I’ll add another Peach and you know what color that’s

25:42going to be go to the paint option let’s make that blue I think you definitely don’t get

25:48blue peaches but hey this is the beauty of coding we can make the whatever reality we

25:54wish click on the blue apple and then drag across all of the code that is

26:04there now the only thing we now can delete by hard

26:13pressing the

26:23apples and we’ve got our peaches the only thing I want to do is instead on

26:28the blue pach having this go to back to that page there I want to change that I want to create an end of game screen so

How to create and code an end of game screen in ScratchJr

26:36I’m going to press on this button here to create that that full page

26:42delete cat find an appropriate background

26:49for oh not that one let’s

26:55have the winter one that’s quite nice um again I want to just delete a few

27:01bits off that so let’s try that again so I want this Hut to be gone because then

27:06it’s the same um setting really but just in different seasons and I am going to

27:13put [Music]

27:22congratulations oh it’s a bit big conratulations

27:34you you have

27:46completed what the

27:55game there we go so we want it to go to the so I go back to here and change this

28:02by the red category to the full screen

28:08now let’s have a quick let’s make sure we

28:15disappear all of the peaches to start so we can test

28:25it okay so what we’re going to do we’re going to test this one here so here comes that peach chop

28:32it oh they’re a bit

28:38quick yes well it the function of it works let’s just go back to here M and I

28:45think when you copy across the code yeah I can see the peaches are not on the

28:50slowest option okay let’s try that again then

28:57let’s Go full screen so we can see a bit better that’s much better obviously you Advanced players

29:03can have it change the speed to fast and make it a bit more tricky for you

29:09chop fantastic now one thing I do want to do reset is the green one let’s see

29:17where that is okay again when we chopped it it appeared on this side as it went out so let’s put it like that there we

29:25go so disappear that one more test and we’ll give the whole game a go chop the peach

29:34good chop the peach last one chop yes fantastic let’s make that

29:42small again go back to our original reset everything now let’s test the game on

29:48full screen here we go so off we go there apples first chop the

29:55Apple chop that apple chop that apple good oh on to level two

30:03like it chop the Apple uh peach

30:09sorry

30:14chop fantastic yeah

30:20great well done everyone congratulations and well done on creating your own first person Fruit Ninja game in scratch junr

30:27on your mobile device if you do need any extra help or resources please visit the link in the description where I’ve

Congratulations, and where to go to get additional help and support

30:33created a dedicated page for this game with extra resources to help you also on

30:39this page right at the bottom you’ll find my contact details so please reach out if you need any help or got any

30:45feedback please share with me on social media any modifications you’ve made to the game to make it even better thanks

Outro

30:50again for your time and I’ll see you next time bye