Presentation is loading. Please wait.

Presentation is loading. Please wait.

GAME:IT Mario Creating Platform Games Level 4 with GML Game Maker Language (GML) allows users more flexibility in game design. GML is similar to how real.

Similar presentations


Presentation on theme: "GAME:IT Mario Creating Platform Games Level 4 with GML Game Maker Language (GML) allows users more flexibility in game design. GML is similar to how real."— Presentation transcript:

1 GAME:IT Mario Creating Platform Games Level 4 with GML Game Maker Language (GML) allows users more flexibility in game design. GML is similar to how real games are programmed in C based languages. In this lesson, you will get a taste of how GML replaces Drag and Drop icons.

2 Creating Sprites 1. Create a sprite named spr_block using block.png. Check Separate collision only. 2. Create a sprite named spr_blockh using blockh.png. Check Separate collision only. 3. Create a sprite named spr_blockv using blockv.png. Check Separate collision only. 4. Create a sprite named spr_death using death.png. Check Separate collision only. 5. Create a sprite named spr_right use Create from Strip, character_right_strip12.png, 12 images, 12 images per row, width 22, height 35. Check Precise collision only. 6. Create a sprite named spr_left use Create from Strip, character_left_strip12.png, 12 images, 12 images per row, width 22, height 35. Check Precise collision only. 7. Create a sprite named spr_monsterl, use Create from Strip, monsterl_strip14.png, 14 images, 14 images per row, width 22, height 32. Check Precise collision only. 8. Create a sprite named spr_monsterr, use Create from Strip, monsterr_strip14.png, 14 images, 14 images per row, width 22, height 32. Check Precise collision only. 9. Create a sprite named spr_monsterflat, using monsterflat.png. Check both Precise and Separate collision checking boxes.

3 Creating Sprites (continued) 10. Create a sprite named spr_marker, using marker.png. Check both Precise and Separate collision checking boxes. 11. Create a sprite named spr_flyingl, use Create from Strip, flyingl_strip12.png, 12 images, 12 images per row, width 25, height 32. Check Precise collision only. 12. Create a sprite named spr_flyingr, use Create from Strip, flyingr_strip12.png, 12 images, 12 images per row, width 25, height 32. Check Precise collision only. 13. Create a sprite named spr_mushroom, use Create from Strip, mushroom_strip10.png, 10 images, 10 images per row, width 16, height 16. Check both Precise and Separate collision checking boxes. 14. Create a sprite named spr_level, using level.png. Check both Precise and Separate collision checking boxes.

4 Creating Sounds 1. Create a sound named snd_killmonster, and assign it the killmonster.wav file. 2. Create a sound named snd_killcharacter, and assign it the killcharacter.wav file. 3. Create a sound named snd_getmushroom, and assign it the mushroom.wav file. 4. Create a sound name snd_stageclear, and assign it the stageclear.wav file. 5. Create a sound name snd_background, and assign it the background.wav file. 6. Create a sound name snd_jump, and assign it the jump.wav file.

5 Creating Backgrounds 1. Create a background called back_sky, Load Background sky.png. 2. Create a background called back_tiles, Load Background bckgd_tiles.png. Check the box next to “Use as tile set”, change tile width to 17 and tile height to 17, then click OK. 3. Create a background called back_scene_tiles, Load Background bckgd_scene_tiles.png. Check the box next to “Use as tile set”, change tile width to 32 and tile height to 32, then click OK. 4. Create a new background called back_small_tiles, Load Background bckgd_small_tiles.png. Check the box next to “Use as tile set”, change tile width to 16 and tile height to 16, then click OK.

