Creating your own Handheld Games Console

Slides:



Advertisements
Similar presentations
Create a Simple Game in Scratch
Advertisements

Clicking on the link for the.tns file gives you will get the following screen: Select Save File and click OK.
In this tutorial, we are going to create: A race car that the user can control with the arrow keys for direction and speed. A simulated road with a striped.
Pong! “The oldest commercially available game in history” Resources created from the video tutorials provided by David Phillips on
Bug Session One. Session description In this session, pupils are introduced to a programming sequence which will make a light pattern on their Bug. Objectives.
BLP Building Learning Power. The Four Rs Resourcefulness Reflectiveness Resilience Reciprocity.
Microsoft® Small Basic Advanced Games Estimated time to complete this lesson: 1 hour.
Level 3 Extended Diploma Unit 22 Developing Computer Games
Code Club Session 3 Shark Eats Fish. Picture of finished product here.
Conversational Computers
Bug Session Two. Session description In this session the use of algorithms is reinforced to help pupils plan out what they will need to program on their.
HTML, Formatting Text and Images Lesson 2.
LO: Learn how to develop your game further to include interactions with the device.
Fell View Computer Club StarLogo TNG – Session Two.
Bug Session One. Session description In this session, pupils are introduced to a programming sequence which will make a light pattern on their Bug. Objectives.
Lab 8 – C# Programming Adding two numbers CSCI 6303 – Principles of I.T. Dr. Abraham Fall 2012.
Game Design Creating a game called PING Phase 3: Steps for building basic game.
Programming Computer Games Game Design.
Introduction to TouchDevelop
Code Club Session 2 Dance Party. What will we learn ?  How to change the background  How to create animations  How to make objects talk to each other.
Introduction to Scratch!
Alan Turing and Code Breaking
Student Support Services Laptop Workshop. What will you Find The actual Computer The Power Cord (Comes in two parts.)
Activity 1 5 minutes to discuss and feedback on the following:
Alice Pong Recreating Pong in Alice By Elizabeth Liang under the direction of Professor Susan Rodger Duke University June 2010.
Activity 1 Input Device Output Device CPU RAM Hard Drive (Hard Disk)
Learning the skills for programming Advanced Visual Programming.
Flii Programming Workshop Marissa Milne Science Communication Officer.
Go to your school’s web locker site Your user name is the first letter of your first name, the first four letters of.
Making Python Pretty!. How to Use This Presentation… Download a copy of this presentation to your ‘Computing’ folder. Follow the code examples, and put.
As you look at an iMac you will notice that there are no buttons on the front of the machine as shown in figure 1.
Geometry. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions are.
Creating a Simple Game in Scratch Barb Ericson Georgia Tech June 2008.
BBC Microbit Getting set up and making your first program.
Create a Halloween Computer Game in Scratch Stephanie Smullen and Dawn Ellis Barb Ericson October 2008.
Computer Programming Modeling a Passive Solar Home.
1 Project designed and created by M. Shajith Kumar.
JDS5 Training Guide. On Start Up you will see this screen click the OK button Click OK.
Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl.
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
Computer Basics Lesson 1 – TURNING ON AND PLUGGING IN.
Programming a Shooter Game Design.
GAME:IT Paddle Ball Objectives: Review skills from Introduction Create a background Add simple object control (up and down) Add how to create a simple.
ICT/COMPUTING RULES Only use software allowed by the teacher
Creating a Simple Game in Scratch Barb Ericson Georgia Tech May 2009.
Introducing Scratch Learning resources for the implementation of the scenario
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
BGE Music Technology Creating a Soundscape
Scratch Helicopter Game
Movement Game Design (Scratch).
micro:bit for primary schools – mb4ps.co.uk
Learning Muscles.
Starter Activity Instructions: Complete the starter sheet Planner
BBC Microbit.
BBC Microbit.
micro:bit for primary schools – mb4ps.co.uk
BBC Microbit.
Objective of the lesson
BBC Microbit.
Objective of the lesson
Getting Started with Physical Computing
Thinking Ahead
Computational Thinking
OOP Python Inheritance
OOP Python Instantiation & Understanding Self
Thinking Abstractly
Creating a Simple Game in Scratch
Lesson Nine Variables.
Building Learning Power
Presentation transcript:

Creating your own Handheld Games Console Coding the Micro:Bit Creating your own Handheld Games Console

