Студопедия.Орг Главная | Случайная страница | Контакты | Мы поможем в написании вашей работы!  
 

Adding Bombs



Although the game can already be fun to play, there is something missing. You cannot lose! You can just keep clicking randomly, which is not really much fun. Hence, we are going to add bombs to the game. If you click on a bomb you will lose and the game will end. Bombs will be static. They won't move, but their number keeps increasing to make the game more and more difficult over time.

The bomb sprite is already present but we atill need a sound effect for it. Press the button with the speaker to add a sound. Give is an appropriate name, press the Load Sound button and select explosion.wav. Press OK to close the sound form.

Now create the bomb object by clicking on the blue ball button. Give the object an appropriate name and the bomb sprite. We want the bomb to appear in a random place. To this end, add the Create event. In it place the action to jump to a random location.

When the use clicks on it we want the game to end. So add the Mouse event Left pressed. As a first action we want to play the explode sound so add the play sound action (from the main1 tab) and select the explode sound. Next we want to wait a little while to let the player realize he lost. From the main2 tab, drag the sleep action (with the zzz on it) and place it below the play sound action. The default values are fine, so press OK.

As a next step we want to show a highscore list. This is very easy in Game Maker. From the score tab, drag the show highscore action (with the 1,2,3 in it). In the form you can set quite some values. As a background you can choose the wood background. You also can change the colors and the font if you like, for example as follows:

As a final step we need the action to restart the game, which can be found in the main2 tab. The action list should now look as follows:

Make sure the order of the actions is correct. (If not, drag them to the correct location.) That finishes the bomb object so better press the OK button to close the form. To test the game, place one or two bomb objects in the room. Save the game, run it, catch some fruit and then click on a bomb. An explosion sound should be heard and the highscore list should show. Note that in this list you can add your name if you get a new high score.

Страница 13 из 15

Создание Бомб

Чтобы сделать игру более трудной, мы хотим создать дополнительные бомбы во время игры. Мы можем создать новый объект, чтобы сделать это, но мы можем также использовать объект музыку для этого. Так вновь открыть объект музыкальный, дважды щелкнув по нему в списке слева.

Для создания бомбы мы будем использовать будильники. Вы можете установить эти часы на конкретное значение, и они будут затем отметьте до 0. Как только они достигают 0 тревожное событие произойдет. Для инициализации будильник, перейдите на то main2 вкладке и перетащите верхний левый действие (с изображением часов) в список действий (ниже звуковой действия игры). Как количество шагов указывает на значение 60. Второй находится в 30 шагах поэтому мы добавим новый бомбу каждые 2 секунды. Убедитесь в том, сигнализации 0 выбран.

Теперь нажмите Добавить событие, нажмите на тревожные события и выберите в меню Alarm 0. В этом случае мы создадим бомбу. Перейдите на вкладку Main1 и перетащите верхний левый действие в списке действий (лампочки). Нажмите на иконку меню и выберите объект бомбы.

Там нет необходимости, чтобы установить положение как бомба будет в любом случае прыгать в любом положении. Далее мы должны установить будильник снова. Так что добавьте действие сигнализация (с вкладки main2) и установить будильник 0 раз до 60. Это будет повторять процессоры. Таким образом, список действий сейчас выглядит следующим образом:

Закройте форму объекта, сохранить игру, и запустить его. Вы должны видеть все больше и больше бомб, появляющиеся и в конечном итоге вы будете нажать на одну из них, и игра закончится. Если вы хотите, чтобы сделать игру немного сложнее, вы также можете позволить бомбы двигаться медленно. Вы должны теперь знать, как этого добиться.

Page 13 of 15 Creating Bombs To make the game more difficult we want to create additional bombs while playing the game. We can create a new object to do this but we can as well use the music object for this. So reopen the music object by double clicking on it in the list at the left. To create the bombs we will use alarm clocks. You can set these clocks to a particular value and they will then tick down to 0. Once they reach 0 an Alarm event will happen. To initialize the alarm clock, go to then main2 tab and drag the top left action (with the clock image) to the action list (below the play sound action). As number of steps indicate a value of 60. A second is 30 steps so we will add a new bomb every 2 seconds. Make sure alarm 0 is selected. Now press Add Event, click on the Alarm events and select in the menu Alarm 0. In this event we will create the bomb. Go to the main1 tab and drag the top left action in the action list (the lightbulb). Click on the menu icon and select the bomb object.     There is no need to set a position as the bomb will anyway jump to a random position. Next we must set the alarm clock again. So add the alarm action (from the main2 tab) and set alarm 0 again to 60. This will repeat the proces. So the action list now looks as follows:     Close the object form, save the game, and run it. You should see more and more bombs appearing and eventually you will click on one of them and the game will end. If you want to make the game a bit harder, you can also let the bombs move slowly. You should by now know how to achieve that.

Страница 14 из 15

Оказание помощи

Даже если вы знаете, как играть в игру, кто-то другой не может. Таким образом, вы должны предоставить некоторую помощь для игрока. Это очень легко в Game Maker. Дважды щелкните на информация об игре в нижней части списка слева.

Появится простой редактор. Здесь можно ввести небольшого вспомогательного текста. Дайте вашу игру имя и описать то, что цель состоит в том. Вы можете выбрать различные шрифты, цвета и стили. Когда вы будете готовы, нажмите зеленая галочка в верхнем левом углу, чтобы закрыть форму.

Теперь, когда вы запустите игру и нажмите клавишу F1, появится текст справки. Побег вернет вас в игру.

Page 14 of 15 Giving Help Even though you know how to play the game, somebody else might not. So you should provide some help for the player. This is very easy in Game Maker. Double click on the Game Information at the bottom of the list at the left.     A simple editor will appear. Here you can type a little help text. Give your game a name and describe what the goal is. You can choose different fonts, colors, and styles. Once you are ready, press the green checkmark at the top left to close the form. Now when you run the game and press F1, the help text will appear. Escape will return you to the game.

Страница 15 из 15

Поздравляю

Итак, вы закончили свою первую игру. Как вы видели, это было не очень сложно. You игра должна выглядеть примерно так:

Если это действительно не работают правильно, вы всегда можете загрузить игру из папки примеров. Как только игра будет готов, можете дать его своим друзьям. Но они не могут иметь Game Maker. Для этого перейдите в меню Файл и нажмите Создать исполняемый. Укажите имя (и место) и нажмите Сохранить. Теперь вы будете иметь автономные игры, что вы можете дать всем, чтобы играть.

Вы узнали о наиболее важных элементов Game Maker: спрайты, фоны, звуки, музыка, объектов, событий, действий и комнат. Теперь вы должны быть в состоянии начать создавать свои собственные игры. Но есть намного больше, чтобы учиться. Вы можете проверить файл справки или вы можете прочитать больше некоторые учебники. И есть даже книги о Game Maker. Вы можете получить доступ всю эту информацию через меню Справка. Наслаждайтесь!





Дата публикования: 2014-10-25; Прочитано: 271 | Нарушение авторского права страницы | Мы поможем в написании вашей работы!



studopedia.org - Студопедия.Орг - 2014-2024 год. Студопедия не является автором материалов, которые размещены. Но предоставляет возможность бесплатного использования (0.007 с)...