Computer Science Jan 2011 Robot Game. Introduction to Robot Arcade game Collect all of the items...

Post on 15-Jan-2016

212 views 0 download

Transcript of Computer Science Jan 2011 Robot Game. Introduction to Robot Arcade game Collect all of the items...

Computer ScienceJan 2011

Robot Game

Introduction to RobotArcade game

Collect all of the items while avoiding the enemy (robot)

ObjectivesMore extensive planning and coding than

PongBuild an “intelligent” computer playerCreate, track and remove multiple itemsIntroduce game-play extensions

Core requirementsMovable player “sprite”

Wrap at edges of screenCreate ‘robot’ that follows the player

Robot wins if it catches the playerCreate 5-10 items that player must collect

Player wins when all items are collected

Demo starting code

Demo final version

Core requirements: playerMovable player “sprite” that wrap at

edges of screen1.What is the ‘player’ object in the Catch code?2.What directions does it move in (a) Catch

and (b) Robot?3.Where is screen width/height used (3 places

each)? Why might we want to replace these with a

variable expression?

4.What does ‘wrapping’ mean?How might we achieve this?

Core requirements: robotCreate ‘robot’ that follows the player5.Which object can be converted to the

robot?6.What determines the robot’s direction on

each step?7.Highlight code you don’t need in Robot.8.How can you tell if the robot catches the

player?9.What should the user see when this

happens?

Core requirements: itemsCreate 5-10 items that the player must collect

9.How and where do we create the items?10.What information do we need to store for

each item?11.How can we detect when an item is

collected?12.How do we prevent an item from being

collected twice?13.How do we track when all of the items have

been collected?

Coding RobotHand in your code analysis sheetsWrite the robot game, even if you haven’t

finished PongRequirements are listed on the ‘Robot game’

pagePlan how to address difficult requirements

If you complete it early:Advanced features are listed on the pageAdd your own features to the game

Grading rubric

Req Description Points

1 Player sprite must be able to move in four directions using the keyboard 5

2 The player sprite wraps at the edges of the screen 10

3 5-10 collectable items (coins) are created and placed onscreen 10

4 Items are removed once the player ‘collects’ them 10

5 A robot sprite follows the player around the screen 20

6 If the player collides with the robot, then the player loses (and the game ends) 5

7 If the player collects all the items, then the player wins (and the game ends) 10

8 Code legibility (meaningful variable names and code comments) 10

9 Code parsimony (no redundant or convoluted code) 10

10 Completed on time 10

Total 100

Extension rubricReq Description Points

1 Teleport 5

2 Warping 10

3 Special Freeze Item 10

4 Multiple rounds with variable difficulty 10