starlogotng treasure hunt game unit lesson 1: basic movement

19
StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

Upload: ami-day

Post on 23-Dec-2015

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

StarLogoTNG

Treasure Hunt Game UnitLesson 1: Basic Movement

Page 2: StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

Today’s Agenda

• Starlogo TNG basics• Mini-lesson on programming movement

• First programming challenge• Wrap-up

Page 3: StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

What’s What in SLTNG

• Programming Window– Palette of “blocks”– Canvas

• Spaceland

• Runtime Window

Page 4: StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

Definition of “Agent”

• Like a character or object in a game

• Can be programmed to have behaviors

• Can have more than 1

Page 5: StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

First Programming “Blocks”

• Give an agent behavior instructions by dragging blocks from the palette onto the canvas

• Many blocks take arguments

• An agents “executes” an instruction when the agent does what the instruction says

Arguments

Page 6: StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

Your First Program

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

• File menu > Save next version• In runtime window, click once on “set up” and then “run” to start the program. The program will end after 60 seconds. Repeat to run the program again.

• Practice: run the game a few times, move around in spaceland and try different camera angles using the Guide to Spaceland activity sheets.

Page 7: StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

About First Program

• What did you notice about how first program works?– How did the score change? What do you think the score is based on?

– How did the turtle agents behave? What happened when they reached the edge of Spaceland?

Page 8: StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

How Score is Calculated

• The score is the running added total of the height of each patch that a turtle is standing on.

• Green patches = 0 (no effect on score)

• Blue patches = negative (varies)

• Red patches = positive (fixed)

• Yellow patches = positive (varies)

Page 9: StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

Programming Activity

• Get the highest score possible by programming additional movement instructions when the turtles detect that they’re on a particular color patch

Page 10: StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

Movement Blocks

Found in Movement drawer:

• Forward steps• Back steps• Left degrees• Right degrees

Dragged onto canvas

Page 11: StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

Quick geometry review!

• How many degrees are there in a circle?

• Degrees for turning left or right are relative to the direction the turtle is currently facing – for example, the labels in the diagram on the right shows the degrees for turning right.

• What should be the degree labels if we’re turning left?

0 degrees

90 degrees

180 degrees

270 degrees

45 degrees

Page 12: StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

About First Program

Setup:Create and scatter 20 turtles

Run: All turtles move 1 step forward

Run: Your instructions

Run: Calculate score

Time=60 sec? End

No

Yes

Page 13: StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

Programming Activity 1

• Get the highest score possible by programming additional movement instructions when the turtles detect that they’re on a particular color patch

• For example, how should the turtle behave if it detects that it’s standing on a blue patch?

Page 14: StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

Programming Activity

• Try out different commands and sequences; see what happens to the score each time. There are many ways to achieve a high score. Try to use as few blocks as possible.

Page 15: StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

One more thing…

• Every time you want to test out your program, click setup once (turtles created and scattered) and then run once (wait for green highlight around the run block).

• Use the blue slider bar to speed up or slow down the program.

Page 16: StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

Programming Tip

To delete a block, drag it to the

trash can in the corner of the

canvas

Page 17: StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

Programming Tip

Save often.Save now.

Page 18: StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

Wrap Up

• What strategies did you try?• What worked? What didn’t work?• What challenges did you have?• What was fun?• What questions do you have?

Page 19: StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

To get StarLogo TNG for your home computer

Website: http://education.mit.edu/starlogo-

tng/downloadRegister, download, install