Lab #10 Write Up

Name: Kelly Yokoi

Period: 7

Assignment: Lab #10

Lab Overview

Scratch Lab #10 focused on clones, modeling, and game design. For problem #1 we had to run a simulation and take data. For problem #2 we had to create a game based on a model.

My Solution Problem #1

I took the remix and added a list. In a forever loop I had the program add foxes to # of foxes list and add rabbits to # of bunnies list. This way it would record data every second.

Questions

  1. Question #1

    What data is attached to each clone? That is, what is changed on each clone that allows for the rabbits and foxes to appear/disappear?

    • Clones appear when they reach a certain volume. Rabbits dissappear if they touch a bunny. Foxes dissappear when their volume reaches 0.
  2. Question #2

    Are the simulation results the same each time? Why or why not?

    • The simulation results are not the same each time due to the random operators that affect the movement of the rabbits and foxes.
  3. Question #3

  4. Post three of the graphs you created (example below)

Problem #1

My Solution Problem #2

For problem #2 we had to recreate Gremlin game To do this I created 6 sprites. One of them acted as the gremlin and would follow the mouse-pointer but it's y was set at a certain number so it could only move side to side. If it touched the cheese puffs the size would change by -5. The cheese puffs would be hidden at first, but when they start as a clone they will show at One Punch Man and would change y by -5. If they hit the gremlin then they would change hits variable by one and delete. If it touches the edge then it would change the miss variable by one and delete.One Punch man would move to the left and right by 5 inbetween 2 sprites that acted as barriers. Every 1.5 seconds it would create a clone of the cheese puffs. The last sprite is the same image as the gremlin but it would only appear when gremlin 1 is hit. If the original gremlin made a clone it wouldn't be able to create a good bounce because it would be restricted by y that is set at a certain number. Gremlin 2 isn't restricted by that boundary so whenever the first gremlin is hit a clone of gremlin 2 is made that starts at the first gremlin and will move in a random direction then delete itself. The stage continuously checks if the misses variable equals 0. When it does it stops the game.

Problem #2

Click HERE to return to homepage.