6 Creating Objects 1. Add an object named obj_character use spr_right. Check the visible box. 2. Add an object named obj_block, use spr_block. Check the solid box (not visible). 3. Add an object named obj_blockh, use spr_blockh. Check the solid box (not visible. Also assign obj_block as its parent. 4. Add an object named obj_blockv, use spr_blockv. Check the solid box (not visible). Also assign obj_block as its parent. 5. Add an object named obj_monster, use spr_monsterr. Check the visible box. 6. Add an object named obj_flyer, use spr_flyingr. Check the visible box. 7. Add an object named obj_marker, use spr_marker. No boxes checked. 8. Add an object named obj_monster_dead, use spr_monsterflat. Check the visible box. 9. Add an object named obj_mushroom, use spr_mushroom. Check the visible box. 10. Add an object named obj_levelexit, use spr_level. Check the visible box. 11. Add an object named obj_death, use spr_death. No boxes checked.

7 Creating Rooms 1. Click on Create a room button. Go to the background tab. Select back_sky as your foreground image. 2. Click on the tiles tab as seen below. Select the back_small_tiles tileset, then click on the piece of the tile set shown. Then click in the room to add those tiles until it looks like the room below (hint – just like with objects, you can hold down shift to add multiple tiles quickly.)

8 Creating Rooms (continued) 3. While the back_small_tiles tileset is still selected, click on pieces of the tile set, then click in the room to add tiles until it looks like the room below

9 Creating Rooms (continued) 4. Change to the back_scene_tiles tileset, then click on the tiles and add to the room to make it look like the room below.

10 Creating Rooms (continued) 5. Go to the objects tab and add in the character, mushrooms, monsters, and level exit sign to the room to make it look like the room below.

11 Creating Rooms (continued) 6. Still on the objects tab, add in the markers (obj_marker) to the room as shown below.

12 Creating Rooms (continued) 7. Go to the tiles tab, select back_tiles, un-check “Delete underlying”, select the “spikes” and add them to the room as shown below.

13 Creating Rooms (continued) 8. Go to the object tab, select the death object and add them above the “spikes”, then select the block object and add them to the room as shown below. This is the critical part of platform games. The object blocks create a surface to collide against and are invisible when the game is played. They also create the “platforms” that the character can jump unto. Notice that there are 14 platforms in this room.

14 Programming the Game Maker Language (GML) in Object ACTIONS Rather than drag and drop actions, you can use a more powerful code. The “execute a piece of code” action looks like this and is used in place of the action icons. Obj_character Coding 1. Double click on obj_character. Add Event Step. To this add Action Execute Code. Add this script:

15 Obj_character Coding (continued) 2. Add a collision Event with obj_block. To this add Action Execute Code. Add this script: 3. Add a collision Event with obj_monster. To this add Action Execute Code. Add this script:

16 Obj_character Coding (continued) 4. Add a collision Event with obj_flyer. To this add Action Execute Code. Add this script: 5. Add a collision Event with obj_mushroom. To this add Action Execute Code. Add this script:

17 Obj_character Coding (continued) 6. Add a collision Event with obj_levelexit. To this add Action Execute Code. Add this script: 7. Create a collision Event with obj_death. To this add Action Execute Code. Add this script: 8. Add a Keyboard Event. To this add Action Execute Code. Add this script:

18 Obj_character Coding (continued) 9. Add a Keyboard Event. To this add Action Execute Code. Add this script: 10. Add a Keyboard Event. To this add Action Execute Code. Add this script: 11. Add a Keyboard Event. To this add Action Execute Code. Add this script:

19 Obj_character Coding (continued) 12. Add an Event—Other—Outside Room. To this add Action Execute Code. Add this script: 13. Add an Event—Other—Game Start. To this add Action Execute Code. Add this script:

20 Obj_monster Coding 1. Double Click on obj_monster. To this add a Create Event. To this add Action Execute Code. Add this script: 2. Add an Event End Step. To this add Action Execute Code. Add this script: 3. Add a collision Event with obj_block. To this add Action Execute Code. Add this script: 4. Add a collision Event with obj_marker. To this add Action Execute Code. Add this script:

21 Obj_flyer Coding 1. Double Click on obj_flyer. To this add a Create Event. To this add Action Execute Code. Add this script: 2. Add an Event End Step. To this add Action Execute Code. Add this script: 3. Add a collision Event with obj_block. To this add Action Execute Code. Add this script: 4. Add a collision Event with obj_marker. To this add Action Execute Code. Add this script:

22 Obj_monster_dead Coding (no GML coding) 1. Double click on obj_monster_dead. 2. Add a Create Event. Add a Set Alarm Action. Applies to Self. Number of steps is 10 and use in Alarm 0. 3. Add an Event Alarm 0. Add an Action of Destroy Instance of self. Obj_mushroom Coding (no GML coding) 1.Double click on obj_mushroom. 2.Add Create Event. Add action Change Sprite. Applies to self and set sprite to spr_mushroom. Set subimage to random(10) (which picks one of ten random mushrooms) and set speed to 0.

23 Play the game to make sure everything works correctly. 1. You should be able to jump onto all of the platforms and get to the obj_levelexit. 2. When you get to the obj_levelexit, you should see the high score list and then the game should restart. Create a second room 1. Use the tilesets to build another room. You may create new sprites/objects, you also may use sprites from other games to create objects. 2. You may use the obj_levelexit as the goal, but may create a new object to use as the goal which ends the level. 3. The room must have at least ten platforms for the character to jump onto. 4. The room must have at least two enemies. You may use the monster and flyer, you may create new objects to be the enemies, or have any combination of enemies. 5. When done, play the game to make sure that everything works correctly. Use must be able to get through the first room, which should send you to the second room. When you reach the goal in the second room, you should see the high score list and then the game should restart.

24 On the left side of the screen, double click on Game Information In the box that opens, type in these lines, making sure to change Your Name to your first and last name, Class Block to your block (e.g., Green 1, Green 3), and Month, Day, Year to the actual date (e.g., January 28, 2015) : You may also use the Game Information to provide helpful information to the player, such as telling them that they can use the clouds as platforms, or what the goal is in the second room. When done, click on the green check mark to save it. Check the game against the rubric to make sure all items are done, then submit using Schoology.


Download ppt "GAME:IT Mario Creating Platform Games Level 4 with GML Game Maker Language (GML) allows users more flexibility in game design. GML is similar to how real."

Similar presentations


Ads by Google