starlogotng 101 treasure hunt game unit lesson 3: treasures and hazards

16
StarLogoTNG 101 Treasure Hunt Game Unit Lesson 3: Treasures and Hazards

Upload: robert-carpenter

Post on 16-Jan-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: StarLogoTNG 101 Treasure Hunt Game Unit Lesson 3: Treasures and Hazards

StarLogoTNG 101

Treasure Hunt Game UnitLesson 3: Treasures and Hazards

Page 2: StarLogoTNG 101 Treasure Hunt Game Unit Lesson 3: Treasures and Hazards

Today’s Agenda

• Review• Mini-lesson on breed editor and new

programming blocks• Modify first program• Wrap-up

Page 3: StarLogoTNG 101 Treasure Hunt Game Unit Lesson 3: Treasures and Hazards

Review

• How do you create a keyboard control to make the player move up when you press the letter ‘a’ key?

• Why are the following blocks not great for controlling the movement of an agent?

• What numbers for degrees would work better instead?

Page 4: StarLogoTNG 101 Treasure Hunt Game Unit Lesson 3: Treasures and Hazards

Treasures and Hazards

• What was the winning objective of the obstacle course?

• Brainstorm ideas for “treasures” or incentives in your game design.

• How did the various hazards or obstacles make the obstacles game interesting?

• Brainstorm ideas for hazards in your game design.

Page 5: StarLogoTNG 101 Treasure Hunt Game Unit Lesson 3: Treasures and Hazards

Modifying First Program

• File menu > Open project “first program mod.sltng”

• File menu > Save next version• About the modified first program

– Setup: clears everyone, creates turtles that are randomly scattered, creates “treasure” agents and other agents that are non-moving hazards

– Run (forever): turtles move forward 1 space continually, forever

– Collisions: between turtles and treasure/hazards.

Page 6: StarLogoTNG 101 Treasure Hunt Game Unit Lesson 3: Treasures and Hazards

Breed Editor

• Click “Edit Breeds” button near top of canvas to bring up the editor in a new window.

• Used to assign “shapes” and names to breeds.

• Breeds are used to create different types of agents.

• Each breed has its own set of programs and blocks (or block section).

• Exercise: Click “new” button and rename the newly created agent to “treasure” and select a new shape.

Page 7: StarLogoTNG 101 Treasure Hunt Game Unit Lesson 3: Treasures and Hazards

New Block: Setup

• Found in the “Setup and Run” drawer

• Used to set initial conditions of the game

• Example: what happens in first program when you click on setup?

• Brainstorm starting conditions for your treasure game

Page 8: StarLogoTNG 101 Treasure Hunt Game Unit Lesson 3: Treasures and Hazards

New Blocks: Clear

• Found in the “Setup and Run” drawer

• “Clear everyone” makes all agents disappear

• You can learn about the other clear blocks in your reference guide

• Look at the setup block in first program. Why is it important to include “clear everyone” in setup? What do you think will happen if you remove this block? Make a prediction and test it!

Page 9: StarLogoTNG 101 Treasure Hunt Game Unit Lesson 3: Treasures and Hazards

New Blocks: Create

• Create is used to create agents of a particular breed.

• Because it is specific to each breed, these blocks are found in the “My Blocks” palette.

• On the “My Blocks” palette, each drawer is named for a breed or a section of the canvas.

• Select the breed you want to create agents of, and look for the “Create breed name” block.

• This block takes a number argument that specifies how many agents you want to create.

• There is also a “Create breed name” that has two parts – the number of agents and a “do” section.

• The “do” section allows you to specify additional instructions, such as placement of the agent in spaceland and setting the camera angle.

Page 10: StarLogoTNG 101 Treasure Hunt Game Unit Lesson 3: Treasures and Hazards

New Block: Scatter

• Located on the “My Blocks” palette

• Found in each breed’s drawer

• Usually used after agents are created to place them randomly in spaceland

• There is also a “scatter everyone” block in the Setup drawer for scattering all agents that have been created, regardless of breed.

Page 11: StarLogoTNG 101 Treasure Hunt Game Unit Lesson 3: Treasures and Hazards

Guided Programming 1

• In the existing setup block, attach the appropriate blocks to create 10-20 treasure agents and scatter them.

• Test out your new setup by clicking setup in the runtime window.

Page 12: StarLogoTNG 101 Treasure Hunt Game Unit Lesson 3: Treasures and Hazards

New Block: Collision

• Found in each breed’s drawer in the “My Blocks” palette

• Used to determine what happens when one agents touches another agent

• What happened in second program when the player agent collided with a tree agent?

Page 13: StarLogoTNG 101 Treasure Hunt Game Unit Lesson 3: Treasures and Hazards

New Block: Die

• Found in the “Logic” drawer

• The agent that runs the block deletes itself (disappears completely from Spaceland).

• How do you think this block was used in the second program?

Page 14: StarLogoTNG 101 Treasure Hunt Game Unit Lesson 3: Treasures and Hazards

Guided Programming 2

• Drag a collision block that shows “treasure” and “turtles” onto the collisions section of the canvas

• Think: what do you want to happen when the turtle collides with the treasure?

• Explore different possible results for collision. Use blocks that you already know, such as set color*, set size, movement blocks, die, and set score.

*To see an agent’s color, you also need to use the block “model skin off” found in traits.

Page 15: StarLogoTNG 101 Treasure Hunt Game Unit Lesson 3: Treasures and Hazards

Programming Activity

• Create a new breed for Hazards• Add create and scatter hazards to setup.• Think: what do you want to happen

when the player collides with a hazard? • Explore different possible results for

collision (check out the reference guide for new blocks or explore new blocks on your own).

Page 16: StarLogoTNG 101 Treasure Hunt Game Unit Lesson 3: Treasures and Hazards

Wrap Up

• What collision results did you try?• What worked? What didn’t work?• What challenges did you have?• What was fun?• What questions do you have?• What new game ideas do you have?