Creating “PacMan” With AgentCubes Online



Yüklə 253,32 Kb.
səhifə3/3
tarix14.10.2017
ölçüsü253,32 Kb.
#4760
1   2   3

Student Handout:

Troubleshooting Guide for PacMan Part III


Common Problems:

  1. Is your Controller agent saved on the world?

  2. Did you type in @pellets whenever the simulation property was checked or changed?

  3. Do you refer to the correct agents in each step?


Polling and Broadcast
Another Approach to Troubleshooting:

Make a quick check on how many Pellets are in the World:

Click on the gear button on the upper right side of the AgentCubes Online window and select “Show simulation Properties”. This window will appear:




The correct number of Pellets will not appear in this window until you have single-stepped (click on the black triangle next to the stop and go buttons) or briefly run the game. If your programming is correct, the value of Pellets will decrease by 1 each time PacMan eats (erases) a Pellet. When the value of Pellets is equal to 0, PacMan should win the game.

More detailed troubleshooting:

To determine what is happening in your game, it is helpful to look at how the simulation property changes over time. Add the plot to window action to the rule in the Controller’s while running method. Fill it out as it appears below:


In the plot to window action, you must name the simulation property to be plotted (Pellets), name the window where it will appear (Pellets Plot), say what it represents (number of pellets) and pick the color of the line that will appear on the graph.



Note that you must put “@” before the Pellets in the plot to window box because you are checking the value of the simulation property Pellets!



The Pellets Plot window will appear as soon as the run button is clicked. Move the Pellets Plot window somewhere where you can watch it while you run the game. In this window, you will see a graph that shows you what’s happening ‘behind the scenes’ while you play the game.

This information will help you determine where a mistake may be. For example, if the number of pellets never goes above 0, there is a problem with the method Count or the broadcast. If the number of pellets goes to zero but the game doesn’t end, there is a problem with the game ending rule in the Controller.



End of Unit Review Sheet - PacMan

  1. The main computational thinking patterns we reviewed were:

    1. User Control: intentionally moving an agent.

      1. Using keyboard keys to move an agent.

      2. Example is moving the PacMan.




    1. Absorb: deleting agents on the screen.

      1. Use the “Erase” action in AgentCubes Online.

      2. Examples are erasing the pellets.




    1. Collision: when 2 agents collide (run into each other).

      1. Use the “See” condition

      2. Use the “Stacked” condition, OR

      3. Use the “Next to” condition.

      4. Examples are the eating pellets and losing the game when the ghosts touch the PacMan.




  1. The main NEW computational thinking patterns we learned were:

    1. Diffusion: spreading the scent (smell) of an agent across a medium (like the background). We use an agent attribute (S for smell) on the agent which should be chased, and we diffuse the smell by setting the attribute on the background using the average of the 4 smells around it,

S = .25 * (S[left]+S[right]+S[up]+S[down])

    1. Hill Climbing: following the highest value of the scent S. It only works if there is diffusion done with it, so they go hand in hand. Example is the method we created in the Ghost to move towards the agent next to him with the highest value of the scent “S”.

    2. Broadcasting: is when we “shout out” to all agents of a certain type requesting them to execute a specific method.

      1. Use the “broadcast” action in AgentCubes Online.

      2. Example is the broadcast by the Controller of the method “Count” to the pellets so they will count themselves.

  1. Other concepts we covered in AgentCubes Online are:

    1. Troubleshooting the simulation, and considering rule order.

    2. Using sounds and messages in the game.

    3. Timing our actions using the “Once every” condition.



Change Directions

Make the PacMan face the direction he’s heading

Student Handout 4a:

PacMan Changes Direction

Challenge

Before your start this challenge:

You must have a complete basic PacMan game with a PacMan who wins if he eats all the pellets and Ghosts who either move randomly or chase the PacMan. The PacMan loses if a Ghost gets too close. The world should have walls that the Ghost and PacMan cannot cross.

Description of the Challenge:

PacMan will turn in the direction he’s heading.


What to consider:

Do you need a new agent?

Do you need a new rule?
You might be thinking you need new agents…BUT WAIT! Since each PacMan will follow the same rules, you don’t need a new agent, but rather 3 new shapes!
Steps:


  • Select PacMan by clicking on him, then click on the +Shape button and give this shape a name.

  • Double click on the picture next to the new name and the drawing panel will appear.

  • Clear the picture and draw PacMan facing a different direction.

  • Once you have the four different shapes, change your move rules so that PacMan faces the direction that he is moving.

  • Use the change action with a dot in the middle because the means “change me to” so the agent is able to change its shape.

  • TEST your program to confirm that the PacMan’s shape changes when he changes directions as he moves.




Student Handout 4b:

Move Continuously

Make the PacMan move until the end of the row of pellets

PacMan Moves Continuously

Challenge

Before your start this challenge:http://i559.photobucket.com/albums/ss35/bluepenguino/wallpapers/pacman.jpg