Learning Habits Which learning habits will be important for this unit of work and why? Noticing details Adapting : Reflecting and making changes Reasoning: Thinking rigorously, methodically and giving explanations. Empathising… …with feelings and views Effective use of time Questioning: Asking questions to get below the surface Listening… …to understand Imagining… …how things could be and seeing a range of possibilities Distilling… …what you have learnt and what you need to learn Collaboration: Working effectively with others Meta Learning: Talking about how you have been learning Imitation: Picking up good habits from others Independence: Working effectively alone Managing distractions… …and sustaining concentration Capitalising: Using resources purposefully Making links… …and recognising relevance Perseverance: Overcoming frustration and difficulty Planning… …your learning in advance

Lesson Objectives Lesson Objectives To develop our skills in programming using the blocks language To understand the purpose of variables To develop understanding of coordinates and see how they are used in developing graphical programs. Success Criteria ALL: To develop a simple pong game turning the device into a handheld console. MOST/SOME: To be able to develop the code to solve a number of challenges. Literacy – Key Words Variables A memory store in a program (think of it as a box which stores a piece of data) Coordinates A system which enables us to locate the position of an object using a horizontal (x) and vertical (y) . For example a pixel on a screen

Lets Create Pong! To create a Pong we need to understand a few things. 1. Coordinates Whenever we create computer games, we will need to draw items on the screen and update their position over time. The position of screen objects is always described with screen coordinates and the Micro:Bit is no exception. The LEDs on the Micro:Bit can be thought of as screen pixels and each LED can be described using an X and Y coordinate. X-Coordinates Y-Coordinates This LED has the coordinate (3, 2)

Lets Create Pong! 2. X-Velocity / Y-Velocity So we should now be OK with the idea of X and X positions of the LED’s on the Micro:Bit. The next thing to understand is that when we wish to update the position of a screen object (lit up LED), we do so using X and Y velocities. This is not as scary as it sounds. It simply stands for a number which we use to add to an item’s coordinate so that it can be repositioned on the screen and therefore appear to be moving. For example, if the LED (3,2) had an X-Velocity of 1, it would move to the right 1 place each time the screen was updated. X-Coordinates Y-Coordinates This LED has the coordinate (3, 2)

Lets Create Pong! 3. Variables So that we can keep track of the item’s coordinates and other data, variables are required. Variables are simply stores of data (think of them like boxes to store a stuff in). To create a variable and store data in them, we will need to use the following scripts: This allows us to create new variables and give them names This allows us to set our variables to particular values (ie store data in the variable)

Step 1 - Coding Pong Go to www.microbit.co.uk/create-code Click on ‘New Project’ Create the following script: This scripts will create the start screen, plotting the ball and paddle to start the game. Create 5 variables Set each variable to the values you see in the example script. Use a ‘Show LEDs’ script and tick the bottom row. Plot the ball using the ball’s x and y coordinates. Plot the Paddle using the paddle’s y coordinate (hardcode the x coordinate to 0)

Step 1 - Coding Pong Next, create the following scripts: These scripts move the paddle up and down when the appropriate button is pressed. Create a ‘when the A/B button is pressed’ script Un-plot the paddle from the screen If the paddle is not already at the top / bottom of the screen, change its y position so that it moves up /down Otherwise, redraw the paddle in the same positon as before (ie. no movement).

Step 1 - Coding Pong Finally, create the following script: This script moves the ball around the screen, bouncing off walls and the paddle, or shows an X if the paddle misses the ball. In a forever script, begin by un-plotting the ball Then, in an IF statement, code the condition that if the ball is at the right hand side of the screen, change the x-velocity so that it moves left (bounces back) – otherwise let the ball continue to move left. Then in another IF statement, code the condition that if the ball is at the left side of the screen and level with the paddle, change the x-velocity so that it bounces off the paddle, otherwise clear the screen and show a cross (ie. game over). Then in a final IF statement, code the condition that if the ball is at the top or bottom of the screen, change the y-velocity so that it bounces back into play. Finally, update the position of the ball with the updated velocities and re-plot the ball. Pause for a short while and repeat.

Step 2 – Compiling and Flashing If its working it is time to COMPILE and FLASH. Press the COMPILE button. Once the HEX file has downloaded, go into your documents and find it. Now plug in your device to an available USB port. Open the device up as if it were a USB memory stick. Now drag the HEX file into the opened device folder (as if you were transferring files to a memory stick). Now the FLASHING will be complete and you can try out your software on your Micro:Bit.

Your Working Handheld Games’pong’sole

Class Tasks Challenge 1 Speed up the game so that the ball moves faster. Challenge 2 Add a variable called score and add a script so that each time the paddle and ball meet, the score variable is updated by 1 and this score is shown at the end of the game. Challenge 3 Add a script which will pause the game when both the A and B buttons are pressed.

Class Tasks – Possible Solutions Challenge 1 Challenge 2 Challenge 3 + + +