The layout view

Поведения

Ниже вы увидите самое интересное окно, “Behaviours”. Здесь вы найдете интересные встроенные элементы движка – предустановленную физику, управление, элементы спецэффектов. Взгляните на скриншот, чтобы оценить масштабы конструктора (здесь показаны не все поведения).

Главная особенность этого конструктора в том, что он имеет так называемые “Поведения (Behaviours)”. Ведь именно они помогают обрести игре физику, управление или даже все и сразу. Давайте рассмотрим, что же делают некоторые из них.

Первый в списке “Jump through” — это поведение делает блок полупроходимым. То есть, в игре-платформере вы сможете запрыгнуть на него снизу, но верхняя сторона будет твердая. А “Solid” делает объект полностью твердым.

“Anchor” позиционирует объект строго относительно заданной точки. “Bound to layout” помогает удержать объекты в границах сцены, они не выпадут за ее пределы. Среди поведений также можно найти популярную вариацию управления, “Drag & Drop”, она позволяет перетаскивать объекты при помощи мышки.

Есть поведение, которое помогает плавно убавлять или же прибавлять непрозрачность объекта. Поведение “Flash” делает объекта мигающим, “Pin” прикрепляет объект к чему нибудь. “Scroll to”, это слежение за объектом. Допустим, если добавить это поведение к двигающемуся персонажу, то камера будет постоянно за ним следить.

“Wrap” — при помощи этого Behaviour’а объекты дошедшие до края сцены выходят с другой стороны.

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

Мы рассмотрели лишь вкратце и лишь некоторые из поведений. Встроенных поведений больше, и их они имеют настраиваемые параметры. Лучший способ узнать их все – это попробовать конструктор в действии.

Basic usage

To access in-app purchasing features, the basic usage is as follows:

  1. On start of layout, use the Add product ID action to add the product IDs you will be using, e.g. «product1,product2,product3».
  2. After that (still in the ‘Start of layout’ event), use the Request store listing action. This starts downloading the names and prices of the given products. Some platforms require this information to be available for the IAP features to work.
  3. When On store listing success triggers, the product names and prices are available, and purchases can start being made or checked with the Has product condition.

Multiplayer features

The Multiplayer object supports a number of features to enable low-latency gameplay over the Internet:

  • UDP-based transmission for minimal latency avoiding head-of-line blocking, with optional reliable modes
  • NAT traversal to connect through common router/network setups
  • Compensation for poor quality connections with high latency, packet delay variation (PDV), and packet loss
  • Interpolation and extrapolation modes to ensure smooth in-game motion
  • Scirra-hosted signalling server to connect peers to each other
  • Authoritative host model to prevent cheating, with local input prediction to hide input latency
  • LAN game support for near-zero latency gameplay, including support for mixed LAN/Internet games
  • Automatic bandwidth reduction when objects are not changing, avoiding redundant repeated transmissions of identical data
  • Binary transmission with control over specific datatypes to minimise bandwidth
  • Latency and packet loss simulation for realistic local testing
  • Support for lag compensation
  • Support for both peer-to-peer games (not needing a server) and centrally-hosted games (using a server)

Platform info conditions

Is Cordova export
True when running after a Cordova-based export. Cordova is used to export Android and iOS apps, and implies that the platform is mobile and the OS is either Android or iOS.
Is NW.js export
True when running after an NW.js export.
Is web export
True when running after a web-based export. This is also true in preview mode, so that any features based on these export conditions will act as if it’s in a web-based export in preview mode.
Is Windows UWP export
True when running after a Windows UWP export. The Universal Windows Platform (UWP) is used for apps in the Microsoft Store and publishing to Xbox One.
On network change
Triggered when the network connection changes, e.g. when moving from a Wifi network to a cellular data network. The network-related expressions will update in this trigger to reflect values for the new network.
Is on Android
Is on Chrome OS
Is on iOS
Is on Linux
Is on macOS
Is on Windows
These conditions check which operating system (OS) the project is currently running on. For example in Chrome on Windows, Is on Windows will be true; in an Android app, Is on Android will be true; and so on. Note these conditions are not exhaustive: there may be platforms where none of these six conditions are true.
Is on mobile
Test if the current operating system is classed as mobile, i.e. a phone or tablet. The detection may not always be accurate, but should always be true on iOS and Android, and false on Windows, macOS, Linux and Chrome OS.
Is wake lock active
True if a Request wake lock action has successfully completed and the screen is currently being kept on.
Is wake lock supported
True if the current browser/platform supports using wake locks to keep the screen on.
On wake lock acquired
Triggered after the Request wake lock action if the lock was successfully acquired. The screen will be kept on until On wake lock released triggers.
On wake lock error
Triggered if an error occurs while attempting to request a wake lock. The screen will not be kept on.
On wake lock released
Triggered when an existing wake lock is released, meaning the screen may once again automatically turn off due to inactivity. This can happen after a Release wake lock action, or automatically in some circumstances, such as if the browser tab or app goes in to the background. To keep the screen on after this trigger, another wake lock must be requested.

