Как изучить gamemaker: studio

Возможности

Структура игры, созданной в программе Game Maker, состоит из набора разнообразных объектов. Их дизайн редактируется с помощью спрайтов, а поведение описание реакции на те или иные действия игрока. Процесс создания напоминает работу с блок-схемами и использует режим drag-n-drop (перетаскивание специальных иконок с действиями в ячейки событий). Для совсем опытных юзеров создан свой собственный язык GML (напоминающий JavaScript). Он поддерживает синтаксис популярных языков (PHP, JS, Pascal), поэтому для написания кода можно использовать один из них. Это значительно расширяет возможности пользователя.

Программа имеет встроенный редактор позволяющий настроить поведение и внешний вид объектов, создать различные цели, которые надо выполнить игрокам, задать время для этого.

Обновление добавило поддержку HTML5. Это позволило разрабатывать приложения не только для компьютеров и мобильных телефонов, но и интернет браузеров.

Основные возможности:

  • создание двухмерных игр без знания основ программирования;
  • возможность использования режима drag-n-drop (дословный перевод – перетаскивай и бросай);
  • использование собственного скриптового языка GML (Game Maker Language), похожего на JavaScript;
  • создание собственных библиотек действий с помощью Library Maker.

Быстро и без особых усилий можно создать простую игру со своими правилами и целями. Благодаря этой программе пользователь может получить новые навыки и проявить творческие способности, даже без глубоких знаний языков программирования. Специалисты используют дополнительные скрипты, чтобы расширить возможности GM. Начинающие программисты используют ее для расширения своих знаний и получения опыта в сфере создания игр.

Встроенная система звуков поддерживает различные форматы аудиофайлов, но дополнительно созданы специальные DLL библиотеки.  Можно добавлять фоновую музыку или эффекты.

Системные требования очень простые и позволяют запустить GM на системах с операционной системой Windows XP и выше. Качественный русификатор позволит без проблем использовать все возможности и функции, а простой и дружественный интерфейс – быстрее разобраться даже неопытным пользователям.

Functions, Scripts and Method Variables

Above we outline some changes to the GameMaker Language, but now it’s time to talk about the good stuff… what’s been added! To start with we want to talk about in-line functions and scripts. Previously, a script was a single resource that was created on a global scope and used to create a single custom function which would then be called using the script name as the function name. This is no longer the case and scripts, while still global in scope, are now a type of «container» for one or more functions.

What this means is that when you compile your project, scripts are no longer called individually, but are actually all run at the start of the game in the global scope, so all variables that are defined in the script (outside of function definitions) will be considered global. That said, you should still use the identifier to explicitly define and identify global variables in your code.

The reason for this change is that scripts can now contain multiple functions. If you’ve only used GML to code projects then the idea of functions may be something new to you, but think of them as being the same as scripts, only explicitly assigned to a variable. This variable is called a method and is used to call the code that is in the function, the same as you would have previously called the script name. This is easier to visualise with an example, so let’s look at one. Consider this simple script :

Now, however, this would be defined as a function like this:

or like this:

You would call this function just as you would have called the script:

So, as we mentioned above, scripts can now contain multiple functions and these should be defined with the format shown above where you have the JS doc comment to identify the function, then the function definition below, and then the next JS Doc comment, and then the function, etc…

Above, we briefly mentioned that functions as variables were called method variables, but it should be explained in a bit more detail. Basically, when you create a function with a variable like this, you are creating a method variable, and they can have different scopes. Consider this function:

  • In the case of a script a variable called «foo» is declared at global scope

  • If the function is declared in an event then the variable «foo» is on the instance that ran that event

  • If the function is declared in an event using the keyword then the variable «foo» is local to the event only

  • If «foo» is declared inside a then it is declared on the that is active at that time

This means that if you have some code that you need to use only within a loop in an alarm event (for example), then you can define it as a local scope method variable at the start of the event and then use it within the loop without the need to clutter up the script assets with it.

It is worth noting that while the variable will be in the chosen scope, the actual function will be bound to the scope that it was initially defined in. Going back to script functions, these are all global scope and are considered «unbound» (ie: they are not associated with any instances), but if you have a script function that creates another function within it and then you call this script from an instance, the function used within the script will be bound to the instance. In general this is not something you ever need to think about but for more complex operations with method variables it’s worth taking into consideration. This also applies when using other constructs like — when you create a method variable inside a , the function will be bound to the instance that is currently in scope.

