1 / 19

StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

Learn the basics of StarLogoTNG programming through a treasure hunt game. Explore movement commands and programming challenges.

rsheperd
Download Presentation

StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

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

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

  5. 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

  6. 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.

  7. 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?

  8. 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)

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

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

  11. 0 degrees 45 degrees 270 degrees 90 degrees 180 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?

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

  13. 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?

  14. 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.

  15. One more thing… • Every time you want to test out your program, click setuponce (turtles created and scattered) and then runonce (wait for green highlight around the run block). • Use the blue slider bar to speed up or slow down the program.

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

  17. Programming Tip Save often. Save now.

  18. 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?

  19. To get StarLogo TNG for your home computer Website: http://education.mit.edu/starlogo-tng/download Register, download, install

More Related