230 likes | 382 Views
Module 8. Module 8: pickups. Remember: Story Board. graphic organizers in the form of illustrations or images displayed in sequence for the purpose of pre-visualizing a motion picture , animation , motion graphic or video game sequence.
E N D
Remember: Story Board • graphic organizers in the form of illustrations or images displayed in sequence for the purpose of pre-visualizing a motion picture, animation, motion graphic or video game sequence. • visual layout of events as they are to be seen by the player or viewer • Helps to make the games because it is cheaper to make changes to a storyboard than a programmed piece of software
In module 8 we will add a vertical scrolling formula Vertical: Y-Axis
Make your own storyboard • You will create a scrolling landscape. • Each Box will be a 480x360 sprite (it takes up the entire screen) • Each cell needs to be labeled, starting with Sprite 0 • Create 10 sprites (be creative) Draw Here Draw Here Draw Here Sprite 0 Sprite 1 Sprite 2 Draw Here Draw Here Draw Here Sprite 3 Sprite 4 Sprite 5
Draw your Sprites from storyboard • Draw your sprites from your storyboard • Make them colorful. • WARNING: make sure each cell is 480x380 pixels or your program will not work. • Name your sprites accurately with our naming convention from the storyboard.
Name your sprites • It is important that you name your sprites accurately • We are going to have new naming convention for the sprites that scroll • Scr X-Y (the X-Y represents the X-Y coordinates of where the sprite will be on the grid of scrolling sprites. • These are my original horizontal scrolling sprites from Mod 7 and the new vertical scrolling sprites from Mod 8
Our Sprites on the XY Grid Y-Axis 4 3 2 1 X-Axis 0 1 2 3 4 5 6
Remember Scrolling • scrolling is sliding text, images or video across a monitor or display • vertically or horizontally
Scrolling Function updated • ScrollY : This variable will be what controls the scrolling • ScrollY is the variable that sets the location of each scrolling sprite on the y-axis • Up and Down arrows change the value • Place it on the Stage Add this code
Scrolly values • To appear to be moving up, the sprite needs to move down; use a negative value • To appear to be moving down, the sprite needs to move up; use a positive value (+5) (-5)
Remember: Abs is Absolute value • This is the value of any positive or negative number. • We use this to control if a sprite shows or hides • If a sprites Y position is -240, then its ABS is 240. • If a sprites Y position is 240, then its ABS is 240.
Functions for all new sprites Name: ScrollY Multiplier --This function received user input and moves the sprite up and down --This formula changes for each sprite Name: ABS Hider --This function determines if we want to hide our sprite or show it --This does NOT change for each sprite
Example: Scroll Multiplier Function and Sprite name • The sprite name matches up with the multiplier for the Scrolling Multiplier Function • Scr 0-4 • Located on (0,4) of XY grid • Multiplies Scroll X by 0 • Multiplies Scroll Y by 4
Our Sprites on the XY Grid Y-Axis 4 3 2 1 X-Axis 0 1 2 3 4 5 6
Your completed Sprite code • This is based upon the name of your sprite • The ABS functions are the same for all new sprites that are on the X zero level (that means they have a 0 for its x coordinate)
Last piece of the puzzle • Update all sprites on the zero level of Y with the ScrollY multiplier and ABS functions • Update Scr 0-0 with the following code • You are adding the ScrollY multiplier • You are adding the ABS Hider for the y-position • Scr 0-0 should have only these codes…nothing more or nothing less.
Player Controls Update • You are adding these two blocks of code • They allow the screen to scroll when the player if falling with our gravity algorithm
Pick ups • These are Interactive items that the player can gather • They can be for the following: • Health • Time • Points • Ammo • Or whatever you want • Name your pick up sprites the following: • Pickup# (for example: Pickup1)
Pickup scrollx • Add a ScrollY multiplier based upon the location of where it will be on Y-axis • All of mine are on the zero level • Add this ABS function to hide the pickup when scrolling upwards or downwards.