The following new functions have also been added to deal with methods:

Check the manual for details fo how these functions should be used.

Расширения

Если вам не хватает встроенных функций движка GameMaker, не волнуйтесь; он расширяемый! Бесплатная версия не позволяет использовать расширения, но в платной версии это возможно.

Что могут делать расширения?

Расширения добавляют новую функциональность, изначально не предусмотренную YoYo games. Вот некоторые примеры:

GiiMote — позволяет разработчику интегрировать WiiMote элементы управления в свою игру, добавляя функции, которые опрашивают состояние WiiMote (положение и нажатие кнопок).

FX Creator Extension — упрощает создание таких эффектов, как погода, лучи и брызги воды.

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

Одно серьезное ограничение — некоторые расширения несовместимы с мобильными платформами.

Как их установить

  1. Необходимо загрузить расширение — это должен быть файл .
  2. Щелкните правой кнопкой мыши папку Extensions в GM:S и выберите Add Existing Extension.
  3. Это должно вызвать диалоговое окно, и в правом нижнем углу вы увидите кнопку с надписью Install. Нажмите ее.
  4. Откроется другое диалоговое окно со списком установленных пакетов (возможно, пустым). Справа от этого окна есть кнопка, которая снова с надписью Install. Нажмите ее.
  5. Это открывает еще одно диалоговое окно; перейдите в папку, в которой сохранен файл , щелкните его и нажмите кнопку Open.

Установка русификатора

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

После того как скачали файл русского языка, копируем его и вставляем в директорию с Платформой в папку «Languages» которая лежит по следующему пути C:\Program Files\GameMaker Studio 2\Languages
Открываем вставленный файл в блокноте, для этого нажимаем на него правой кнопкой и выбираем пункт «Изменить».

Откроется блокнот с конфигурацией этого файла. Нам необходимо 7-й строкой вставить следующую конфигурацию.

_LanguageCode,ru,ru,,standard windows os language code this pack represents (can be primary code only ie. en or primary-secondary ie. ru-RU)

Сохраняем файл и делаем бэкап стандартного файла «english», для этого просто скопируйте его в другую папку. Это необходимо для того, если что-то пойдет не так, просто скопировать его обратно и вернуть исходный язык движка. После сохранения русскоязычного файла удаляем старый англоязычный (предварительно сохраненный в другую папку) и запускаем Game maker studio.

Где я могу получить GameMaker: Studio?

Основной сайт движка GM:S — это http://www.yoyogames.com/. Вы можете загрузить бесплатную версию или приобрести одну из лицензионных версий.

Ниже приведено сравнение различных версий GameMaker, взятых с веб-сайта YoYo Games:

Как вы видите, бесплатная версия (Studio) довольно ограничена, но это отличный способ увидеть рабочий процесс и расположение инструментов, а также потратить некоторое время на изучение языка.

Обновление: Бесплатная версия GameMaker: Studio теперь та же, что и стандартная версия! Для получения дополнительной информации см. GameMaker: Studio будет бесплатной.

Стандартная версия отлично подходит для разработчиков одиночек, которые только планируют разработку компьютерных игр; Профессиональная версия идеально подходит для небольшой команды разработчиков планирующих переходить в конечном итоге на кроссплатформенную разработку, поскольку они могут добавлять различные модули с течением времени после получения некоторого дохода; и Master Collection отлично подойдет для небольших команд, которые являются частью созданных студий, и хотели бы использовать кроссплатформенную разработку с самого начала.

GM:S также
доступен в Steam, но я бы рекомендовал не покупать его там, так как
YoYo Games не знает, что вы его приобрели, и,
следовательно обладателям их продукта будет больше хлопот в отделе обслуживания клиентов. Кроме
того, они иногда предлагают дешевые апгрейды для тех, у кого уже есть определенная версия GM:S, и они не могут дать то же обновление пользователям купившим в Steam. Кроме того, если вы покупаете у Steam, то необходимо войти в Steam, чтобы запустить GM:S, а это может раздражать.

Обучение GameMaker: Studio