Scrolling and zooming

There are a few ways to scroll in the Layout View:

  • The vertical and horizontal scrollbars at the edges of the view
  • Scroll the mouse wheel to scroll vertically. You can also hold Shift to scroll horizontally.
  • Hold the middle mouse button and drag the mouse
  • Hold Space and move the mouse (useful for laptops with track pads)

On desktop systems, middle-mouse dragging is probably the most convenient way to move around the layout.

Zooming is useful to focus on a small area or see an overview of the entire layout. There are several ways to zoom:

  • The Zoom options in the View menu when right-clicking in the Layout View
  • Hold Control and scroll the mouse wheel. Hold both Control + Shift to double or halve the zoom (e.g. 100%, 200%, 400%…)
  • Ctrl and + or — on the keyboard. Hold Shift to double or halve the zoom.

Press Control + to return to 100% zoom.

Описание программы

layout (макет)

По-умолчанию уже есть один layout (макет). Для начала этого достаточно. Другие макеты нужны для заставки, следующего уровня и пр. Можно указать размеры игрового поля.

layer (слой)

По-умолчанию уже есть один layer (слой). В принципе этого достаточно, но для красоты отображения мы с детьми сделали 4 слоя (именно в следующем порядке!):

1. Неподвижный. Свойство parallax=0 («не двигаться»). Используется для вывода информации (набранные очки, уровень жизни и пр.)

2. Передний (он же по умолчанию). Свойство parallax=100 («двигаться обычно»). Все основные объекты

3. Средний. Свойство parallax=80-90 («двигаться чуть медленней»). Неигровые объекты сзади (например, деревья). Аркадным играм (вид сбоку) придает псевдо-объем, для вида сверху этот слой не нужен

4. Задний (фон). Свойство parallax=60-80 («двигаться медленно»). Аркадным играм (вид сбоку) придает псевдо-объем, для вида сверху parallax=100.

Video properties

WebM source
Ogg Theora source
H.264 source
Names of the project files for the video in different formats. For more information, see Video formats above.
Autoplay
The autoplay or preload mode. This can be: No: nothing is done until the video is requested to be played. Preload: on startup the video will start downloading the video data, but will not start playing it yet. This can allow video playback to start more quickly when requested. Some platforms (e.g. mobile devices on cellular data connections) may ignore this. Yes: on startup the video will start downloading the video data, and also start playing it as soon as it determines the progress and transfer rate are sufficient to play through to the end without stalling for buffering. Some mobile platforms will not start playing until the first touch event — see Compatibility for more information.
Play in background
If No, then switching browser tab, minimising the browser window, switching to a different mobile app, or otherwise hiding the window will pause the video and resume it when switching back. This is intended to avoid annoying the user with continued audio playback when deciding to do something else, and it also helps save battery on mobile devices. However for some types of app it may be desirable to keep playing in the background, in which case setting to Yes allows continued playback even when in the background.
Initial visibility
Whether the video is initially visible or invisible. Note that if it is invisible, audio playback may still be heard when playing, so it may be desirable to also mute the video.

System