You must have a complete basic PacMan game with a PacMan who wins if he eats all the pellets and Ghosts who either move randomly or chase the PacMan. The PacMan loses if a Ghost gets too close. The world should have walls that the Ghost and PacMan cannot cross.

You must have 4 different shapes for the PacMan so that he faces the direction he heads.

Description of the Challenge:

PacMan will continuously move in the direction he’s heading.


This challenge gets you started, but won’t give you all the code. Review the code below: It says, when the right arrow is pressed AND I do not see a wall to the right, change to the right-facing depiction. Once every 0.2 second, make me (the PacMan) do “move continuously”.
When the move continuously method is called, the PacMan does the following:

If I see myself heading right AND I do not see a wall in the right direction, I will move right.


The effect of the rule in move continuously is to make PacMan keep moving whichever way he is facing as long as there are no walls in the way.


There is still much to code:


Step 1:

Create code for all the other directions.


Step 2:

Test your program. (Hint: be sure your PacMan still leaves his scent everywhere.)

Click on the PacMan with the big arrow tool to select him and run the program.
Use the colors to decide which rules are true or false. In this case, the first rule is red, which means the Right arrow was not pressed or a wall was in the way.
The next rule is green, which means every 0.2 seconds, the PacMan is being told to do MoveDirection.
The method MoveDirection is green, which means that either or both conditions are true. The PacMan does sees his right-facing shape AND does not see a wall, making the rule TRUE, so PacMan will move one step to the right.

Student Handout 4c:

Power Pellets

Make a Power Pellet that allows the PacMan to eat the ghosts.

Power Pellet

Challengehttp://2shotsofgeek.com/wp-content/uploads/2014/04/pacmanpowerpellet.jpg

Before your start this challenge:

You must have a complete basic PacMan game with a PacMan who wins if he eats all the pellets and Ghosts who either move randomly or chase the PacMan. The PacMan loses if a Ghost gets too close. The world should have walls that the Ghost and PacMan cannot cross.



You must have different depictions of the PacMan so that he faces the direction he heads, and he must move continuously.

Description of the Challenge:

  • Power Pellets are added to the world.

  • Power Pellets provide PacMan with the temporary ability to eat the enemies. The enemies turn deep blue, and reverse direction.

This challenge gets you started, but won’t give you all the code.


To help you think this through…


  • You will need a new agent (Power Pellet)




  • Do you need a new agent or a new shape for the blue ghost?




  • When the ghost chases the PacMan, PacMan has a scent of 1000. What happens if he has a scent of -1000? How can you set that new scent?




  • How can you limit the time that PacMan’s scent is -1000? Could you create a timer agent that starts counting when it receives a message from PacMan that he ate a Power Pellet? The timer agent should send a message back to PacMan when it is done counting and it’s time for PacMan’s scent to return to 1000.




  • Hint: Use the hill climbing action rather than all the code for sniffing.

Student Handout 4d:

Next Level

Make a second level for your PacMan!

Next Level


Next Level!

Challenge

Before your start this challenge:

You must have a complete basic PacMan game with a PacMan who wins if he eats all the pellets and Ghosts who either move randomly or chase the PacMan. The PacMan loses if a Ghost gets too close. The world should have walls that the Ghost and PacMan cannot cross.

You must have different depictions of the PacMan so that he faces the direction he heads, and he must move continuously.

Description of the Challenge:

  • When the game ends, a new level appears, even harder than before!

This challenge gets you started, but won’t give you all the code.


To help you think this through…


  • Do you need a new agent? A new world?

  • When would a new level appear?

  • What code needs to change to make the new level appear?

You might have a rule like this:




How could you use this condition

and this action to let the player move from a world named “Level 1” to a world named “Level 2”?
Very Important Note: Add another rule that stops the simulation if the player has won Level 2 so the game ends!


ISTE Standards5 specific to the implementation of PacMan (Denoted with ())

Creativity and Innovation




Students demonstrate creative thinking, construct knowledge, and develop innovative products and processes using technology. Students:







Apply existing knowledge to generate new ideas, products, or processes:












Design and develop games













Design and develop computational science models







Create original works as a means of personal or group expression.












Design original games













Model your local environment, e.g., ecology, economy







Use models and simulations to explore complete systems and issues.













Model scientific phenomena, e.g., predator / prey models













Create visualizations







Identify trends and forecast possibilities.













Build predictive computational science models, e.g., how the pine beetle destroys the Colorado pine forest













Build live feeds to scientific web pages (e.g., weather information), process and visualize changing information

Communication and Collaboration




Students use digital media and environments to communicate and work collaboratively, including at a distance, to support individual learning and contribute to the learning of others. Students:







Interact, collaborate, and publish with peers, experts, or others employing a variety of digital environments and media:












Students work in teams to build and publish their simulations as web pages containing java applets.







