Upload
milo-shaw
View
217
Download
0
Tags:
Embed Size (px)
Citation preview
GAME:ITPinball
Objectives: • Review skills from Introduction• Introduce gravity and friction• Introduce GML coding into programming
Let’s create the following Sprites which are located in Pinball Resources folder:Make sure they are named exactly as instructed
spr_pinball – Check Precise but NOT Separatespr_wall – Check Precise but NOT Separatespr_no_bounce_wall - Check Precise but NOT Separate
Now we are going to add some animation to your game!
This is done by having multiple versions of an image that displays at different times as the game is played. For instance, when the ball hits a bumper, the bumper glows.
The following sprites will all be created this way:
spr_bumper, spr_deflectorLeft, spr_deflectorRight, spr_paddleLeft, spr_paddleRight & spr_launcher,
To create the paddles, bumper and launcher, we will create the sprites from a strip. We’ll start with the paddles.
To create spr_paddleLeft
1.Click the Create a Sprite Icon
2.Name it spr_paddleLeft and checkPrecise & Separate DO NOT LOAD THE SPRITE IMAGE YET!
3.Click Edit Sprite – this will launch the Sprite Editor window
4.Click File from top bar of the Sprite Editor window and choose Create from Strip
5.Select paddleLeftfrom the Resources folder
1. A Loading a strip image window will appear. It will show the strip and allow you to enter the number of images, images per row and image width and height.
Number of Images: 2Images per row: 2Image width : 64Image height: 48
Click OK
1. Click the Show Preview checkbox to see the animation that is added as the system toggles between the two images.
2. Click the green checkmark in the top corner to Save
3. Follow the same steps to create spr_paddleRight
Now we need to create the spr_launcher
You will follow the same steps, but this one is set up a little differently.
Check Separate and Precise
Select launcher_strip5 from the Resources folder
Number of images: 5Images per row: 5Image width: 16Image Height: 32
Click OK and then preview the image tomake sure it looks correct.
Click the green checkmark to save.
Next we’ll create the spr_bumper
Check Precise but NOT Separate
Select bumper_strip from the Resources folder
Number of images: 2Images per row: 2Image width: 16Image Height: 16
Click OK and then preview the image tomake sure it looks correct.
Click the green checkmark to save.
Now we will create spr_deflectorLeft & spr_deflectorRight. These are not done from a strip…but instead you will change an instance of the image to create the animated effect. We’ll do spr_deflectorLeft first.
Create the sprite, name it spr_deflectorLeft
Check Precise but NOT Separate
Click Edit Sprite
Click File and select Create from File
Select deflectorLeft from the Resources folder. This will be the 1st subimage.
Now click File and select Add from File and again select deflectorLeft . This will create the 2nd subimage.
But wait? They look the same! Let’s change that!
Click on image 1 (the 2nd image)
Then click on Images and select Intensity.
A window will open allowing you to change the Value and Saturation of the image.
Play around until you get a look you like. You want it to be noticeably different than the original image.
Make sure the Apply to all images in the sprite checkbox is NOT checked.
Click OK . Preview and if it looks good, click the green checkbox.
Follow the same steps to create spr_deflectorRight
Now we’ll create the spr_topRight
Check Precise but NOT Separate
Also – click Modify Mask and set Alpha Tolerance to 100
.
Next we’ll create spr_block.
Check Precise and Separate
Select block.png from theResources folder
Number of images: 2Images per row: 2Image width: 32Image Height: 32
Click OK and preview the image tomake sure it looks correct.
Click the green checkmark to save
The block won’t be animated like the other sprites, but until the ball passes a certain point, image 0 will display and after the ball passes, image 1 will display.
Create a special font for pinball to be used for displaying score.
Name it font pinball
Select a font from menu
Enter font size
You can also choose bold or italic if you wish
Create the following objects using the sprites you created earlier.
obj_pinball – Only Visible is checkedobj_paddleRight – Both Visible and Solid are checkedobj_paddleLeft – Both Visible and Solid are checkedobj_bumper – Both Visible and Solid are checkedobj_deflectorLeft - Both Visible and Solid are checked obj_deflectorRight - Both Visible and Solid are checked
Additional objects:obj_wall – Both Visible and Solid are checkedobj_topRight - Both Visible and Solid are checked obj_launcher - Both Visible and Solid are checked obj_no_bounce_wall – Only Visible is checkedobj_block - Both Visible and Solid are checked ***Do not assign a sprite to this object***
obj_blockTrigger – Only Visible is checked ***Do not assign a sprite to this object***
Also – In the Mask Field, select spr_wall from the dropdown
Create a Room to look like the one below:
Change the dimensions of the room using the settings tab and enter Width: 320 Height : 480
The obj_wall is on the left, top and right sides and the ball launch area.
obj_no_bounce_wall is across the bottom.
You can place the bumpers wherever you wish.
Don’t forget obj_topRight
Once the ball is launched, we want to prevent the ball from dropping down the launch area.
You will need to add two more objects to the room.
obj_block and obj_block_Trigger
Because they don’t have a sprite assigned to them, they appear as blue circles with ?.
Programming for Pinball is located on a handout (with assignment)