ImageMemoryUsage
Returns the estimated total memory usage, in megabytes, of all the currently-loaded images. Only supported in the WebGL renderer; if canvas2D rendering is in use, the expression always returns 0. Note image memory is sometimes also referred to as «VRAM», but this is not strictly correct since not all devices have video-specific memory. Also remember this expression does not include the memory use of sounds, code, or other non-image resources.
loadingprogress
Return the current load progress on a loader layout, or the current update progress while the Browser object’s Is downloading update condition is true. The progress is returned as a number from 0 to 1, e.g. 0.5 for half complete. For more information, see the tutorials how to make a custom loading screen and offline games in Construct 2.
loopindex
Get the index (number of repeats so far) in any currently running loop.
loopindex(name)
Get the index (number of repeats so far) of the loop with the given name. Useful for getting indices in nested loops.
objectcount
The total number of objects currently created.
projectname
Return the name of the project as it appears in Project Properties.
projectversion
Return the version entered in to Project Properties. Note that this is always returned as a string, not a number.
renderer
The name of the renderer used to draw the game, currently either canvas2d or webgl. See Technology for more information on canvas renderers.
rendererDetail
The name of the graphics hardware in use to draw the game, such as «NVIDIA GeForce GTX 660» or «Adreno 330». This is only available in WebGL mode in certain browsers and platforms; unsupported browsers/systems will return «(unavailable)». Projects should not rely on this string having any exact contents, but it can be useful to diagnose which GPU is in use in dual-GPU systems, or to look for keywords and apply default graphics settings based on the type of hardware.

Math

These expressions are simply ordinary math functions like you find on calculators. However, note that all functions using an angle take it in degrees, not radians. Angles start with 0 degrees facing right and increment clockwise.

sin(x), cos(x), tan(x), asin(x), acos(x), atan(x) Trigonometric functions using angles in degrees.

abs(x) Absolute value of x e.g. = 5

angle(x1, y1, x2, y2) Calculate angle between two points

anglelerp(a, b, x) Linearly interpolate the angle a to b by x. Unlike the standard lerp, this takes in to account the cyclical nature of angles.

anglediff(a1, a2) Return the smallest difference between two angles

anglerotate(start, end, step) Rotate angle start towards end by the angle step, all in degrees. If start is less than step degrees away from end, it returns end.

ceil(x) Round up x e.g. = 6

cosp(a, b, x) Cosine interpolation of a to b by x. Calculates (a + b + (a — b) * cos(x * 180°)) / 2.

cubic(a, b, c, d, x) Cubic interpolation through a, b, c and d by x. Calculates lerp(qarp(a, b, c, x), qarp(b, c, d, x), x).

distance(x1, y1, x2, y2) Calculate distance between two points

exp(x) Calculate e^x

floor(x) Round down x e.g. = 5

infinity A floating point number value representing infinity.

lerp(a, b, x) Linear interpolation of a to b by x. Calculates a + x * (b — a).

unlerp(a, b, y) Reverse linear interpolation: if lerp(a, b, x) = y, then unlerp(a, b, y) = x. Calculates (y — a) / (b — a).

ln(x) Log to base e of x.

log10(x) Log to base 10 of x.

max(a, b ), min(a, b ) Calculate maximum or minimum of the given numbers. Any number of parameters can be used as long as there are at least two.

pi The mathematical constant pi (3.14159…)

qarp(a, b, c, x) Quadratic interpolation through a, b and c by x. Calculates lerp(lerp(a, b, x), lerp(b, c, x), x).

round(x) Round x to the nearest whole number e.g. = 6

sign(x) Retrieve the sign of x: -1 for any negative number, 1 for any positive number, or 0 if x is zero.

sqrt(x) Calculate square root of x e.g. = 5

getbit(x, n)
Get the nth bit of x represented as a 32-bit integer. For example will get the least significant bit of the number 7 when represented as a 32-bit integer. Returns either 0 or 1.
setbit(x, n, b)
Set the nth bit of x represented as a 32-bit integer to b (either 0 or 1). The resulting 32-bit integer is returned.
togglebit(x, n)
Toggle the nth bit of x represented as a 32-bit integer. If that bit is 0, it is set to 1; if it is 1, it is set to 0. The resulting 32-bit integer is returned.

Parameters

When calling a function, you can also pass parameters. These are simply numbers or strings that are made available to the function. For example, the CreateEnemy function from the previous example could be modified to take two parameters: the X and the Y co-ordinates at which to create the enemy. This helps functions to be made more general purpose by using extra information from the action calling the function.

