Last week, we chose a back-ground and disabled the built in walls above and below our field. We then chose a sprite, and set it on the screen. We sized it so that it would fit correctly using the sprite.set_size() function.
Next we used the fact we could assign properties using
sprite.property = value method. (This was demonstrated when we set the number of lives and score.
We then used
"someString".format() method to display a live display of the score and player lives.
This week we will be adding movement to our player sprite and, if we are moderately fast, enemies. If we are awesome fast we will also add a laser to shoot the enemy.
First things first, lets cover the (x,y) "Cartesian" coordinate system. Flat spaces are considered two dimensional, which means that you can generally choose two variables to specify where something in. Sometimes this is an angle and distance from origin (Polar coordinates) or where something is in X,Y (Cartesian). The "x" value, in most common systems, represents the distance from the origin left and right. The "y" value represents the vertical component of an objects location and the "z" value generally represents the depth coordinate.
Next thing we need to talk about is a programming idea: "Getters" and "Setters". Getters and Setters are function that, surprise surprise, get and set values. This may seem like an obvious piece of nonsense, but it will be important. If we need a sprite to move 3 spaces to the right we would need to get it's current x value (using the getter), then add three to the x value, and then set the new x value.