codeX app Creation Week 4


WhAt Up G?HoW y0u d0iNg? WhAtZ g00d iN tHe h00d?

Hey! Happy Friday! I hope you are doing well :) Today we are going to be learning something new- a foundation of how many games and apps are made!

FYI- In mid-December, you will be split into teams to compete in an App Competition, so be sure that you are remembering what you are learning!


1st: Log-onto SLACK. I will be on, so we can all chat online! Say Hello and let me know how school is going :)


2nd: Fall is the most beautiful time of the year at Harvard! Check out the Gallery below to see where I live and how amazing the weather is!

3rd: I know that some of you are having issues with ShiftEdit. We are working to get your workspace back up. I will have more details for you next class meeting, but none of your work will be lost. It is a server issue, so no te preocupes!!


Brilliant Students,

So before we begin, I want to say thank you! Thanks to all of your hard work and the effort Mr. Harlan-Gran gives to help make the program operate, CodeX won the Westly Prize for Young Innovators in CA! You apart of one of the most innovative programs in the state! Pat yourself on the back, we could not have done it without you!

My hope is that you are having fun! You enjoy meeting and you are learning stuff! Lol

Your effort is making a huge difference in Modesto and will have great effects on the State in the future. Little do you know, you are a part of something extremely special! Be proud of yourself, stand a little taller, knowing that you are success at this young age!

Much Love,


P.S. If you’d like to read more about the prize we won or watch the film of last years prizes, check out the links below!

Weslty Prize Site:

Check out the Video Below from the 2015 Westly Prize!


LeT’s GeT IT CRaCkIn’!

Does this look familiar? Have you ever seen something like this?

Today we are going to learn how this works (making an image bounce). Think about all the apps on your phone that you have used that involved some type bouncing and jumping on a screen. I bet most of the games you play on your phone involve this in one way or another!


Open the MIT App Inventor! And login using your credentials

Here is the link:

AND create a new project called “BallBounce”

Fill Parent

So like with our Doodle App, drag the Canvas over and FILL PARENT!

Now that we have a Canvas in place, we can add a “Ball Sprite.” This can also be found in the “Drawing and Animation” section in the Palette

Drag out a Ball component and drop it onto the Canvas.

PS To make the ball bigger and smaller by changing the Radius property in the Properties pane. TRY IT OUT!


Now Go to Blocks!

Choose the block when Ball1.Flung and drag-and-drop it onto the workspace. 

Flung refers to the user making a "Fling Gesture" with his/her finger to "fling" the ball. Fling is a gesture like what a golf club does, not like how you launch Angry Birds! In App Inventor, the event handler for that type of gesture is called when Flung.


Open the Ball drawer and scroll down in the list of blocks to get the set Ball1.Heading and set Ball1.Speed blocks


Mouse over the "speed" parameter of the when Ball1.Flung event handler. The get and set blocks for the speed of the fling will pop up. Grab the get speed block and plug that into the set Ball1.Speed block.

Do the same for the Ball's heading. Mouse over the heading parameter and you'll see the get heading block appear. Grab that block, and click it into the set Ball1.Heading block.


Now there is a logical explanation to this, don't freak out:

Set Ball1 Speed: You want to tell the app that when you "fling" the ball, you want it pick up speed

Set Ball1 Heading:  This tell the app the direction in which the ball is move towards based on how you "fling" the ball. 

Screen Shot 2016-11-18 at 4.54.29 PM.png

No it is important to ensure that the ball bounces off the edges!

Why do you think this is important? What would happen if we did not add this portion of code?


Take out an Android Phone (or find someone with one- sorry an iPhone will not work

  1. Click App (provide QR code for .apk)

  2. Then scan the QR Code with your phone!

FYI: If your phone does not have a QR Code Scanner, you can download one for free from the Google Play Store!

Now, in case you are an overachiever, which we hope you are:

Try adding these elements to your app:

  • Change the color of the ball based on how fast it is moving or which edge it reaches.

  • Scale the speed of the ball so that it slows down and stops after it gets flung.

  • Give the ball obstacles or targets to hit

  • Introduce a paddle for intercepting the ball, like a Pong game