To add a parameter to a function call, click the Add parameter link that appears in the Parameters dialog when editing the Call function action. This is a special link that only appears for this action in the Function object. Inside an On function event, you can then use the Param expression with the zero-based index of the parameter to retrieve the corresponding value.

1: File menu and Ribbon tabs

Construct 2 uses a ribbon interface, which is like a tabbed toolbar similar to Office 2007 and newer. The blue button with the drop-down arrow is the File menu, and to the right of that are ribbon tabs which drop down the ribbon bar with various buttons and options.

There’s also the quick-access toolbar with the four most commonly used commands: Save, Undo, Redo, Preview and Debug. You can add and remove buttons to this toolbar yourself: click the small drop-down arrow to its right to customise it. If you want to have a lot of commands in this toolbar you can also opt to have it shown beneath the ribbon.

Platform info expressions

DeviceMemory
Return the approximate amount of device memory (RAM) in gigabytes. For privacy reasons some platforms will round the result, so it may not match the exact amount installed on the system. Additionally this value is not available on some browsers or platforms, in which case it will return 0.
HardwareConcurrency
Return the number of hardware threads supported by the CPU. This is normally at least the number of CPU cores. Many modern CPUs support multiple hardware threads on a single CPU (e.g. Hyper-threading), and a common case is for each CPU to support two hardware threads, so this is often double the number of CPU cores. For privacy reasons some platforms will round the result, so it may not match the exact number of hardware threads/CPU cores available on the system. If the value is not available, it will return 0. However almost all consumer devices have at least two CPU cores.
CanvasCssWidth
CanvasCssHeight
Return the size of the main display canvas in CSS pixels. This does not correspond exactly to device (physical display) pixels, but is the appropriate size from a web design perspective in units.
CanvasDeviceWidth
CanvasDeviceHeight
Return the size of the main display canvas in device (physical display) pixels. Unlike the CSS size, this size reflects the number of actual pixels used in the display.
DevicePixelRatio
Return the number of device (physical display) pixels per CSS pixel. For example a high-DPI display may have a device pixel ratio of 2, meaning there are two device pixels per CSS pixel. This value also reflects the browser zoom level, which works by adjusting the device pixel ratio. The concept of the device pixel ratio also allows web pages using units to appear the same size on higher density displays where physical pixels are much smaller.
Renderer
Return a string indicating the graphics rendering technology in use. This can be either or . It can also have a suffix if a «major performance caveat» is detected, which is a WebGL flag that normally indicates slower software rendering, typically due to unreliable GPU drivers. For example, software-rendered WebGL 1 support would return .
RendererDetail
Return a string describing system-specific detail about the graphics hardware in use. This typically describes the GPU manufacturer and model name, and sometimes some hardware capabilities.
SafeAreaInsetLeft
SafeAreaInsetTop
SafeAreaInsetRight
SafeAreaInsetBottom
The inset around the edges of the screen in CSS pixels of a rectangular area that is always visible (hence safe to use for displaying anything important without it risking being cut off). This only applies for devices with non-rectangular screens, notably mobile devices with a notch, or in some cases devices with rounded edges in the corners of the screen. Devices with a standard rectangular display will return 0 for these values.
ScreenWidth
ScreenHeight
Get the size of the current display screen. Note this often includes areas not available to applications, such as a desktop taskbar, or mobile status bar.
WindowInnerWidth
WindowInnerHeight
Get the inner size of the current window. This is the size of the window content area that is available to the application.
WindowOuterWidth
WindowOuterHeight
Get the outer size of the current window. This includes the window browser, caption, browser address bar etc. which is not generally available to the application.
ConnectionEffectiveType
Return a string rating the effective type of the connection based on the comparable cellular data connection generation, e.g. , , .
ConnectionRTT
Return the estimated round-trip time (latency) of the connection in milliseconds. This is the time it takes for a network message to be sent to the remote host and a reply to be received back.
ConnectionType
The type of network connection technology in use, e.g. , or . If the connection type cannot be detected or the platform does not support this feature, returns .
Downlink
The estimated effective download bandwidth in megabits per second. Returns 0 if unable to detect.
DownlinkMax
The maximum downlink speed in megabits per second of the underlying connection technology. This is normally the theoretical maximum the current network technology’s specification allows, for example 4G cellular allows a higher maximum speed than 3G under ideal signal conditions; however the actual available bandwidth will depend on other factors like signal quality and other parts of the network. Returns 0 if unable to detect.

