1 / 9

StarLogoTNG 101

StarLogoTNG 101 . Treasure Hunt Game Unit Lesson 8: Hatch. Today’s Agenda. Review Mini-lesson on new programming blocks Implement “shooting” or “throwing” game feature Wrap-up. Review. Program a keyboard control for the player to stamp a black patch when the key ‘b’ is pressed.

gezana
Download Presentation

StarLogoTNG 101

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 101 Treasure Hunt Game Unit Lesson 8: Hatch

  2. Today’s Agenda • Review • Mini-lesson on new programming blocks • Implement “shooting” or “throwing” game feature • Wrap-up

  3. Review • Program a keyboard control for the player to stamp a black patch when the key ‘b’ is pressed. • Program the enemy agents to get “stuck” to the black patch (can’t move) if they walk over a black patch. • Program the score to be reduced by 1 point if the player agent walks over a black patch.

  4. New block: Hatch • Hatch is found in the Logic drawer. • The plain hatch block creates a new agent (“child”) that is the same as the agent that hatches it (“parent”). • The hatch-do block does the same thing but also allows you to modify the new agent – for example, change its breed, change its size, put it in a certain location, etc. • What game features can you add to your treasure game using Hatch blocks? (hints: collision, keyboard command)

  5. New block: set breed • “Set breed” is found in the traits drawer. • It takes a “breed” argument, which can be found in the “My Blocks” drawers. • It sets the breed of an agent to a different breed.

  6. “Shoot” feature • A popular game feature is for your player agent to “shoot” or “throw” something – e.g., paintballs to paint another agent, bullets to kill an enemy, net to capture treasure. • What other “shooting” or “throwing” game features can you think of?

  7. Guided Programming • Open the current version of your “treasure game your initials.sltng” • Save next version • How can you implement “shooting” using what you’ve already learned plus Hatch and Set Breed? • What object (agent) do you want the player to shoot? • How should the shot agent behave after it’s been shot? • What do you want to happen when the shot agent collides with different agents in your game? • What key should trigger the shot?

  8. Programming Activity • Find another use for the Hatch block in your game – for example, if two moving enemies collide, they can “hatch” a new moving enemy. • Improve the real-world physics of shooting – for example, how can you make the shot agents die when they hit the edge of the terrain?

  9. Wrap Up • Describe your “shooting” feature. • 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?

More Related