Unit 3 - University of Nottingham

advertisement

Introduction to Programming

G50PRO

University of Nottingham

Unit 3 : Introduction To Scratch 2

Paul Tennent http://paultennent.wordpress.com/G50PRO.html

paul.tennent@nottingham.ac.uk

Room C41

Agenda

 Common programming elements

 Pseudo Code

 Scratch Example

 Scratch Demo

 Course work

Common programming elements:

 Variables

 Conditional statements

 Loops

 Events

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

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

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

Who is responsible for what?

 Structure your programs

 Think – which sprites should be responsible for what actions?

 Think – Where should your variables be defined

Example – Shooting Game

Bullet

Add to user ’ s score?

-Disappear

Alien

-Destruction effect

COLLISION!

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

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

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

Software Demonstration

 Wednesday 18 th February

 Make sure The game is usable online (clear instructions)

 How does it look, feel?

Download