General

Compare two values
Compare any two expressions (which can either numbers or text) with each other. They can be compared as Equal, Not equal, Less, Less or equal, Greater or Greater or equal.
Every tick
A condition which is always true. Used on its own, this has the same effect as running every time it is checked, which is once per tick, hence the name «Every tick». This is about 60 times a second on most computers; see how events work for more information. Adding Every tick to an event with other conditions is redundant and has no effect at all.
Is between values
Test if a number is between two values (greater or equal to a lower value and less or equal to a higher value).
Is group active
Test if a group of events is active or inactive. The name of the group is used to identify it.
Is number NaN
Test if a number is equal to NaN (Not A Number), a special value returned by calculations which cannot be represented as a real number, such as the square root of -1.
Is value type
Check if a value is a number or a string.
Object UID exists
Test if an object exists with the given Unique ID (UID). For more information on UIDs, see common features.
Test regex
Test if a given string matches a regular expression with flags. This only returns a true or false result, so to make more advanced use of regular expressions, see the Regex… system expressions.

Как пользоваться приложением

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

Загрузка и установка

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

  1. Переходим в раздел «Скачать», который располагается ниже в статье и кликаем по прикрепленной в нем ссылке. Здесь содержится уже взломанная версия утилиты.
  2. Запускаем установщик. Читаем и принимаем условия пользовательского соглашения.
  3. Выбираем путь установки приложения.
  4. Ждем, пока закончится процесс распаковки файлов на компьютер.

Никаких дополнительных действий не потребуется. Кряк и русификатор уже содержатся в архиве.

Инструкция по работе

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

  1. Создаем новый проект. Это можно сделать по шаблону или задав нужные параметры.
  2. При желании можно ввести подробную информацию о будущей игре, например, название самого проекта, имя автора, описание и другое.
  3. Следующий шаг – создание первого уровня с помощью применения различных объектов, содержащихся в библиотеке приложения.
  4. Выбор внешнего оформления персонажей и предметов первого уровня.
  5. Сохранение проекта.

Selection wrapping

If you select two or more objects, you can wrap the selection by pressing Enter or right-clicking and selecting Wrap selection. This allows you to rotate and stretch the selection as a whole.

Wrapped selections appear with a different color selection box, as shown below:

Wrapped selections can be resized and rotated as if they are one large object. For example the selection can be enlarged and rotated, and all objects maintain their position relative to each other.

While a selection is wrapped, click any of the objects in the wrapped selection to make that object the rotation origin.

Containers

Objects that are grouped in to Containers highlight yellow in the Layout View. Containers can also be set to automatically wrap their selection. If you still need to select an individual object in an automatically wrapped selection, hold Alt and click one of the objects.

Video actions

Pause
Pause the video playback if it is currently playing.
Play
Start playing the video. On some platforms this can only happen in a user input event. For more information, see the section on Compatibility.
Set looping
Set whether the video is looping, so that it restarts from the beginning when it reaches the end.
Set muted
Set whether the audio playback from the video is muted (inaudible) or unmuted.
Set playback time
Set the video playback time to a specific time in seconds (i.e. seek to the given time). Due to the way video encoding technologies work, the video may only be able to seek close to but not exactly on the specified time.
Set source
Set a different video file to play. As with the object properties, three formats can be specified. Setting the source does not automatically start playing the video; use the Play action to start it after changing the source.
Set volume
Set the volume of the audio playback from the video, in decibels attenuation. 0 is full volume, -10 dB is approximately half as loud, etc. The audio cannot be amplified: positive volume values will be treated as 0.

Layout

