Top Banner
www.computerscienceuk.com Programming Computer Games Game Design
28

Www.computerscienceuk.com Programming Computer Games Game Design.

Dec 27, 2015

Download

Documents

Jeffrey Garrett
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Programming Computer Games

Game Design

Page 2: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Starter

Y-axis

X-axis-240 240

180

(0, 0)(x,y)

What is the position of the:

1) Star2) Square3) Triangle4) Rectangle5) Cat

-180

Page 3: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Learning Objectives

• Learning Objectives– Remember the coordinates system in Scratch.– Learn how to program a scrolling background.– Understand how Scrolling Backgrounds work.

• Success CriteriaLevel4/5– To code a scrolling background with support.– To briefly describe how the scrolling background code works.Level6/7– To code a scrolling background mostly from own knowledge.– To explain fully and in detail how the scrolling background code works.

Literacy – Key Words

Sprite A programmable object

Scrolling Background The illusion that the screen is panning / moving across the ground

Coordinates Two numbers to identify the position of an object

Page 4: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Learning Habits / Skills Required

• Independence - Working effectively alone

• Avoid Distractions - and sustain concentration

• Capitalising - Using resources purposefully

• Perseverance - Overcoming frustration and difficulty

• Reasoning – Thinking rigorously, methodically and giving explanations.

Page 5: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Hands up if you remember what the coordinates system

is in Scratch?

Page 6: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Starter

Y-axis

X-axis-240 240

180

(0, 0)(x,y)

What is the position of the:

1) Star (-240,180)2) Square (240, -180)3) Triangle (-240, 0)4) Rectangle (0, -180)5) Cat (0,0)

-180

Page 7: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Hands up if you remember what the coordinates system

is in Scratch?

Page 8: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Project Aim

• You will design and create a computer game…

…but unlike previously we will learn how to program a scrolling

background.…and here is one I made earlier!

Page 9: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Programming Scrolling Backgrounds

Page 10: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Hands up if you know how to program “Scrolling

Backgrounds”?

Page 11: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Scrolling Backgrounds…The Theory

Page 12: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

A scrolling background is simply two sprites which move to the left.They are positioned next to each other.

As soon as a sprite goes too far to the left, it is repositioned to the right of the screen.

This gives the illusion of a moving background!

Page 13: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Sprite 1 Sprite 2

Page 14: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

E.T.C!

Page 15: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Y-axis

X-axis

Remember the Invisible Coordinates Grid?

(0, 0)(x,y)

How can we move a sprite to the left along the x axis in scratch?

-240 240

180

-180

Page 16: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Which is going to help us move along the x axis?

Page 17: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Scrolling Backgrounds…Programming!

Page 18: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

1 2

3

4

5

+

6

Create a new sprite.

Zoom out as far as you can.Paint your

‘ground’ at the bottom of the canvas

So, now go back and edit the same sprite.

At this point scratch will annoyingly centre the sprite…

Choose the ‘Select Tool’ and ‘Zoom Out’ again.

Finally, drag the sprite down to the bottom of the canvas.

Page 19: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Now repeat the process to create the second sprite.

Page 20: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Place first sprite so that it is centred at the bottom of the screen.

Then forever move the sprite to the left (change x by -5).

But, if the position of the sprite goes too far to the left (x pos < -450), move back to the right of the screen (x=450)

Programming The Scrolling Background Sprites

Understanding the Scripts

Block

Page 21: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Place first sprite so that it is to the right of the screen.

Then forever move the sprite to the left (change x by -5).

But, if the position of the sprite goes too far to the left (x pos < -450), move back to the right of the screen (x=450)

Understanding the Scripts

Block

Programming The Scrolling Background Sprites

Page 22: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Hands up if you know how to program “Scrolling

Backgrounds”?

Page 23: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Demonstration

Page 24: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Programming Task 1

’12 Minutes’

Open a new scratch file

Use this presentation to program your own scrolling background

Page 25: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Programming Task 2

’12 Minutes’

Complete the worksheet explaining the code you have created and how the scrolling works.

Page 26: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Assessment CriteriaLevel Programming Skills

7• I can produce the code from my own understanding.• I can explain what the code does in detail and in my own

words.

6• I can produce the code mostly from my own understanding

but use the lesson resources for support.• I can explain what the code does in detail and in my own

words

5• I can use the resources to help me code the scrolling

background• I can describe what the code does in my own words

4• I can copy the code to produce the scrolling background• I struggle to describe how it works in my own words

Page 27: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Learning Habits / Skills Required

• Independence - Working effectively alone

• Avoid Distractions - and sustain concentration

• Capitalising - Using resources purposefully

• Perseverance - Overcoming frustration and difficulty

• Reasoning – Thinking rigorously, methodically and giving explanations.

Page 28: Www.computerscienceuk.com Programming Computer Games Game Design.

www.computerscienceuk.com

Programming Task 3

’12 Minutes’

Design / Paint a flying object which you will control in your game (we will program this next lesson)

Design / Paint the ‘stationary’ background to make your game look more interesting.