Tuesday, April 21, 2020

Coding Day 6 - Flappy Square Stage 2

Today posed challenge but it wasn't impossible like the City Scape felt like.
It feels like I'm getting a lot more out of this, it's most likely because of the small restart because it's teaching us everything over again, giving you a chance to better understand
1. The first section explains to us to make a new function to make the rectangle obstacles easier to be placed because we'll be needed lots of them through-out the game
2. because we are making a boundary, and everything has to fit, we need to do math to place everything, but this teaches us to move our XY value origin point from the top left to the edge of the border, making placing easier
3. when using the "context.restore" code, it keeps the code without resetting it, but if you don't use "context.restore", it will make certain lines of code alter, for example. shifting the size of our Flappy square.
4. this introduces us to the animation part of the code, where as you can see in the photo, simply copies the flappy square lower and lower to show what falling would look like
5. This code will delete the square prior to the newest addition, making it look like a choppy animation of a falling square
6. This teaches us to simulate gravity. using "Var gravity" and "Var Velocity" (Var meaning variable to be used for multiple shapes) will make a fluent falling cube 

No comments:

Post a Comment