CanvasSnapshot
Contains the resulting image from a Snapshot canvas action after On canvas snapshot has run. (Note this expression is not available immediately after the Snapshot canvas action — you can only use it after On canvas snapshot triggers.) The expression returns a data URI of the image file. This can be loaded in to a Sprite or Tiled Background object via Load image from URL, sent to a server or stored locally, or opened with the Browser object in a new tab to save to disk.
LayoutAngle
Get the angle, in degrees, of the current layout. This does not include the rotation of individual layers.
LayoutScale
Get the current scale of the entire layout set by the Set layout scale action. This does not include the scaling of individual layers.
LayoutWidth
LayoutHeight
Get the size of the current layout in pixels.
LayoutName
Get the name of the current layout.
scrollx
scrolly
Get the current position the view is centered on.

Особенности

Конструктор игр Construct 2 имеет множество особенностей. В частности, чтобы создавать игры на нем, не нужно знать каких-либо языков программирования, достаточно базовых знаний математики и английского языка. Второй особенностью является простой и компактный интерфейс, в котором легко разобраться.

Нельзя обойти такую особенность, как легко настраиваемая физика игровых обьектов, доступная буквально в пару кликов. То есть, движок Box2D уже встроен в этот конструктор.

Также, в Констракте есть еще одна довольно примечательная черта — Behaviours(Поведения), они помогают настраивать физику, управление, и другие игровые аспекты буквально за одну минуту. Behaviour – это такая штука, которую вы можете добавить к игровому обьекту. Например, добавив физический Behaviour к обьекту, этот обьект начнет вести себя как реальное физическое тело, на него будет действовать сила тяжести, у него появится инерция.

С этим конструктором-движком можно вполне разобраться за пару недель. Про этот конструктор еще говорят, что на нем можно сделать платформер буквально за час. Вот одно из многочисленных видео на эту тему:

Keyboard expressions

LastKeyCode
Retrieve the key code of the last key press. This is useful in On any key pressed or On any key released to determine the key code of the key the user pressed, which is useful when setting up custom controls.
StringFromKeyCode
Convert a numerical key code back in to a string representation. For example this turns the key code 65 in to the string «A».
TypedKey
Return the last key press as the character that would have been entered in to a text field. For example when pressing A, this could be «a», «A», «á» or something else, depending on which other keys are held down. If the last key press is not a typed character, like Shift, then the expression is set to the name of the key.

Multiplayer expressions

ListInstanceCount
After On game instance list triggers, the number of game instances in the received list.
ListInstanceName(index)
ListInstancePeerCount(index)
Get the name and peer count of a given game instance in the returned instance list.
ListRoomCount
After On room list, the number of rooms in the received list.
ListRoomName(index)
ListRoomPeerCount(index)
ListRoomMaxPeerCount(index)
ListRoomState(index)
After On room list, retrieve information for a room at an index in the received list. The state can be one of «available», «locked» or «full».
FromAlias
FromID
The alias and ID of the peer a message is from in On message received or On any message received.
HostAlias
HostID
When in a room, the alias and ID of the host of the room.
LeaveReason
A string identifying a reason for leaving in On peer disconnected, if known, e.g. «quit», «timeout», «network error»…
Message
The contents of the received message in On message received or On any message received.
PeerAlias
PeerID
The alias and ID of the relevant peer in a trigger like On peer connected or On peer disconnected.
PeerCount
The number of peers in the current room, including the host.
PeerAliasAt(index)
PeerIDAt(index)
The alias and ID of the nth peer in the current room, up to PeerCount.
PeerAliasFromID(peerid)
Get the alias of a peer in the current room from their peer ID.
PeerLatency(peerid)
PeerPDV(peerid)
Get the latency and packet delay variation (PDV) of a peer from their peer ID. Peers can only use this to get the stats for the host, since that is the only connection they have, but the host can use it for any peer.
Tag
The tag of the received message in On any message received.
LagCompensateAngle(movingPeerID, fromPeerID)
LagCompensateX(movingPeerID, fromPeerID)
LagCompensateY(movingPeerID, fromPeerID)
Return the lag-compensated position and angle for movingPeerID as seen by fromPeerID. In other words, this returns the past position of movingPeerID going back by the amount of time that fromPeerID is delayed by, given their latency. For example this can be used to perform a lag-compensated hit-test when fromPeerID shoots a laser. This is covered in more detail in the fourth multiplayer tutorial.
PeerState(peerid, tag)
When host, retrieve the latest client state value with the given tag, for a given peer ID. The peer will have set this with the Set client state action to indicate their input state.
CurrentGame
CurrentInstance
CurrentRoom
Retrieve the current game, instance and room names, if joined on the signalling server.
ErrorMessage
In On signalling error, the error message if available.
MyAlias
MyID
The current player’s own alias and ID, once connected and logged in to the signalling server.
SignallingMOTD
SignallingName
SignallingOperator
SignallingURL
SignallingVersion
Once connected to the signalling server, retrieve the Message Of The Day (MOTD), server name, server operator, website URL and server version for the connected server.
ClientXError
ClientYError
The input prediction error for peers, used for debugging.
HostX
HostY
The position the host has for the current peer, used for debugging.
StatInboundBandwidth
StatOutboundBandwidth
Return the total estimated inbound and outbound bandwidth for all data transmission through the Multiplayer object, in bytes per second.
StatInboundCount
StatOutboundCount
Return the total number of separate inbound and outbound messages sent and received by the Multiplayer object. This includes internally-used messages for things like ping and synchronisation; generally the bandwidth is the more practically useful statistic.

