Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lesson Eleven Moving Backgrounds.

Similar presentations


Presentation on theme: "Lesson Eleven Moving Backgrounds."— Presentation transcript:

1 Lesson Eleven Moving Backgrounds

2 Skills

3 Create a new project Title it Lesson 11 Delete the cat!

4 Bring in the hippo, cloud, and building

5 Create a blue sky for your backdrop

6 Start with your building
The costumes are actually different buildings, so we can use this to give the illusion of many sprites

7 Start by setting your building’s x-coordinate to 250
This positions the building to start on the far right corner

8 To create the moving effect, the building will move across the screen.
The number of repeats just needs to be enough to make it move to the far left corner If we change x by -5, it will slowly move to the left across the screen

9 To get the building to start back on the right side again, add a forever loop

10 Then add a costume change so that it will seem like different buildings

11 It should now look like this

12 Can you make it scroll across?
Now try the cloud. Can you make it scroll across?

13 One starting point is to simply duplicate the code… but what’s the problem?

14 The cloud doesn’t have a costume change, so we could start by deleting that code
Although making new costumes for the cloud would be a great way to improve this game later 

15 I used -10 to make the clouds move twice as fast
Change the value for change x by so that the cloud won’t be synced to the movement of the building I used -10 to make the clouds move twice as fast

16 Now your cloud is getting stuck for a few seconds on the left.
Change to 50 repeats to fix this

17 Now add code to randomize the cloud’s spot on the y-axis
200 to -200 covers most of the screen

18 It should now look like this

19 Program the arrow keys to move our hippo
The next costume code will cause his wings to flap when he is moved

20 Program your hippo’s start and directions
Did you notice he was flying behind the buildings? This will fix that.

21 Create a variable for hits
Click here

22 Add code to track the hits and to cause the hippo to react when it touches a cloud
Restarts the score Creates trigger if hippo touches cloud Need a forever loop for it to constantly be checking Increases # of hits Causes hippo to change colors Need a wait or else hippo will rack up multiple hits while still touching cloud Resets the hippo’s color

23 The hippos says “Watch out for clouds” for
2 seconds, so add a 2 second wait for the cloud and the building

24 The hippos says “Watch out for clouds” for
2 seconds, so add a 2 second wait for the cloud and the building

25 Your Turn! Make your own game with a moving background
Must have at least two sprites that move in the background Another sprite must need to dodge something Must use a variable BONUS: Can you program it so that the background only moves when you press your arrow keys? Submit to Lesson 11 in the class studio.

26 12-Lesson Discounted Bundle
Bonus Files Final project with Guidelines Rubric Reflection Assignment Student Support Website A support page for each lesson to aid students while working independently

27 Click for individual lessons

28 Technology and Computer Applications

29 Literature, Grammar, and Writing

30 Novels

31

32 Terms of Use & Credits By downloading this product you are given permission for classroom and personal use only. You may alter and modify this work for your own use, but please do not share, sell, or post online. Please consider rating this resource. Your ratings earn you TpT credits to apply discounts towards future purchases. Use the link to go to the “My Purchases” tab and rate any products you have downloaded. Note that there is a separate “paid downloads” and “free downloads” tab. Cover art from Tangerine by Edward Bloor. Copyright ©1997 by Edward Bloor. Reprinted by permission of Houghton Mifflin Harcourt Publishing Company. All rights reserved. All other images in products and on cover art (thumbnail images) were found in the public domain. The public domain consists of all the creative works to which no exclusive intellectual property rights apply. Those rights may have expired, been forfeited, expressly waived, or may be inapplicable. Screenshots that are taken from Adobe CC Suite, Microsoft Office Suite, iMovie, and Scratch are in compliance with Fair Use guidelines.


Download ppt "Lesson Eleven Moving Backgrounds."

Similar presentations


Ads by Google