GM:S предлагает два различных способа создавать игры. Первый это так называемый интерфейс Drag and Drop (сокращённо DnD). Он довольно мощный и позволяет создавать сложную логику. Однако, он не такой мощный, как второй вариант: использование языка программирования GameMaker Language (сокращённо GML). GML — это прекрасный язык сценариев, который может делать все, что может делать DND, и многое другое.

Начало работы

После того, как
вы загрузили версию движка GM:S которая соответствует вашим потребностям, вам следует ознакомиться с учебными материалами,
которые поставляются вместе с GM:S. Их можно найти во вкладке Tutorials после того, как вы откроете GM:S.

В начале уроков будет показано, как использовать drag and drop интерфейс, а более поздние руководства начинают охватывать язык программирования GML. Самое приятное в предложенных уроках — это то, что они фактически добавляют окно к
интерфейсу, в котором вы узнаете, как создавать каждую игру, поэтому вам
не нужно обращаться к веб-странице — все доступно изложено для вас в GM:S!

Я рекомендую
проработать столько, сколько вам нужно, до тех пор, пока вы не
почувствуете, что у вас есть четкое представление об общем процессе
работы и инструментах, которые предлагает движок GM:S. Дополнительные уроки вы можете найти на вики сайте YoYo games по адресу http://wiki.yoyogames.com/index.php/GameMaker:Studio_Tutorials включая некоторые более продвинутые руководства.

Для самого продвинутого обучения можно посмотреть демки на вкладке Demos после запуска GM:S. Они не откроют окно обучения, но они предоставляют доступ ко всему используемому исходному коду, чтобы можно было просматривать его, запускать отладчик и наблюдать за тем, что происходит, так что вы получите хорошее представление как использовать их методы в своих играх.

Руководство

Руководство по GM:S можно найти в меню Help в разделе Contents…. Это должно быть первым местом, где вы будете искать ответы на свои вопросы, если сразу перейти на форумы, люди по всей вероятности огорчат вас за то, что вы просто не проверили справку. Существует также онлайн-руководство, которое можно найти по адресу docs.yoyogames.com

Руководство в программе GM:S

Если вы выполняете поиск как в прилагаемом руководстве, так и в онлайн-руководстве и не можете найти ответы, не бойтесь! На reddit существует большое сообщество /r/gamemaker и есть официальные форумы. Кроме того, имеется отличный сайт полон инди-разработчиков, некоторые из них часто используют GM:S на форумах TIG. Эти сообщества полны полезных людей, поэтому не бойтесь задавать свои вопросы!

Summary

Well, we’ve come to the end of this rather long blog post, and as you can see we’ve been working hard to improve the GameMaker Language and bring it up to par with other more common programming languages, We hope that these new features are of use to you, and that they help your workflow and enable you to make bigger and better games! Note that all the features discussed here are available from GameMaker Studio 2.3 onwards, and we recommend that you read the manual fully before using any of them, as there are details and nuances related to their use that we just haven’t got the space to talk about here. Also note that the 2.3 update includes a number of changes and improvements to the GameMaker Studio IDE which we’ll discuss a separate blog post.

Happy GameMaking!

Exceptions, Try, Catch and Finally

The final new language feature that has been added in the 2.3 update that we want to discuss here is the ability to control to a much greater degree how errors are handled when they are encountered in your code as well as the ability to generate your own error messages.

To start with we have the new operator, which — as the name implies — can be used to «throw» a runtime error message. This has the following syntax:

The expression used can be a value or a string or any other data type, and this will then generate an exception error which is — by default — shown on the screen, and on closing the error message the game will end. For example calling this:

will cause the following unhandled exception error to be shown:

This is the default way the error can be handled, but you can «take over» this error message and use your own handler code by calling the new function . This runtime function permits you to supply a custom method to use that will be called whenever any unhandled exceptions occur in your game.

Apart from the ability to throw your own errors and handle them using functions, we also have the new , , and operators. These can be used in your game for error checking and permit you to test out blocks of code and control what happens if any runtime exceptions occur. Using these will prevent the exception ending the game and will also prevent showing the standard error message to the user, but this means that you will have to handle what happens next in this case, like — for example — saving out log files and ending the game gracefully (note that if you choose to do nothing, your game may become unstable and not perform correctly).

At it’s most basic the syntax is as follows:

However, having a without anything to actually handle any exceptions the code may produce will not be very helpful, so we usually pair it with a , with the following syntax:

What does is permit you to run extra code supplied in the following block when an exception from the previous has been caught. If this is a runtime exception, then the supplied variable can be used to access a struct which will contain the following information:

A simple example of use is shown below:

It may be that you want to run some code regardless of whether an exception was thrown or not, and so for that you can add in a block. The syntax is:

It is worth noting that you can have any combination of these together, ie: / , / or / / , and that within the block you cannot use , , or statements as they have no meaning in this context and the compiler will generate an error if they are used.

Runtime Changes

Many functions have been added in GameMaker Studio 2, the following sections outline those that have been added and those that have been removed, please consult the manual (Help -> Open Manual) for further info.

Our Windows Desktop Runner has also changed from using DX9 to using DX11 this may mean that there are some compatibility issues that may need to be addressed, there are some known issues at present

  • No Anti Aliasing implemented — all functions return 0 for the number of anti aliasing levels, we will implement this in the future
  • Line drawing — unfortunately line drawing is not consistently implemented by hardware vendors, this means that between different manufacturers and different drivers from the same manufacturer you may get different results, we reccomend that you do not rely on line drawing in released games, but the functions are still there for you to try.
  • Windows XP is no longer supported for games created using GameMaker Studio 2.

Tilemaps and Tiles

  • tilemap_tileset(tilemap_element_id,tileset) — set the tileset to use for the tilemap element
  • tilemap_x(tilemap_element_id,x) — set the x position of the tilemap element
  • tilemap_y(tilemap_element_id,y) — set the y position of the tilemap element
  • tilemap_set(tilemap_element_id,tiledata,cell_x,cell_y) — set the tiledata at the cell (x,y) position on the tilemap element
  • tilemap_set_at_pixel(tilemap_element_id,tiledata,x,y) — set the tiledata at the pixel (x,y) position on the tilemap element
  • tilemap_get_tileset(tilemap_element_id) — get the tileset used for the tilemap element
  • tilemap_get_tile_width(tilemap_element_id) — get the tile width of the tilemap element
  • tilemap_get_tile_height(tilemap_element_id) — get the tile height of the tilemap element
  • tilemap_get_width(tilemap_element_id) — get the width (in tiles) of the tilemap element
  • tilemap_get_height(tilemap_element_id) — get the height (in tiles) of the tilemap element
  • tilemap_get_x(tilemap_element_id) — get the x position of the tilemap element
  • tilemap_get_y(tilemap_element_id) — get the y position of the tilemap element
  • tilemap_get(tilemap_element_id,cell_x,cell_y) — get the tiledata for the cell at (cell_x, cell_y) on this tilemap element
  • tilemap_get_at_pixel(tilemap_element_id,x,y) — get the tiledata for the pixel at (x, y) on this tilemap element
  • tilemap_get_cell_x_at_pixel(tilemap_element_id,x,y) — get the cell x for the pixel at (x, y) on this tilemap element
  • tilemap_get_cell_y_at_pixel(tilemap_element_id,x,y) — get the cell y for the pixel at (x, y) on this tilemap element
  • tilemap_clear(tilemap_element_id,tiledata) — clear all the cells in the tilemap element with the given tiledata
  • draw_tilemap(tilemap_element_id,x,y) — draw the tilemap at position x, y in the current view
  • draw_tile(tileset,tiledata,frame,x,y) — draw the given tiledata from the tileset using given frame at position x, y in the current view
  • tilemap_set_global_mask(mask) — set the current rendering global mask for ALL tilemap elements (allows user to reserve bits in the tiledata as renderer can be set to ignore them using this function) NOTE:this does not affect get/set tiledata functions above
  • tilemap_get_global_mask() — get the current global mask
  • tilemap_set_mask(tilemap_element_id, mask) — set the current rendering mask for this tilemap element (allows user to reserve bits in the tiledata as renderer can be set to ignore them using this function) NOTE:this does not affect get/set tiledata functions above
  • tilemap_get_mask(tilemap_element_id) — get the current rendering mask
  • tilemap_get_frame(tilemap_element_id) — get the current frame number for the tilemap element
  • tile_set_empty(tiledata) — set the tiledata to be an empty cell, returns modified tiledata
  • tile_set_index(tiledata,tileindex) — set the tileindex to use on a given tiledata, returns modified tiledata
  • tile_set_flip(tiledata,flip) — enable or disable the flip flag on tiledata, returns modified tiledata
  • tile_set_mirror(tiledata,mirror) — enable or disable the mirror flag on the tiledata, returns modified tiledata
  • tile_set_rotate(tiledata,rotate) — enable or disable the rotate flag on the tiledata, returns modified tiledata
  • tile_get_empty(tiledata) — returns true if tiledata is empty
  • tile_get_index(tiledata) — returns the index of the tile from tiledata
  • tile_get_flip(tiledata) — returns the flip flag of the tiledata
  • tile_get_mirror(tiledata) — returns the mirror flag of the tiledata
  • tile_get_rotate(tiledata) — returns the rotate flag of the tiledata