Communicate information and ideas effectively to multiple audiences using a variety of media and formats.













Effectively combine interactive simulations, text, images in web pages







Develop cultural understanding and global awareness by engaging with learners of other cultures.












Students and teachers from the four culturally diverse regions interact with each other







Contribute to project teams to produce original works or solve problems.












Define project roles and work collaboratively to produce games and simulations

Research and Information Fluency




Students apply digital tools to gather, evaluate, and use information. Students:







Plan strategies to guide inquiry.













Explore web sites and identify interesting connections







Locate, organize, analyze, evaluate, synthesize, and ethically use information from a variety of sources and media.













Find relevant related web-based information, compute derivate information







Evaluate and select information sources and digital tools based on the appropriateness to specific tasks.













Understand validity of information, e.g. Scientific journal information vs. Personal blogs







Process data and report results.













Write programs to access numerical information, define functions to process data and create output based on voice or plotting to represent data.

Critical Thinking, Problem Solving, and Decision Making




Students use critical thinking skills to plan and conduct research, manage projects, solve problems, and make informed decisions using appropriate digital tools and resources. Students:







Identify and define authentic problems and significant questions for investigation.













Define research questions and explore approach of exploration







Plan and manage activities to develop a solution or complete a project.












Outline sequence of exploratory steps












Experience complete bottom-up and top-down design processes












Employ algorithmic thinking for creating programs to solve problems







Collect and analyze data to identify solutions and/or make informed decisions.













Collect data as time series, e.g., collect group size of predator and prey, export time series to excel, explore various types of graph representations, e.g., x(t), y(t) or scatter y=f(x)







Use multiple processes and diverse perspectives to explore alternative solutions.












Experience and understand design trade-offs, e.g. Bottom-up vs. Top-down

Digital Citizenship







Students understand human, cultural, and societal issues related to technology and practice legal and ethical behavior. Students:







Advocate and practice safe, legal, and responsible use of information and technology.












Learn how to use tools to locate resources, e.g., images with Google image search, but understand copyright issues







Exhibit a positive attitude toward using technology that supports collaboration, learning, and productivity.












Stay in the flow, where design challenges match design skills












Experience success through scaffolded game design activities












Mentor other students







Demonstrate personal responsibility for lifelong learning.












Explore options of going beyond expected learning goals







Exhibit leadership for digital citizenship.












In a collaborative setting become a responsible producer of content for diverse audiences

Technology Operations and Concepts




Students demonstrate a sound understanding of technology concepts, systems, and operations. Students:







Understand and use technology systems.












Know how to organize files and folders, launch and use applications on various platforms







Select and use applications effectively and productively.












Know how to orchestrate a set of applications to achieve goals, e.g., make game and simulations using Photoshop (art), AgentCubes Online (programming), and Excel (data analysis).







Troubleshoot systems and applications.












Debug games and simulations that are not working







Transfer current knowledge to learning of new technologies.












Reflect on fundamental skills at conceptual level. Explore different tools to achieve similar objectives.




1 This information is supported by research found in the following documents:

Basawapatna, A. R., Koh, K. H., & Repenning, A. (2010, June). Using scalable game design to teach computer science from middle school to graduate school. In Proceedings of the fifteenth annual conference on Innovation and technology in computer science education (pp. 224-228). ACM.

Google. (2014). Women Who Choose Computer Science — What Really Matters The Critical Role and

Exposure. Retrieved from https://www.google.com/edu/resources/computerscience/research/


National Research Council. (2011). Learning science through computer games and simulations. (M. Hilton & M. Honey, Eds.). Washington, DC: The National Academies Press.

National Research Council. (2014). STEM Integration in K-12 Education:: Status, Prospects, and an Agenda for Research. (M. Honey, G. Pearson, & H. Schweingruber, Eds.). Washington, DC: The National Academies Press.

Repenning, A., & Ioannidou, A. (2008, March). Broadening participation through scalable game design. In ACM SIGCSE Bulletin (Vol. 40, No. 1, pp. 305-309). ACM.

Taylor, H. G., & Mounfield, L. C. (1994). Exploration of the Relationship between Prior Computing



Experience and Gender on Success in College Computer Science. Journal of Educational Computing Research, 11(4), 291–306.


2 http://sgd.cs.colorado.edu/wiki/Scalable_Game_Design_wiki

3 From http://en.wikipedia/org/wiki/Pac-Man

4 Available on the Scalable Game Design Wiki. Use Quick Links>>Teacher>>Lesson Plans

5 ISTE Standards for Students (ISTE Standards•S) are the “standards for evaluating the skills and knowledge students need to learn effectively and live productively in an increasingly global and digital world.” http://www.iste.org/standards/standards-for-students

PacMan Curriculum v2.0 Page of Scalable Game Design

Yüklə 253,32 Kb.

Dostları ilə paylaş:
1   2   3




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə