Game Maker Tool & Tutorials 2011 년 9 월 2 일 영산대학교 게임 * 콘텐츠학과 채영숙 영산대학교 2011년도 2학기 게임제작개론 ( 채영숙 ) 1
What is Game Maker? http://www.yoyogames.com 100 Game Maker Games in 10 Minutes 국내제작카페 http://cafe.naver.com/crazygm.cafe http://cafe.naver.com/gmkor.cafe http://blog.daum.net/jty71/15645094 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 2
About Game Maker Allow you to make exciting computer games without the need to write a single line of code. Use easy-to-learn, drag-and-drop actions Games have backgrounds, animated graphics, music, and sound effects A built-in programming language that gives you full flexibility. Get more experienced You even can sell them. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 3
The User Interface 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 4
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 5
Resources sprites: (animated) images that are used to represent the objects sounds: these can be used in games, either as background music or as effects backgrounds: the images used as background for the rooms objects: the true entities in the game rooms: the places (levels) in which the objects live 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 6
File menu New. Choose this command to start creating a new game. If the current game was changed you are asked whether you want to save it. There is also a toolbar button for this. Open. Opens a game file. Game Maker files have the extension.gmk. You can also open old.gm6 files. If you want to open.gmd files created with version 5 of Game Maker you must select the appropriate file type at the bottom of the dialog. These might though not work correctly in the new version.) There is a toolbar button for this command. You can also open a game by dragging the file into the Game Maker window. Recent Files. Use this submenu to reopen game files you recently opened. Save. Saves the game design file under its current name. If no name was specified before, you are asked for a new name. You can only use this command when the file was changed. Again, there is a toolbar button for this. Save As. Saves the game design file under a different name. You are asked for a new name. Create Executable. Once your game is ready you will probably want to give it to others to play. Using this command you can create a stand- alone version of your game. This is simply an executable that you can give to other people to run. Advanced Mode. When clicking on this command Game Maker will switch between simple and advanced mode. In advanced mode additional commands and resources are available. Exit. Probably obvious. Press this to exit Game Maker. If you changed the current game you will be asked whether you want to save it. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 7
Edit menu Insert resource. Inserts a new instance of the currently selected type of resource before the current one. A form will open in which you can change the properties of the resource. This will be treated in detail in the following chapters. Duplicate. Makes a copy of the current resource and adds it. A form is opened in which you can change the resource. Delete. Deletes the currently selected resource (or group of resources). Be careful. This cannot be undone. You will, though, be warned. Rename. Gives the resource a new name. This can also be done in the property form for the resource. Also, you can select the resource and then click on the name. Properties. Use this command to bring up the form to edit the properties. Note that all the property forms appear within the main form. You can edit many of them at the same time. You can also edit the properties by double clicking on the resource. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 8
Resources menu In this menu, you can create new resources of each of the different types. Note that for each of them there is also a button on the toolbar and a keyboard shortcut. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 9
Scripts Menu 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 10
Run menu Run normally. Runs the game as it would normally run. The game is run in the most efficient way and will look and act as in an executable game. Run in Debug mode. Runs the game in debug mode. In this mode you can check certain aspects of the game and you can pause and step through it. This is useful when something goes wrong but is a bit advanced. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 11
Window menu Cascade. Cascade all the windows such that each of them is partially visible. Arrange Icons. Arrange all the iconified property windows. (Useful in particular when resizing the main form.) Close All. Close all the property windows, asking the user whether or not to save the changes made. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 12
Help menu Contents. Use this command to show this help file. Online Help. This command will bring you to a location on the website where you can obtain all sorts of additional help and where you can also download some tutorials. Upgrade. You can use this command to upgrade the Lite Edition of Game Maker to the Pro Edition. The Pro Edition has many aditional features. Here you can find information on how to upgrade the program. If you did upgrade it you can use this command to enter the registration key you received. Web site. Connects you to the Game Maker website where you can find information about the most recent version of Game Maker and collections of games and resources for Game Maker. We recommend that you check out the site at least once a month. Forums. This command will bring you to the forums where users help each other with many aspects of Game Maker. About Game Maker. Gives some short information about this version of Game Maker. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 13
Let us look at an Example Create Sprite Create Sound Create Object Create Event Create a new Room Backgrounds + Objects 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 14
Defining sprites Sprites are the visual representations of all the objects in the game. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 15
Sounds and music To create a sound resource in your game, use the item Create Sound in the Resources menu or use the corresponding button on the toolbar. The following form will pop up. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 16
Backgrounds 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 17
Defining objects 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 18
Events 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 19
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 20
Actions 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 21
참고사이트 http://blog.daum.net/jty71/15645094 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 22
TUTORIAL 1. YOUR FIRST GAME 2. CREATING A SCROLLING SHOOTER 3. MAZE GAMES 4. 3-DIMENSIONAL GAMES 5. A FIRST PERSON SHOOTER 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 23
Game Maker Tutorial 1. Your First Game 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 24
Agenda To understand a number of the basic aspects of Game Maker 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 25
The Game Idea Title: Catch the Clown A little action game. A clown moves around in a playing field. The goal of the player is to catch the clown by clicking with the mouse on him. If the player progresses through the game the clown starts moving faster and it becomes more difficult to catch him. For each catch the score is raised and the goal is to get the highest possible score. Expected playing time is just a few minutes. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 26
A Design Document Game objects Sounds Controls Game flow Levels 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 27
Game objects Two game objects: the clown and the wall. The wall object has a square like image. The wall surrounding the playing area is made out of these objects. The wall object does nothing. It just sits there to stop the clown from moving out of the area. The clown object has the image of a clown face. It moves with a fixed speed. Whenever it hits a wall object it bounces. When the player clicks on the clown with the mouse the score is raised with 10 points. The clown jumps to a random place and the speed is increased with a small amount. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 28
Sounds Use two sounds A bounce sound that is used when the clown hits a wall a click sound that is used when the player manages to click with the mouse on the clown. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 29
Controls The only control the player has is the mouse. Clicking with the left mouse button on the clown will catch it. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 30
Game flow At the start of the game the score is set to 0. The room with the moving clown is shown. The game immediately begins. When the player presses the <Esc> key the game ends. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 31
Levels There is just one level. The difficulty of the game increases because the speed of the clown increases after each successful catch. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 32
Processes Adding Sprites and Sounds Creating the clown sprite resource Create two sound resources Objects and Actions Create the wall object Create the clown object Let the clown object move Handling a collision with the wall Handling a mouse press Creating the Room Create background music Adding the alarm clock Adding a help text 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 33
Adding Sprites and Sounds The clown: The wall: 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 34
Creating the clown sprite resource 1. From the Resources menu, choose Create Sprite. 2. Click on the Name field where currently is says sprite0. This is the default name for the sprite. Rename it to spr_clown. 3. Click on the Load Sprite button. This opens the standard Windows file requester. 4. Navigate to the Resources folder that came with this tutorial and selected the image file clown.bmp. The Sprite Properties form should now look like Figure 2. 5. Press the OK button to close the form. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 35
1. Choose Sprites -> Create Sprite 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 36
2. Name field : spr_clown spr_clown 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 37
3. Load Sprite button 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 38
4. select the image file clown.png 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 39
5. Press the OK button to close the form 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 40
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 41
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 42
Creating the wall sprite 1. From the Resources menu, choose Create Sprite. Click on the Name field and rename it to spr_wall. 2. Click on the Load Sprite button and select the image file wall.png. 3. As the wall image coves the whole area it should not be transparent. So click on the checkmark next to Transparent to remove it. 4. Press the OK button to close the form. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 43
1 spr_wall 2 wall.png 3 4 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 44
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 45
Create two sound resources 1. From the Resources menu, choose Create Sound. The Sound Properties form appears. Click on the Name field and rename it to snd_bounce. 2. Click on the Load Sound button, navigate to the Resources folder that came with the tutorial, and select the sound file bounce.wav. The form should now look as shown in Figure 3. 3. Press the OK button to close the form. 4. Create another sound resource and name it snd_click. 5. Click the Load Sound button and select the sound file click.wav. 6. Close the form. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 46
snd_bounce 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 47
snd_click 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 48
Objects and Actions Instances of game objects Wall object Clown object Create Event Collision Event Mouse Event 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 49
Create the wall object 1. From the Resources menu, choose Create object. 2. Click on the Name field and rename the object to obj_wall. 3. Click on the icon at the end of the Sprite field and in the list of available sprites select the spr_wall sprite. 4. Instances of the wall object must be solid, that is, no other instances should be allowed to penetrate them. To this end click on the box next to the Solid property to enable it. 5. The filled-in form is shown in Figure 5. Press OK to close the form. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 50
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 51
obj_wall 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 52
Create the clown object: 1. From the Resources menu, choose Create object. 2. Click on the Name field and rename the object to obj_clown. 3. Click on the icon at the end of the Sprite field and select the spr_clown sprite. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 53
obj_clown 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 54
Let the clown object move 4. Press the Add Event button. 5. Click on the Create button. The create event is now added to the list of events. It is automatically selected (with a blue highlight). 6. Next you need to include a Move Fixed action in the list of actions. To this end, press and hold the mouse on the action image with the eight red arrows in the page at the right, drag it to the empty actions list, and release the mouse. An action form is shown asking for information about the action. 7. In the action form for the Move Fixed action you can indicate in which direction the instance should start moving. Select all eight directions (not the middle one; which corresponds to no motion). Note that the selected directions turn red. When multiple directions are selected one is chosen randomly. Also set the Speed to 4. See Figure 7 for the result. Press OK to indicate that we are ready with this action. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 55
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 56
Drag and drop here 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 57
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 58
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 59
Handling a collision with the wall 1. Press the Add Event button. In the Event Selector click on the Collision button and select obj_wall. The collision event is now added to the list of events. 2. Include a Bounce action by dragging it from the page at the right. There are two properties we can change but their default values are fine. We are not interested in precise bounces and we want to bounce against solid objects. (Remember that we made the wall object solid.) Press OK to close the action form. 3. Select the page with the tab main1. From it include the Play Sound action and drag it below the Bounce action already present. In the action from, click on the icon to the right of the Sound property and from the list select snd_bounce. Leave the Loop property to false as we want to play the sound only once. Press OK to close it. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 60
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 61
Drag and drop here 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 62
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 63
Drag and drop here 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 64
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 65
Handling a mouse press 1. Press the Add Event button. In the Event Selector click on the Mouse button and in the menu that appears select Left Pressed. This event happens when the user presses the left mouse button while the mouse cursor is on top of the instance. 2. From the tabbed page labeled score include the Set Score action. As new score indicate a value of 10. Also click on the box next to the property Relative to enable it. When Relative is enabled the value is added to the current score. Otherwise the score would be replaced by the value. 3. From the page main1 include a Sound action. As Sound indicate snd_click. Leave Loop to false. 4. From the page move include a Jump to Random action. This action places the instance in a random collision-free position. The parameters can be left unchanged. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 66
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 67
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 68
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 69
Drag and drop here 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 70
Drag and drop here 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 71
Drag and drop here 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 72
Creating the Room 1. From the Resources menu choose Create Room. 2. On the left you see three tabbed pages. Select the page labeled settings. In the Name field type in rm_main. In the Caption for the room field type Catch the Clown. 3. Select the objects tab. Enlarge the window somewhat such that you can see the complete room area at the right. At the top, change the value for Snap X and Snap Y to 32. As the size of our sprites is 32, this makes it easier to place the sprites at the correct locations. 4. At the left you see the image of the clown object. This is the currently selected object. Place one instance of it in the room by clicking with the mouse somewhere in the centre of the grey area. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 73
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 74
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 75
rm_main Catch the Clown 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 76
32 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 77
<Shift> key + drag the mouse with the mouse button pressed. Obj_wall 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 78
Saving and Testing 1. Save from the File menu 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 79
Create background music 1. From the Resources menu, choose Create Sound. The Sound Properties form appears. Click on the Name field and rename it to snd_music. 2. Click on the Load Sound button, navigate to the Resources folder and select the sound file music.mid. Note that this is a midi file. Midi files are often used for background music as they use less memory. 3. Press the OK button to close the form. 4. Reopen the clown object by double clicking on it in the resource list at the left of the window. 5. Select the Create event. From the main1 page include a Play Sound action. As Sound indicate snd_music and set Loop to true because we want the music to repeat itself forever. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 80
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 81
v v snd_music v v 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 82
v v v v v v v snd_music true v 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 83
Add a background image 1. From the Resources menu, choose Create Background. The Background Properties form appears. Click on the Name field and rename it to back_main. 2. Click on the Load Background button, navigate to the Resources folder and select the image file background.bmp. Note that the Transparent property is default disabled for background images. 3. Press OK to close the form. 4. Reopen the room by double clicking on it in the resource list. 5. Select the backgrounds tab. Unselect the property Draw background color because we no longer need the gray background. 6. Click on the little menu icon in the middle and pick the back_main in the popup menu. Note the two properties Tile Hor. and Tile Vert. They indicate that the background must be tiled horizontally and vertically, that is, repeated to fill the whole room. For this to work correctly the background image must be made such that it nicely fits against itself without showing cracks. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 84
v 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 85
v v back_main v v 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 86
v v 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 87
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 88
Adding the alarm clock 1. Reopen the clown object by double clicking on it in the resource list at the left of the window. 2. Select the Create event. From the main2 page include a Set Alarm action. As Number of steps indicate 50. The alarm number we keep as Alarm 0. 3. Click on Add Event. Choose the button Alarm and in the popup menu select Alarm 0. 4. In the event include the Move Fixed action (from the move tab). Select all eight arrows. Set the Speed to 0 and enable the Relative property. In this way 0 is added to the speed, that is, it does not change. 5. To set the alarm clock again, include a Set Alarm action. As Number of steps again indicate 50. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 89
v v v v 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 90
Drag and drop here 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 91
Drag and drop here 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 92
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 93
Adding a help text 1. From the Resources menu select Change Game Information. A simple text editor will appear. 2. Type in some useful information for the player, in particular about the goal of the game and the way to control it. You can use different fonts, sizes, and colors. 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 94
v v v 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 95
영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 96
실행결과 영산대학교 2011 년도 2 학기게임제작개론 ( 채영숙 ) 97