Версии приложения

Изначально была одна версия программы, но впоследствии приложение разделилось на две редакции: упрощенную (Lite) и профессиональную (Pro). Профессиональная версия расширяет возможности игрового редактора, добавляя, например, функции:

  • создания многопользовательского режима;
  • импортирования и экспортирования ресурсов для совмещения разных проектов;
  • продвинутого редактирования изображений и анимаций;
  • расширенных средств программирования.

Профессиональная редакция также может работать в Windows 7 и других версиях. При запуске в ней отсутствуют всплывающие надписи, призывающие к обновлению до версии Pro, а в создаваемых программах нет логотипов.

Разделение приложения на Lite и Pro актуально для версии 8.0.

Для начинающих

Game maker studio подойдет для амбициозных людей с интересными идеями по созданию прототипа игры. Сейчас большая проблема хорошей идеи для создания игры является в её реализации, так как для этого необходимо знания языков программирования. Этот движок даёт возможность создания игры без прибегания к программированию, написанию скриптов.

Очень хорошо подойдет для первого тестового создания механики задуманной игры, так как главное для начала понять интересен ли будет сам gameplay, и только после тестирования можно будет приступать к подробному созданию и улучшению графической части игры. Вот для таких целей и подойдет Game maker studio, она даёт возможность быстро и легко реализовать такого рода задачу.

Drag and Drop (DnD ) это графическая среда разработки, которая идеально подходит для начинающих или тех, кто более визуально или художественно ориентированы. С помощью DnD возможно создать игры без написания скриптов, используя только интерфейс программы.

Так же для начинающих в работе Game maker studio поможет русифицированный интерфейс, который можно найти на форумах этого движка. На официальном так же присутствует большое количество документации и инструкций по работе с движком.

Обзор интерфейса

Последней версией Game maker studio №1 была 8.1.140, на сегодняшний день она перестала поддерживаться, так была выпущена новая версия Game maker studio 2.

Так же на официальном форуме можно скачать русификатор для движка.

Ссылка на русификатор: Google drive

После того как вы скачали и установили Game maker studio запускаем его и в окне вводим данные, которые зарегистрировали на официальном сайте при скачивании. После ввода данных нам открывается интерфейс движка.

Так как мы используем бесплатную версию программы, категория «Изучение» нам не будет доступна.

Для того, чтобы начать разработку игры, нажимаем на кнопку «Создать» и в следующем окне «Drag and Drop» после чего откроется окно, в котором нужно придумать название проекта и сохранить в удобное для вас место.

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

Для того что бы начать работать и создавать объекты нам нужно будет нажать правой кнопкой по пустому пространству, и выбрать пункт «Ресурсы». В выпавшем окне выбираем с создания чего будем начинать разработку.

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

Для создания карты нам нужно выбрать «Ресурсы», а затем в выпавшем окне «Создать комнату». В редакторе комнаты предоставляются возможности задать размер, фон, установить элементы взаимодействия, разместить персонажей, нарисовать пути и т.д. В редакторе комнаты так же можно импортировать уже готовый фон или создать его саму с помощью этого редактора.

Создание событий можно произвести без обращения к программированию и созданию скриптов, все делается с помощью довольно интуитивно понятных меню и окон. Можно продумать и создать довольно сложные сценарии действий для объекта с помощью визуального редактора Game maker studio.

С помощью параметров можно выбрать платформу для которой создается игра и провести тонкие настройки игры, такие как размер окна для воспроизведения игры, версии, ярлыки, заставки при загрузке и т.п.

Стоит заметить часть программы, в которой нам дается возможность работать с кодом на языке GML. Очень радует та легкость, с которой простые командные функции могут быть сделаны. Поэтому если вы начинающий Game creator и готовы посвятить этому большую часть времени, тогда вам просто необходимо заняться изучением языка GML.

