Programming 102
Time 5.8 hrs

Difficulty Intermediate
Prerequisites Programming 101
Departments Human Technologies
Authors Wren Merrett
Groupings Individual
Pairs
Threes
Fours
Fives
Minimum Year Group None

Blurb

Do you want to learn the programming language that was used to make Minecraft? Do you want to make cool games but can’t get your head around how complex some coding engines are?

Outline

Resources
What is needed to run this unit?
Cross-Curricular Links
Do not try and force this. What areas of other subjects might this reflect and/discuss language. For IB, links with ToK.
  • ...
Teacher Reflection
What was successful? What needs changing? Alternative Assessments and Lesson Ideas? What other Differentiation Ideas/Plans could be used?
  • ...
Credits
Any CC attribution, thanks, credit, etc.

This page requires you to be logged in to access it. Please login and try again.
5 mins
The Pitch
Why?

Do you want to learn the programming language that was used to make Minecraft? Do you want to make cool games but can’t get your head around how complex some coding engines are?

10 mins
Introduction
Discussion
  • So far you’ve done some programming in scratch, but that's all block-based. Now let’s take it a step further and do some text-based programming
  • Ok, we sort of lied about the part where you learn the programming language that was used to make Minecraft; In this unit, we will be teaching you Processing 3 which is a Java-based programming language, so it's even better than what Mojang used to make Minecraft;
  • Processing 3 is simple, beginner-friendly and is a great introduction to the world of text-based programming languages;
  • Since this programming language is Java-based, it is a great introduction to Java-script which is a programming language you should definitely get to know if you want to learn more programming;
  • In this unit you should learn the following:
    • What is a programming language?
    • Why you might want to use Processing as a programming language
    • Learn the following in processing:
      • How to set up the Workspace;
      • Learn to make shapes;
      • Learn what RGB is;
      • Loops and Functions;
      • Collisions and simple physics;
  • By the time you're done, you can make something like this!

via Gfycat

10 mins
What Language
So Much Choice
  • Programmers can get very passionate and heated about which is "the best language".
  • However, most programming languages share a lot of features, and all have strengths and weaknesses.
  • There are a very, very larger number of programming languages that you might choose from:

  • In this unit you will use Processing 3, but some other popular languages include:
    • PHP - for making dynamic webpages (this is what much of Gibbon is written in.
    • JavaScript - which works with the HTML and CSS for building website interactions.
    • Java/Processing - for making desktop applications, and many other things.
    • Python - multipurpose, and super powerful, it even inspires comics.
  • If you want to think more about language choice, this article might help.
120 mins
Processing Basics
Task
  • First of all, you should complete this Hour Of Code on Processing 3, it has a lot of important information that you should know first (you will not need Processing for this step);
  • Second is to login to the P5js editor, which is an online editor for Processing that works in your browser, on either Max or Chromebook:
  • There is a great online reference guide for P5js, be sure to check it out!
180 mins
Bouncing Ball Project
Task
  • In this section you will create a bouncing ball simulation (don't worry, we'll get onto games soon).
  • The first thing we are going to do is add in the variables shown below. These are called float variables, float variables hold a number so from now on “x” will equal 100 and “y” will equal 100. You get the idea;

  • These variables are telling the code where our ball will start and how fast to move. You see, we won’t be making the ball bounce around, we’ll be making a point bounce around the screen and draw a ball there. Don’t worry if you are confused by this right now, it’ll make sense later;
  • You should be able to recognize the setup function from Hour of Code (and from the way we wrote this unit, hopefully you get the joke by now);
  • You might also recognise the draw function and why it’s there, we will also add speed to the location that the ball will appear;
  • Now that we have a place for the ball to start and speed that the ball will travel, let’s actually make this ball, to do this all you need to do is draw an ellipse like you learnt in Hour of Code but make the location for it our variables x and y. ellipse (x, y, 50, 50);
  • Of course don’t forget to use fill () and stroke () to give it color.
  • Well congrats, you now have a ball that can move. How about now we make it bounce.
  • This little piece of code will make our little ball bounce on walls by comparing the Xposition of the ball and the width of the window. Now try to make some code to make this bounce on the floors and ceilings. (quick hint, the “| |” is an “or” symbol);

  • Alright, nearly there. So we’ve got a ball that bounces around, now it needs to change color, and we’ll leave it up to you and everything you’ve learned to figure that out.
  • Things you might want to take note of, when we drew the rectangle, we set the fill to (255, 50). In this case, the 255 applies to all RGB values, but there’s another value here that you haven’t seen before, it’s transparency. Something else you might have noticed is that for the rectangle (again) we used a command called noStroke(), what this does is it disables the stroke, which is the outline.
20 mins
Criteria for Completion
Outcome
  • As to give evidence of your learning, make a short screen recording where you show your code, and the bouncing ball in action, whilst you describe what you have learned.
Further Reading
Optional

If you think programming is for you, and want to understand more about working as a programmer and how programming fits into the wider world, you might want to read Paul Fords' essay What Is Code?. It is long, but great for those new to coding, as well as those with lots of coding experience.

There are no records to display.
Powered by Gibbon v27.0.00dev

Founded by Ross Parker at ICHK Secondary | Built by Ross Parker, Sandra Kuipers and the Gibbon community
Copyright © Gibbon Foundation 2010-2024 | Gibbon™ of Gibbon Education Ltd. (Hong Kong)
Created under the GNU GPL | Credits | Translators | Support