Step 2: X-Wing Starting Code 2

Goal:


We now can build off of this block and everything we put here will begin to activate as soon as the game starts.

We now need to create a starting location for our X-Wing to go to whenever the game starts or restarts. We want to start the X-Wing in the bottom-center of the screen.

We will do this by setting its x/y coordinates. The x coordinate will be zero to be centered horizontally. The y coordinate will be a negative number to start near the bottom of the game screen.

We also need to start the loop that will hold our player controls.

Steps:

  1. From Motion, place a go to x/y block.
  2. Set X to 0 and Y to -147.
  3. From Control, place a forever block.

Code:


Click to replay