Star Logo TNG Treasure Hunt Game Unit Lesson

  • Slides: 19
Download presentation
Star. Logo. TNG Treasure Hunt Game Unit Lesson 1: Basic Movement

Star. Logo. TNG Treasure Hunt Game Unit Lesson 1: Basic Movement

Today’s Agenda • • Starlogo TNG basics Mini-lesson on programming movement First programming challenge

Today’s Agenda • • Starlogo TNG basics Mini-lesson on programming movement First programming challenge Wrap-up

What’s What in SLTNG • Programming Window – Palette of drawers of “blocks” –

What’s What in SLTNG • Programming Window – Palette of drawers of “blocks” – Canvas • Spaceland • Runtime Window

Definition of “Agent” • Like a character or object in a game • Can

Definition of “Agent” • Like a character or object in a game • Can be programmed to have behaviors • Can have more than 1

First Programming “Blocks” • Give an agent behavior instructions by dragging blocks from the

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

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

Your First Program • File menu > Open project “first program. sltng” • File menu > Save project as “first program your initials. sltng” • 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 try different camera angles using the How to Navigate in Spaceland activity sheets.

About First Program • What did you notice about how first program works? –

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?

How Score is Calculated • The score is the running added total of the

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)

Programming Activity • Get the highest score possible by programming additional movement instructions when

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

Movement Blocks Found in Movement drawer: • Forward steps • Back steps • Left

Movement Blocks Found in Movement drawer: • Forward steps • Back steps • Left degrees • Right degrees Dragged onto canvas

Quick geometry review! • How many degrees are there in a circle? • Degrees

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 45 degrees 270 degrees 90 degrees 180 degrees

About First Program Setup: Create and scatter 20 turtles Time=60 sec? Yes No Run:

About First Program Setup: Create and scatter 20 turtles Time=60 sec? Yes No Run: All turtles move 1 step forward Run: Your instructions Run: Calculate score End

Programming Activity 1 • Get the highest score possible by programming additional movement instructions

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?

Programming Activity • Try out different commands and sequences; see what happens to the

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.

One more thing… • Every time you want to test out your program, click

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.

Programming Tip To delete a block, drag it to the trash can in the

Programming Tip To delete a block, drag it to the trash can in the corner of the canvas

Programming Tip Save often. Save now.

Programming Tip Save often. Save now.

Wrap Up • • • What What strategies did you try? worked? What didn’t

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

To get Star. Logo TNG for your home computer Website: http: //education. mit. edu/starlogo-tng/download

To get Star. Logo TNG for your home computer Website: http: //education. mit. edu/starlogo-tng/download First ask your parent or guardian for permission Register, download, install