GPU functions

  • gpu_set_blendenable(enable) — enable or disable the gpu blending
  • gpu_set_ztestenable(enable) — enable or disable the gpu ztest
  • gpu_set_zfunc(cmp_func) — set the gpu z compare function (one of cmpfunc_never, cmpfunc_less, cmpfunc_equal, cmpfunc_lessequal, cmpfunc_greater, cmpfunc_notequal, cmpfunc_greaterequal, cmpfunc_always, default is cmpfunc_lessequal)
  • gpu_set_zwriteenable(enable) — enable or disable the gpu z write enable
  • gpu_set_fog(enable,col,start,end) — enable or disable the fog used in the default shader setting the colour and the start and end depths
  • gpu_set_cullmode(cullmode) — set the gpu cull mode (one of cull_noculling, cull_clockwise, cull_counterclockwise)
  • gpu_set_blendmode(mode) — set the gpu blend mode (one of bm_normal, bm_add, bm_max, bm_subtract)
  • gpu_set_blendmode_ext(src,dest) — set the gpu blend mode where source or dest could be (one of bm_zero, bm_one, bm_src_colour, bm_inv_src_colour, bm_src_alpha, bm_inv_src_alpha, bm_dest_alpha, bm_inv_dest_alpha, bm_dest_colour, bm_inv_dest_colour, bm_src_alpha_sat)
  • gpu_set_blendmode_ext_sepalpha(src,dest,srcalpha,destalpha) — set the gpu blend mode where the source and destination blendmodes are set separately and the src alpha and dest alpha blend modes can be different (each param is one of bm_zero, bm_one, bm_src_colour, bm_inv_src_colour, bm_src_alpha, bm_inv_src_alpha, bm_dest_alpha, bm_inv_dest_alpha, bm_dest_colour, bm_inv_dest_colour, bm_src_alpha_sat)
  • gpu_set_alphatestenable(enable) — enable or disable the gpu alpha test
  • gpu_set_alphatestref(value) — set the gpu alpha test reference value (default value is 0)
  • gpu_set_texfilter(linear) — set the gpu filter type for default sampler (0)
  • gpu_set_texfilter_ext(sampler_id,linear) — set the gpu filter type for specified sampler
  • gpu_set_texrepeat(repeat) — enable or disable the gpu texture repeat for the default sampler (NOTE: sets both u and v repeats)
  • gpu_set_texrepeat_ext(sampler_id,repeat)- enable or disable the gpu texture repeat for the specified sampler (NOTE: sets both u and v repeats)
  • gpu_set_colourwriteenable(red,green,blue,alpha) — enable or disable the gpu writing to destination channels individually
  • gpu_set_colorwriteenable(red,green,blue,alpha) — enable or disable the gpu writing to destination channels individually
  • gpu_get_blendenable() — get the current state of gpu blending
  • gpu_get_ztestenable() — get the current state of gpu z test
  • gpu_get_zfunc() — get the current value for gpu z function
  • gpu_get_zwriteenable() — get the current state of gpu z writing
  • gpu_get_fog() — get the current state of gpu fog (returns an array with entries — enable/disable, -colour, — start value, — end value)
  • gpu_get_cullmode() — get the current value for the gpu cullmode
  • gpu_get_blendmode() — get the current gpu blendmode value
  • gpu_get_blendmode_ext() — get the current gpu blendmode (array with — src blend, — dest blend)
  • gpu_get_blendmode_ext_sepalpha() — get the current gpu blendmode (array with — src blend, — dest blend, — src alpha blend, — dest alpha blend)
  • gpu_get_blendmode_src() — get the current gpu source blend value
  • gpu_get_blendmode_dest() — get the current gpu destination blend value
  • gpu_get_blendmode_srcalpha() — get the current gpu source alpha blend value
  • gpu_get_blendmode_destalpha() — get the current gpu destination alpha blend value
  • gpu_get_alphatestenable() — get the current status of gpu alpha enable/disable
  • gpu_get_alphatestref() — get the current gpu alpha test reference value
  • gpu_get_texfilter() — get the current gpu texture filter status for default sampler (0)
  • gpu_get_texfilter_ext(sampler_id) — get the current gpu texture filter status for specified sampler
  • gpu_get_texrepeat() — get the current status gpu texture repeat for default sampler
  • gpu_get_texrepeat_ext(sampler_id) — get the current status gpu texture repeat for specified sampler
  • gpu_get_colorwriteenable() — get the current state of the gpu color write enable (array with — red, — green, — blue, — alpha)
  • gpu_get_colourwriteenable() — get the current state of the gpu colour write enable (array with — red, — green, — blue, — alpha)
  • gpu_push_state() — push the current gpu state onto an internal gpu state stack
  • gpu_pop_state() — pop the entry from the top of the gpu state stace and make it current
  • gpu_get_state() — get the current gpu state as a map (returns a map id)
  • gpu_set_state(map) — set the current gpu state to the state stored in given map