Compatibility

On Safari for iOS and Chrome for Android, video playback cannot begin unless triggered by a user input event. The Play action will work in a user input trigger like On touch start, but if done outside of that it cannot play right away. To work around this the video plugin will wait until the next touch event to start playing the video. This also applies to autoplaying videos: it will not start until the first touch.

Safari on iOS does not currently support rendering video inside the game canvas itself. To work around this, the Video plugin creates a video element floating above the game, similar to a form control. This ensures the video can appear, but prevents other objects being displayed on top of it.

Плюсы и минусы

Плюсы:

1. Программа бесплатная (но с некоторыми ограничениями)

2. Программа легка в освоении, не требует программирования (вернее, требует только простое визуальное программирование). Описание логики игры производится выбором подходящего типа объекта (например, «вид сверху», «вид сбоку»), настройки его свойств, определения событий (например, «касание объекта X объекта Y») и действий (например, «у объекта X заменить изображение на Z»)

3. Полученная игра работает на любой операционной системе в любом современном HTML5-браузере, в том числе на компьютере, ноутбуке, планшетниках (включая iPad), смартфонах (включая iPhone).

4. Полученная игра не требует скачивания, установки игры, установки каких-либо плагинов. Запускается прямо на странице сайта

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

6. Есть хорошая документация (на английском языке) с примерами

Минусы:

1. Программа (не путайте с полученной игрой!) работает только на Windows. Хотя можно с некоторыми ограничениями (не работает предпросмотр, некоторые интерфейсы из-за несоответствия шрифтов выглядят криво) запустить на Linux под Wine.

2. Программа только на английском языке. Но игру можно сделать на любом языке (кодировка Unicode)

3. Сложные игры при неграмотном создании могут тормозить, особенно на смартфонах

Бесплатно скачать программу, установить, запустить, создать новый проект.

Advanced function features

Like in programming languages, the Function object supports the following:

  • Functions calling other functions
  • Functions calling themselves (recursion)
  • Returning values from functions
  • Calling functions from expressions (which also returns the return value)

Note that functions calling other functions or recursing create a new «stack» of local variables. In other words, like in programming languages, local variables are unique at each level of function call. This does not apply to static local variables or global variables.

Also note the Function object logs to the browser console if it is used incorrectly, such as calling a non-existent function or accessing a parameter that was not passed. This can help identify problems using functions in large projects.

Misc

On created
On destroyed
Triggered for each instance that is created or destroyed during the running of the game. On created is also trigged for each object already on a layout when the layout starts. For example, a one-shot particle effect could be spawned every time an object is created, and an explosion created every time the object is destroyed. These conditions are analogous to constructors and destructors in traditional programming languages (commands which run at the creation and destruction of an object). Be careful not to create an object of the same type in an On created event (e.g. On Sprite2 created: create Sprite2) since this will create an infinite loop and cause the game to hang.
Оцените статью
Рейтинг автора
5
Материал подготовил
Андрей Измаилов
Наш эксперт
Написано статей
116
Добавить комментарий