12
Introduction to Programming G50PRO University of Nottingham Unit 3 : Introduction To Scratch 2 Paul Tennent http://paultennent.wordpress.com/G50PRO. html p aul.tennent @nottingham.ac.uk Room C41

Introduction to Programming G50PRO University of Nottingham Unit 3 : Introduction To Scratch 2 Paul Tennent

Embed Size (px)

Citation preview

Page 1: Introduction to Programming G50PRO University of Nottingham Unit 3 : Introduction To Scratch 2 Paul Tennent

Introduction to Programming G50PRO

University of NottinghamUnit 3 : Introduction To Scratch 2

Paul Tennenthttp://paultennent.wordpress.com/G50PRO.html

[email protected]

Room C41

Page 2: Introduction to Programming G50PRO University of Nottingham Unit 3 : Introduction To Scratch 2 Paul Tennent

Agenda

Common programming elements Pseudo Code Scratch Example Scratch Demo Course work

Page 3: Introduction to Programming G50PRO University of Nottingham Unit 3 : Introduction To Scratch 2 Paul Tennent

Common programming elements:

VariablesConditional statementsLoopsEvents

Page 4: Introduction to Programming G50PRO University of Nottingham Unit 3 : Introduction To Scratch 2 Paul Tennent

PseudoCode

PseudoCode is a compact and informal high-level description of a computer program

Uses the structural conventions of a programming language

Intended for human reading rather than machine reading

Compact and easier to understand fo humans

Language-independent

Page 5: Introduction to Programming G50PRO University of Nottingham Unit 3 : Introduction To Scratch 2 Paul Tennent

Example

Cat Sprite() Loop Forever

If (user hits right) Point right

If (user hits left) Point Left

If (user hits up) Point Up

If (user hits down) Point Down

Move slowly

Page 6: Introduction to Programming G50PRO University of Nottingham Unit 3 : Introduction To Scratch 2 Paul Tennent

Try PseudoCode

Write PseudoCode to: Move a car using up arrow to increase speed and

down arrow to brake. Right and left arrows for directions.

If a wall is hit the car explodes and the car losses 1 life out of 3

Game is over if the car explodes 3 times

Page 7: Introduction to Programming G50PRO University of Nottingham Unit 3 : Introduction To Scratch 2 Paul Tennent

Who is responsible for what?

Structure your programs

Think – which sprites should be responsible for what actions?

Think – Where should your variables be defined

Page 8: Introduction to Programming G50PRO University of Nottingham Unit 3 : Introduction To Scratch 2 Paul Tennent

Example – Shooting Game

COLLISION!

Alien

-Destruction effect

Bullet

-Disappear

Add to user’s score?

Page 9: Introduction to Programming G50PRO University of Nottingham Unit 3 : Introduction To Scratch 2 Paul Tennent

Coursework

2 player car race online game The game should offer a choice of multiple

tracks. When a player reaches the finish line the

winner should be announced plus the time taken and a score.

Read the specifications on course web page

Page 10: Introduction to Programming G50PRO University of Nottingham Unit 3 : Introduction To Scratch 2 Paul Tennent

Coursework

Check Similar projects online first It is ok to reuse bits of code/ideas from other

projects. Yet DO NOT copy a project and modify it.

Make sure to include in the Report references to other projects you used in your work on

Use Project notes to include simple user Instructions

Page 11: Introduction to Programming G50PRO University of Nottingham Unit 3 : Introduction To Scratch 2 Paul Tennent

Quick Review

Create the software Design Implement Test

Write the documentation Leave plenty of time to write the report Proof read for obvious mistakes Think about the structure of your writing

Page 12: Introduction to Programming G50PRO University of Nottingham Unit 3 : Introduction To Scratch 2 Paul Tennent

Software Demonstration

Wednesday 18th February

Make sure The game is usable online (clear

instructions)

How does it look, feel?