Становимся профессионалом

Несколько GameMaker игр стали коммерчески успешными, и есть много других великолепных GameMaker игр, которые являются прекрасными примерами того, что возможно создать используя GM:S.

Отточеные игры

Spelunky — оригинальная версия Spelunky была создана в GameMaker; более новая XBLA версия и новая ПК-версия игры, нет. Это коммерческий успех, версия, созданная в GameMaker, бесплатная.

A Nation of Wind — эта игра скрытый драгоценный камень и в нее стоит определенно поиграть.

Dustforce — вышла в Steam, это не был огромный коммерческий успех, но тем не менее, это отличная игра!

Chained Accessors

Another change to GML is the ability to chain accessors. Much like you can now chain arrays together, you can chain the different Data Structure accessors together too, making accessing the data from nested structures much easier.

A simple example of this would be a DS grid, where each grid entry is a ds list. Previously you’d have to first retrieve the index of the list from the grid, and then access the data in the list, but now it’s as simple as doing something like this:

This would retrieve the data from the 6th position in the DS list that is being held in the grid (0, 0) position. Other examples of use are:

Summary

As you may imagine, this is a rather important update to GameMaker Studio 2 with a lot of new features and a lot of changes «under the hood» to make life easier and to make the product easier to use and more compatible with things like source control. We’ve said it already during in this blog post, but it’s worth repeating… read the manual! This is especially important when starting to use the new Sequences asset, as the editor has a lot to it and — especially if you are not an artist or have never used any kind of animation or video editing software — it can be a bit overwhelming to start with. However, we think this is an incredibly powerful tool and opens up GameMaker Studio 2 in a big way to people who are less experienced with code and who prefer a more visual approach to making games.

One final thing should be said about importing pre-2.3 projects. On importing a project made with a version of GameMaker Studio 2 prior to this update, you will be prompted to save the project again using a new name before continuing. This is absolutely essential as the changes made to the project file format are not backwards compatible and once you update a project to 2.3 it can’t be loaded into previous versions, so it’s a good idea to keep separate folders for pre and post 2.3 versions of any game you are working on.

Thanks for reading and we can’t wait to see what you all do with the new features!

Happy GameMaking!

Maths

  • matrix_build_identity() — return an identity matrix
  • matrix_build_lookat(xfrom,yfrom,zfrom,xto,yto,zto,xup,yup,zup) — builds a «look-at» (view) matrix for a camera at position (xfrom, yfrom, zfrom) and looking at a point (xto, yto, zto) with an up vector of (xup, yup, zup)
  • matrix_build_projection_ortho(width,height,znear,zfar) — build an orthographic projection matrix with width, height and a z range from znear to zfar
  • matrix_build_projection_perspective(width,height,znear,zfar) — build a perspective matrix with width, height and a z range from znear to zfar
  • matrix_build_projection_perspective_fov(fov_y,aspect,znear,zfar)- build a perspective matrix with field of view ange fov_y and an aspect ration and a z range from znear to zfar
  • matrix_transform_vertex(matrix, x, y, z, ) — multiply the given vector (x,y,z,w) by the matrix NOTE: if no w component given then it is treated as 1
  • matrix_stack_push(optional_matrix) — push matrix onto the matrix stack
  • matrix_stack_pop() — pop matrix from the top of the matrix stack
  • matrix_stack_set(matrix) — set the given matrix as the top of the matrix stacl
  • matrix_stack_clear() — clear the matrix stack
  • matrix_stack_top() — return the value at the top of the matrix
  • matrix_stack_is_empty() — return true if matrix stack is empty, false otherwise
Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector