You are going to screenshot all of your work into a Powerpoint file.
To save your powerpoint go to:
Save the Powerpoint file: as your name
When we want to use an image in our computer game these are known as sprites.
it must be in the same folder where your code is saved!
image_bird = pygame.image.load("bird1.png")
bird_position = [100, 100]
Make sure these lines are double-indented, otherwise they won't work.
screen.fill(black)
bird = screen.blit(image_bird, bird_position)
To do that we have to add some code to transform his size.
image_luigi = pygame.image.load("luigi.png")
image_luigi_sizeXY = [150, 100]
image_luigi = pygame.transform.scale(image_luigi, image_luigi_sizeXY)
luigi_position = [300, 100]
The red code is what you are adding if you completed the last task if not you should add it all.
If you already added luigi in your previous task then also check your code for your luigi sprite in the
luigi = screen.blit(image_luigi, luigi_position)
We now have some static images. To make it a little more interactive, let's make one of our sprites(luigi) follow the mouse.
Add these two line underneath the line:
Don't forget to double-indent!
Your luigi should now follow the mouse cursor
You may notice that our mouse is not centred on luigi. We are going to make some improvements
First let's try and centre the mouse on our image
As we now know the size of our image we can adjust our mouse position so that it is halfway across the height and width of our image.
Lets make two new variables for these two new positions
Now lets use those to create a new luigi position with the mouse.
This should centre our mouse on our luigi sprite
Finally we want to hide our mouse cursor, we do so by adding the following line of code
Lets see if we can take what we have learned and use it to create a target sprite that moves around the screen with the mouse.
Complete the following:
Lets look at the learning outcomes and decide which one best describes our current level of understanding :
Tick the one you feel is closest to your level