Bryneven Football Activity in Purple Mash No: 2 (Gr 6-7)
We move with a swipe -directing a football around a screen. This assigns a function variable type (which could be strings or numbers). A collision event calls the function code. In this example we emphasize the position of defining a variable. The function variable is properly named as PositionBall – to provide some kind of understanding of what will happen. Naming our objects and code properly provides a more understandable system in which to work.
The collision event -takes place when the moving ball touches the border. This moment -when the two meet- calls the code that returns to the ball to its original position, on the X and Y axis. We looked up this position by taking the game into play mode. In play mode we expose the variable watch -which shows X and Y position.
We glance at the JavaScript for a moment -defining what is expressed. This javascript allows us to see how the script relates to the more familiar code blocks. Our soccer ball’s movement has a determineable speed and swipe angle.
When the ball touches against the boundary, it calls the code to re-place itself – returning to its original position, its starting point. These positions are X and Y are shown in the watch variable.
The importance of the sequence of coding blocks comes up; they must be appropriately sorted – as the computer will read the code blocks, starting from the top.
This lesson is especially true for those who play the thought: seeing themselves making games. I can see how certain elements can be used by mathematics and physical science teachers. I hope that my dear educator colleagues will investigate and explore -more of Purple Mash -to see into that. Thank you!
