You are on page 1of 155

Construct help

Index
Animator Bar Application Properties Array Object Attributes AVI Object Ba!!oon "ip Object Beha!ior List behaviors Bone beha!ior Box object Bu#p#appin& %ommon &ia!o' Object Co##on Properties %onditions Containers %R%-, Object $dit i#a&es e%ternally .ffects $%pressions /ami!ies /a#ily 'ana&er 0ialo& /A3 /unction Object Game behaviours Hash Table Object Hidden stuff Inherited Layers I I fi!es Inter ace o!er!ie" #ayer Properties Layers Bar #ayout Properties Li&ht Object !ist of shortcuts 'ini#ap Object (ouse ) *eyboardObject Object List Optimisation Pairer Object P%( Audio Picture $ditor Pixe! $haders PL*+I, -Orbitor tool. P!u'ins0ho1tocreate2 Plu&ins Process Object Project Bar

By Chrisbrobs

Properties Bar Ribbon Bar RuntimesScirra Construct script editor $ystem Actions Syste# $%pressions $ystem Object Te%t 'anipulator Object "ext Object Tiled Bac(&round Object "ime &e!ta Ti#e scale +Audio, actions )Audio2 conditions +Audio, expressions )Audio2 Object +Audio, properties

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Animator Bar
The animator bar is used to create and change the appearance and animations of sprites. By default, it is accessible on the right-hand side of the main screen as a tab between Project and Resources. Like all other bars, it can be docked, undocked, hidden and pinned. There are two main windows of the animator bar. The top window shows all available animations for the sprite. The bottom window shows the individual frames found within an animation.

Animation Window
To create a new animation, right-click on the top window and select Add New Animation. To change the name of the animation, select it, then change the Animation Name in the properties bar. By default, the initial Angle for the animation is 0 ( ight!. To add a new angle, select the animation, right-click on it, and select Add New Angle. "hen an ob#ect is displaying an animation, it picks the closest Angle to the angle the ob#ect is currently facing. This allows you to draw your character facing different directions, for e$ample. %ou can create a sub-animation for the main animation by selecting Add sub-animation. &ubanimations can be used to organise related animations. To delete an animation, right-click on it and select Remove.

Frames Window
'n the bottom window, you can edit the frames in the currently selected animation. "hen you created the &prite, the (icture )ditor came up to allow you to import or create the first frame in the first animation. By default, the frames in a new animation start out blank. *ouble-click on the frame to re-open the (icture )ditor and edit the new frame. %ou can also select one of the previous animations and copy and paste frames into the new animation. %ou also can import frames by right-clicking and selecting import frames. The import frames options will open an )$plorer window that will allow you to select graphics on your hard drive and turn them into frames. %ou can set the hotspot, flip or mirror the image, and rotate the image +0-degrees. 'n the properties bar, you can also change the speed at which individual frames will be displayed. , is normal, 0.- is twice as fast, etc. This can be useful if one frame needs to display longer than the others, without having to repeat the same animation frame. 'f you right-click in the frame window, you can add and remove other frames.

Properties
The animator bar updates the properties bar depending on what you have clicked on.

When an animation is selected


.nimation name The name used to refer to this animation in the event sheet editor. Tag %ou can choose the purpose of this animation here, such as /"alking/, /0umping/ etc. &ee tagged animations for more information.

When an animation angle is selected


The frames window will update and display the frames in this animation. The properties bar shows the following properties. Animation speed The speed at which the frames of an animation are displayed, in animation frames per second. Loop )nable repeating the animation when it gets to the end. 'f disabled, the animation stops when it gets to the end. Repeat 'f you want the animation to repeat, but don/t want it to be an endless loop, use this option. The value chooses how many times the animation will repeat. Repeat to 'f you want the animation to repeat, but don/t want the animation to return to the first frame, select which frame to start over at. Ping-pong 'f the animation repeats, select this option to make the animation play in reverse on its ne$t repeat. The frames will play in a back-and-forth manner, which can be useful for walking animations and such.

When an animation frame is selected


Frame speed 1ow long to display this frame for. , is the normal time for the current animation speed, 2 would be twice as long, 0.- half as long, and so on.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Applications
An application is a complete game or program built and edited in Construct. Applications save to .cap files. Properties relating to the application in general can be found in application properties. Applications consist of a number of major elements:

Layouts: the levels or menu screens in your game, or different displays in an application

Layers: the layers of display, which can have effects applied and which visible objects belong to

Objects: that perform the useful tas s of your application !esources: such as the sounds or other files your application needs "vent #heets: hold functionality of layouts or other tas s

"vents and #cripts: define how your application wor s.

Applications can be Previewed $clic Run in the !ibbon %ar& to run them during development for testing, or e'ported to a ."(" file for distribution.

Runtimes
One of the major properties affecting an application is the choice of runtime, which affects the features available, and the re)uirements to launch your game: for e'ample, the *+irect(* , runtime can display effects, but re)uires the end-user have *+irect(* , installed to run.

Application Properties
.ou can get to application properties by clic ing the application in the project bar, or by clic ing Application Properties in layout properties.

Runtime properties

Enable scripting: /f enabled, you can use Python scripting functionality in Construct. "'ported "("s must redistribute *Python01.dll*. #ee Python scripting for more information. Framerate mode: Controls how the game framerate runs:

V-Synced: 2he screen updates in sync with the monitor3s refresh rate. 2he best )uality and smoothest display. 4ames should all use this option. #ee 2ime+elta for related issues. Unlimited: 2he screen updates as fast as possible with no waiting. /ntended for testing your game3s performance. Fixed: 5se the FPS property to manually specify a framerate. 2his will not be 6-#ynced so your game will e'hibit tearing and poorer )uality display.

FPS: 7hen the above Framerate mode is Fixed, this is the frames per second that Construct will attempt to draw. /f the game is particularly intensive, the framerate may drop below the intended. FPS in caption: #hows the framerate in the window title bar for easy performance testing. Fullscreen: /f enabled, your game will ta e up the entire screen. /f the application 7indow si8e does not match the user3s display resolution, then the game will change the display resolution for the duration of the game. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Menu: /f enabled, a menu bar will appear beneath the window title bar. .ou can edit this menu in the resources. aption: +isplay the window title bar and border at runtime. Resi!ing: "nable resi8e handles on the window border. Can have the following values:

Disabled: 2he border is not resi8able. Show more window content: 2he viewable area of the layout changes to match the si8e of the window. Stretch window content: 2he same content is rendered at the original window si8e, then stretched to fit the new si8e.

Minimi!e box: "nable a minimi8e bo' on the window titlebar. Maximi!e box: "nable a ma'imi8e bo' on the window titlebar. 7hen the application is ma'imi8ed, the resi8ing of the window is determined by the Resi!ing property. /f Disabled, the Stretch mode is used. "indow "idt# $ "indow %eig#t: 2he hori8ontal and vertical si8e of the game window. 2his is also the display resolution used in Fullscreen mode. Runtime: Choose the application runtime:

&irect-': #upports hardware-accelerated display and pi'el shaders for games Application: 9o +irect( display support, but smaller and faster load time, ideal for applications.

Sampling: Change how stretched and rotated graphics display.


Point: Low )uality but fast display, which may appear 3pi'elly3. 4ood for retro style games. (inear: #moother display for higher )uality rotations and stretches.

)ext rendering: Choose the )uality with which te't is drawn to the screen:

Aliased: 2e't is drawn with hard $3jagged3& edges, which may suit retro games. Antialiased: 2e't is drawn with standard antialiasing. leartype: 7indows (P and up: draws te't with Cleartype antialiasing. 2his provides the best display )uality for large font si8es.

Advanced

Minimum FPS: /f the framerate falls below this value, 2ime+elta will not increase any further. 2his prevents objects jumping large distances at very low framerates. *verride )ime&elta: override the value returned by the system e'pression TimeDelta to always give the same value. 2his ensures games play out the same way tic -by-tic with predictability, without the small, random variations in the normal measured 2ime+elta. :owever, your game loses the ability to adapt to different framerates. 2his also affects all the built-in behaviors. #ee 2ime+elta. )imer FPS: /f *verride )ime&elta is enabled, this is the framerate to simulate 2ime+elta returning. ;or e'ample, if you enter <=, then 2ime+elta will return > ? <= @ =.=><<<...

E++ects
S#ader version: .our computer3s supported pi'el shader version, eg. P# 0.=. #ee pi'el shaders for more details on versions. Run wit#out PS: Allows your game to run with disabled effects when the user does not support those pi'el shaders. Simulate s#ader: 2est your game3s appearance on a computer with a lower pi'el shader version to yours. Motion ,lur: "nables a global motion-blur effect on any moving objects by using temporal antialiasing. #ee motion blur for more information. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

-lobal variables
Lists all global variables in this application, with their name and initial value. 4lobal variables are a way of storing values which are shared between all layouts. Edit globals opens the global variable manager where you can add, edit and delete global variables.

)ransitions
Lists all transitions and their properties. .ou must clic Add transition here before you can use transitions between layouts.

Event S#eets
Lists all event sheets, with their name and a button to remove them. #ee event sheets. Clic Manage event sheets to add a new event sheet.

-rouping

"dit Attributes: Opens the attribute manager, where you can add your own custom attributes. "dit ;amilies: Opens the families manager, where you can add your own custom families.

ontrols
Lists all controls, with their name and the corresponding ey. Clic Manage controls to edit and add controls. Applications are created with some defaults, and many movements respond to these controls.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Array Object
The array object allows for the creation, saving, and loading of 1-3 dimensional arrays. These are used to store values, both numbers and strings, in a highly organized manner for uses such as storing game level files.

Contents
1 Indices 2 Pro erties 3 !onditions 3.1 !om are" 3.2 #or $ach" % &ctions %.1 #iles" %.2 'alues" ( $) ressions (.1 #or $ach" (.2 *ize" (.3 'alues"

Indices
It is im ortant to note that arrays in !onstruct are 1-inde)ed, meaning that the address of the first element is 1, not +. #or e)am le, the very first element of a 3-dimensional array would be accessed by the e) ression ,&rray- 1, 1, 1 .,. &lso, any information written out of bounds to an array will sim ly be discarded. To increase the size of the array, you will need to use the according action -/*et *ize/..

Properties -see also !ommon Pro


0idth -1. Initial width of the array. 2eight -3. Initial height of the array. 4e th -5. Initial de th of the array. 6em usage

erties)

&n a ro)imate indicator of the memory usage of this array. This is only really im ortant if you are using very large arrays.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Conditions
Compare:
!om are value at 1" !om are the value of an array cell at the given 1 osition. !om are value at 1,3" !om are the value of an array cell at the given 1,3 osition. !om are value at 1,3,5" !om are the value of an array cell at the given 1,3,5 osition.,.

For Each:
#or each element" 7oo through each of the array cells in order.

Actions
Files:
*ave to file" *ave an array to a file. 7oad from file" 7oad an array from a file.

Values:
!lear array" !lear all array cells to the s ecified value. *et value at 1" *et the value of the chosen 1 osition to the s ecified value. *et value at 1,3" *et the value of the chosen 1,3 osition to the s ecified value. *et value at 1,3,5" *et the value of the chosen 1,3,5 osition to the s ecified value. *et size" *et the size of the array in 1, 3, and 5 values. 8ote that if the size of any of the indices were zero, then you wouldn/t be able to write any information to the array.

Expressions
For Each:
9et current 1" :eturns the 1 coordinate of the currently selected array cell. 9et current 3" :eturns the 3 coordinate of the currently selected array cell. 9et current 5" :eturns the 5 coordinate of the currently selected array cell.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Si e:
9et 1 size" :eturns the 1 size of the array. 9et 3 size" :eturns the 3 size of the array. 9et 5 size" :eturns the 5 size of the array.

Values:
9et value at 1" :eturns the cell value from the s ecified 1 coordinate. 9et value at 1,3" :eturns the cell value from the s ecified 1,3 coordinate. 9et value at 1,3,5" :eturns the cell value from the s ecified 1,3,5 coordinate.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Attributes
Attributes are a way of loosely grouping objects, in a more general way than Families. Attributes can be applied to objects from any plugin, whereas families are restricted to objects all from the same plugin. There are several built-in attributes with specific functionality, which are described here. You can edit attributes by the ' dit attributes' lin! in object properties "at the bottom of the list of chec!bo#es$, or in application properties. Attributes can also be selected in the event sheet editor when you are as!ed to pic! an object, such as testing if an object has collided with an attribute. %owever, you cannot ma!e events to apply to all objects in the attribute. For this, you should use Families. &ome plugins and behaviors also use attributes. For e#ample, in the 'T& (ehavior, you can choose an attribute for objects to navigate around with pathfinding.

Setting attributes
All objects have attributes, and you can set them in the properties bar after selecting the object. )nder the Groups category is the Attributes category. %ere, a list of chec!bo#es appear, which allow you to choose which attributes the object has.

Editing attributes
You can also clic! Add/Edit attributes, which allows you to add new attributes, and delete others. Adding attributes won't automatically ma!e them do anything, but you can use attributes in parameters in the event sheet editor, eg. (ullet collides with MyAttribute.

Built-in attributes
Solid* (ehaviors such as +latform and , -irection will not be able to pass through any objects with this attribute enabled. Center view on me* This will always scroll the display to the object's co-ordinates at all times. This can be changed at runtime with the &ystem action .&croll to object.. /f more than one object instance have this attribute, 0onstruct scrolls to the mid point between all of them. Destroy on startup* -estroys any initial instances of this object when the layout starts. )seful for ensuring spawning objects such as bullets, particles, e#plosions, etc. are not present when the game starts up. Destroy if far* This will automatically destroy an instance of the sprite if it strays too far outside the current layout. The object will be destroyed if it is more than a window width on the 1 a#is or a window height on the Y a#is outside the layout. Destroy out of screen* This will automatically destroy an instance of the sprite if it strays too far from the visible playing area.

Platform* The +latform behavior ta!es advantage of these by allowing platform characters to jump through them. o Seriali!e* The Quicksave/Quickload and Save/load system actions will not save or load the state of this object. )seful for objects li!e input and music which need to !eep going

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

AVI Object
The AVI object plays media files. It supports different media types including .wmv, .asf, and .avi. It does not play quicktime files (.mov). The AVI o !ect can play media directly in game and supports many options including "oom, volume, si"e, speed, and position.

Properties (#ee $ommon %roperties)

Actions
&oad file Takes one parameter, the name of the file to load. 'ote that if the file is in the same location as the .cap or .e(e then you do not require the path. If it is not then make sure to include the relative path from the .e(e or .cap. )or e(ample, if the sample.wmv file is in a *video* su +directory then specify the parameter as *video,sample.wmv*. &oad from dialog #ave file Takes one parameter, the filename to save. #ave from dialog %ause %auses video %lay %lays the currently loaded video -esume -esumes playing after a pause #eek .oes a specified num er of milliseconds into the video. #et play ack speed #ets the speed etween /+0//. The default is 1//. #et repeat If set to 1 the video will repeat indefinitely. The default is /. #et volume #ets the volume etween /+1//. The default is 1//. #et "oom #ets the "oom for the video. The default is 1//. 2ith the range from /+1//. #top #tops playing video

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Conditions Expressions
.et file

('one)

-eturns a string, the filename. .et position -eturns an integer, the current position. .et speed -eturns an integer, current play ack speed. .et "oom -eturns an integer, the current "oom level.

Example
This e(ample shows how you might include videos in your program. Videos might e useful for an intro to the game or a cut scene.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Balloon Tip Object


The Balloon Tip Object plugin allows you to pop up messages in a balloon tip window. You can use this option to add the impression of speaking or thinking in a game. It is important to note that the balloon tip object is primarily designed for applications and does not work well with scrolling games. For example, if you specify show balloon tip at object for an object at a location outside the game window it will show the balloon tip on the screen outside the window.

Contents
! "se globally # $roperties % &ctions ' (onditions ) *xpressions + *xample

Use globally
,ark the -alloon Tip object as Global in its Common properties, and place an instance on the first layout. The object will now appear in all layouts, and will be the only instance you need in your entire application. If you do not use a global -alloon Tip object, only use one per layout. In general you should only need one global balloon tip object, howe.er if you wish to use multiple options for balloon tips for different objects on the same layout then consider creating more than one instance.

Properties
/ee (ommon $roperties. -alloon Tip does not ha.e location, si0e or angle properties, as it is a non1layout object. It does ha.e properties of2 Title Text Icon Timeout (lose on click (lose on mouse mo.e (lose on key (lose button

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Actions
/et balloon icon /et the type of balloon tip. (hoose application for a speaking type balloon. /et balloon texts Fill the balloon tip title and message with text. /et options /ets options dealing with closing the balloon tip. These are the same options in the properties menu. /et timeout /ets the timeout in milliseconds for the tip to close. The default is !3333. /how balloon at object /hows the balloon at a chosen object. This will be useful to simulate an object speaking or thinking. /how balloon relati.e to screen Takes a x and y coordinate relati.e to screen. /how balloon relati.e to window Takes a x and y coordinate relati.e to the window.

Conditions
4one

Expressions
5et text 6eturns the text from the balloon tip. 5et timeout 6eturns an integer, the current timeout. 5et title 6eturns the title of the balloon tip.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Example
&n ob.ious example for balloon tips is to support a 6$5 or ad.enture game with the impression of speaking. First add an &rray, -alloonTip, /prite 7add 8direction beha.ior, in this example rotation is set to none9, and ,ouse:eyboard object to the layout editor. In the e.ent sheet, we will initiali0e an array with different text strings we want the player to say. Then when the s key is pressed a random number between ! and % is is returned from the array. 6andom7%9 returns a random number between 3 and # so we add ! to it. Finally we display the balloon tip at the current location of the player.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Behaviours List
The following is a behaviour list of currently documented behaviours. A list of objects can be found at the object list.

Game behaviours
The following are behaviors which assist in game development. Line Of Sight RTS Selection Box Shadow Caster Turret Wrap Assists in determining if an object can 'see' another object (ie, there are no obstacles in a straight line between them). This behavior's conditions provide the line-of-sight testing. rovides path finding and is commonly used to calculate routes around obstacles even in non!T" games. Automatically resi#es an object when the user drags the mouse.

Applies a shadow to an object if used with the light plugin. $sed to ma%e an object rotate toward certain objects, as if it were an automatic gun turret. $sed to ma%e an object wrap around the other side of the layout if it moves out of the layout.

ovement behaviours
The following are behaviors which move other objects. ! "irection Ball Bone movement Bullet Car "rag # "rop Grid movement ouse $h%sics &a%es an object move in a ', ( or ) direction fashion. &oves an object li%e a bouncing ball, with optional gravity. Allows objects to be lin%ed together and animated smoothly. rovides a realistic bullet style movement. &oves an object li%e a car, with s%idding and acceleration*deceleration. Allows objects to be pic%ed up and dropped with the mouse. &oves an object in a fi+ed grid, can be either player controlled or set to wander randomly li%e in ! - games. &oves an object with the mouse pointer. rovides realistic physics, with weight, density, springs and friction.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

$latform Sine

.reates a realistic platformer style movement, with slopes, moving platforms, jumping and jump through platforms. &oves objects in a sine wave style movement.

&tilit% behaviours
The following are utility behaviors which perform various operations on objects. 'ade Rotate Sha(e /ades objects in or out. 0asily rotates objects and handles acceleration*deceleration. "ha%es an object with a set intensity and area.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Behaviors
The Behaviours system is an important part of Construct, allowing objects to behave in a pre-coded way (such as movements like the platform movement and car movement), or to simply add special functionality to an object (such as with the Line f !ight "ehaviour)# There is a wide range of behaviours included with Construct, which are created with the !$%# &or a list of the built-in Construct behaviors, see behavior list#

Using behaviors
'hen an object is selected, you can add behaviors under the Behaviors category in the (roperties "ar# )ou can add multiple behaviors, but not all objects can have behaviors added to them# *ost behaviors can be activated and deactivated by actions# "ehaviors will try to take advantage of tagged animations where possible, and automatically animate objects#

In events
*ost behaviors add new actions, conditions and e+pressions# These appear in tabs in the event wi,ard after selecting an object# "ehavior-s e+pressions can be accessed in a similar way, and appear using the synta+.
Object[BehaviorName].Expression

Common properties
/ll behaviors have the following properties# Remove 0emoves this behavior from the object# Name The name of this behavior# This is used in the behavior-s e+pressions, in the form bject1Name2#3+pression# Add /dd a new behavior to the object# )ou can have multiple behaviors on an object, which all affect the object at the same time# &or e+ample, an 4-direction movement behavior coupled with a 'rap behavior creates an arrow controlled movement that wraps around when you move off the edge of the screen# )ou can enable and disable separate behaviors via the Set activated action#

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Bone Behavior
The bone movement behavior is used to create and animate skeletons for quick and easy animation of objects. It's especially useful for making high-quality character animations.

Bone Editor
The bone editor is accessed by selecting an object with the bone movment, then clicking on !dit under the "one#ovement behavior tab in the properties panel. $lose $lose the bone movement editor. %dd %dd a new bone. &hen this is clicked, you are told to select the object you want to add as a bone. 'nce it's selected, you are asked to select the object to which it will be attached. Then you click - at the location you want the bone to be jointed - and drag the new bone onto the object it is being attached to. %nimation $hange the currently selected animation. %nimation (ame $hange the name of the currently selected animation to edit. )elete %nimation )elete the currently selected animation. %nimation *peed $hange the animation speed of the currently selected animation. +oop If this is checked, the animation will loop infinitely. ,epeat If the animation is not set to loop, this property will tell the animation how many times to repeat before stopping. ,epeat To If the animation is set to repeat.see above/, this setting will determine where the animation returns to after reaching the end. 0ing-pong If this option is checked, the animation will alternately play forward and then backward. 1eyframe $hange the currently selected keyframe to edit. 1eyframe (ame $hange the name of the currently selected keyframe.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

)elete 2rame )elete the currently selected keyframe. 2rame *peed *peed multiplier for the currently selected keyframe. +ower values will make the frame play faster.

Conditions
%n animation is playing $heck if the specified. animation is playing. $ompare animation frame $heck if an animation is currently on the specified frame. 'n animation finished $heck to see if the specified animation is finished.

Actions
0ause %nimation 0ause the currently playing animation. 0lay animation 0lay the current animation. *et animation *pecify which animation to start playing. The tween time is the time the bone movement takes to transition between the old and the new animations, and is set in milliseconds. *et animation frame $hange the current animation frame to the specified frame. ,ead above for tween time. *et animation speed *et the speed of the current animation. 2orce bone repositioning 2orce the repositioning of all bones. This is used in cases where an object must be placed to the location of a bone. &ithout the forced repositioning, these objects would lag behind. This action should be placed at the end of the event sheet. *et angle *et the angle offset of the bone structure. *et flip *et if the bone structure should be flipped.vertical/. *et mirror *et if the bone structure should be mirrored.hori3ontal/. *et scale *et the si3e multiplier of the bone structure. 4 is normal, 5.6 is halfsi3e, 7 is double si3e, etc...

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Expressions
8et animation frame 8et the current animation frame. 8et animation name 8et the name of the current animation.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Box Object
The box object displays a box (rectangle) outline with an optional fill.

Properties
See also Common Properties. Colour 1 / Colour 1 Top and left / bottom and right border colour. Colour 1 System / Colour Colour 1 #pacity / Colour Transparent fill Transparent inside the box. $nabled by default. %ill %ill colour. &isable Transparent fill first' %ill (system) !lternati"e system colour for this item. %ill opacity Semitransparency of the fill colour. 1(() by default. &isable Transparent fill first' !ntialiased &raws box with smooth lines. &isabled by default. (system) #pacity !lternati"e system colour for the top and left / bottom and right border. Semitransparency of the top and left / bottom and right border.

Common
The *ox ob+ect has common actions, conditions and expressions (!C$s) for position, dimension, angle, "isibility, filter, opacity, - order, and count . destroy.

Actions
!ttach to ob+ect !ttaches the box to a gi"en ob+ect, setting the box/s position and angle to that of the attached ob+ect. The padding specifies how much the box/s width and height should be expanded, in pixels.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Bumpmapping
Bumpmapping, and its variant Heightmapping, are a way of simulating per-pixel 3D lighting in 2D images, by using another image with 3D information stored in the colours. Bumpmapping uses normal maps whereas Heightmapping uses height maps also !nown as displacement maps".

Normal and Height maps


#he image to the right demonstrates what height and normal maps loo! li!e.

$mage showing the height and normal map for a texture, generated using %ra&yBump. #he original texture is simply the colours of the image and has no inherent 3D information' this can be added by either the height map or the normal map. (otice the height map is greyscale, where blac! is a low depth and white is a high depth. #he normal map encodes the 3D direction of each pixel in the red, green and blue channels, and generally does not loo! li!e anything in particular - it is meant for bumpmapping, not loo!ing at)

Generating normal and height maps


* useful tool for generating height and normal maps is %ra&yBump. #his tool can ta!e a photographic colour image, such as the +,riginal texture+ in the sample image, and automatically generate a heightmap or normal map from it. -ou can then ad.ust various settings and preview it in 3D to ma!e it most accurately represent the texture. #his is an extremely useful way of ta!ing your game+s flat 2D textures and adding 3D depth to them without having to do an extensive modelling process yourself.

Normal or Height maps?


$t is usually preferable to use normal maps over height maps, because the Bumpmapping shader is faster. #he Heightmapping shader first converts the height map to a normal map, then processes a normal bumpmapping effect. #he conversion stage is eliminated by the Bumpmapping shader, since you have pre-rendered the normal map outside of %onstruct /,ffline/". However, normal maps cannot be rotated, since the 3D data is only valid for an angle of 0 degrees. $f you want to apply bumpmapping to a rotating ob.ect, you can only use heightmapping.

Using the effect


#o use the effect, use two ob.ects1 one with the original image, and the second with the normal map. #his can wor! effectively for any ob.ect that draws1 sprites, tiled bac!ground, etc. *pply the Bumpmapping effect to the ob.ect with the normal map or Heightmapping if using a height map", and ensure this ob.ect is above the original ob.ect.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

(otice the ob.ect with the normal2height map must be the same height, width and position as the bottom ob.ect, otherwise they will not line up correctly, and the result may loo! wrong. -ou can do this either in the layout editor, or more conveniently set up an Always event and update the map+s position and dimensions to the same values as the ob.ect. -ou can also configure the effect parameters.

3ight 4 - the 4 co-ordinate of the light source in texture coordinates. 3ight - - the - co-ordinate of the light source in texture coordinates. 3ight 5 - the height of the light source. 6ssentially affects the radius of the light. $ntensity - ad.ust how intense the highlights are.

Useful information

#exture coordinates are relative to the ob.ect+s image and range from 0 to 7, li!e a percentage of the image. 0,0 is the upper-left corner, and 7,7 is the lower-right corner (this may be changed to pixel coordinates in a future build) 8or a fullscreen bumpmap eg. using a tiled bac!ground", light 4 and - of 0.9 places the light source in the middle of the screen. *pplying a Dodge blend effect after the Bumpmapping or Heightmapping effect, and reducing the bump intensity, changes the characteristic of the light and you may prefer this appearance. #he expression (x - Object. ) ! Object."idth

will convert the position x in layout coordinates" in to texture coordinates when the hotspot is in the upper left corner shortcut1 : on num pad in picture editor". #his is useful for positioning the light source. #his formula is used with MouseX substituted for x in the following example, so you can move the light with your mouse.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Common Dialog Object


The Common Dialog object displays common windows dialog for user interaction. It allows browsing and selecting files and folders.

Contents
1 Properties 2 Conditions 3 Actions 4 !pressions " !ample

Properties
#ee Common Properties. Common $ialog does not ha%e location& si'e or angle properties& as it is a non(layout ob)ect.

Conditions
*n Coulour dialog *+ True if an *+ ,such as open or sa%e- action was ta.en. *n Coulour dialog cancelled True if cancelled was selected in the prior dialog. *n file dialog *+ True if an *+ ,such as open or sa%e- action was ta.en. *n file dialog cancelled True if cancelled was selected in the prior dialog. *n folder dialog *+ True if an *+ ,such as open or sa%e- action was ta.en. *n folder dialog cancelled True if cancelled was selected in the prior dialog.

Actions
#et initial colour #how colour selector Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

#et default e!tension #et file dialog filter #et initial file #et multiselect enabled #how open dialog #how sa%e dialog #how folder selector

Expressions
/et colour /et 0th selected file Ta.es an integer for the file inde! and returns full path of the selected file /et first selected file 1eturns full path of the selected file /et number of selected files 1eturns an integer the number of files selected /et folder

Example
The Common $ialog ob)ect is useful for interacting with the player2s files and folders. A perfect e!ample is sa%ing and loading a game from dis.. In this e!ample four ob)ects are used3 4ouse+eyboard& a sprite5tiledbac.ground to control ,add 6(way beha%ior-& and a dialog for sa%ing and one for loading. 7hen # is pressed the player can browse their file system to decide where to sa%e. 7hen 8 is pressed the player can browse for any sa%e file and load it. 0ote that the condition On file dialog OK& ma.es sure a file was selected. If you did not ha%e that chec.& your program would crash.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Common Properties
Common properties are a category of properties all objects have, in the properties bar. At the bottom of the Properties Bar is a description pane showing information on the currently selected property. Non-layout objects, like Audio!, do not appear in the layout and so don"t have position or si#e properties.

Common

Name$ %he name of the object. %his is how &onstruct will refer to your object in the event sheet editor. 'or instance, if you need the position of your object, you can retrieve it using the e(pressions ObjectName.X and ObjectName.Y. %he object name can only consist of letters and numbers - spaces and other special characters are not allowed X$ %he hori#ontal position of your sprite, in pi(els. %his is defined by the distance from your object"s hotspot to the left-hand side of the current layout Y$ %he vertical position of your sprite, in pi(els. %his is defined by the distance from your object"s hotspot to the top of the current layout Width$ %he hori#ontal si#e of your object, in pi(els Height$ %he vertical si#e of your object, in pi(els Angle$ %he angle of your object, in degrees. )nly objects which can be rotated, such as sprite object, have this property Destroy when$ *sed for compatibility with different versions of hardware pi(el shaders. +electing one of the options in the drop-down menu will only allow your sprite to e(ist under certain versions of pi(el shader support. ,enerally only needed if your sprite is used in conjunction with a pi(el shading effect Icon$ %he large object icon used in the event sheet editor. -ou can edit the appearance of the icon to suit your needs. Note that changing the icon will not change the appearance of the object itself Small Icon$ %he small object icon used in the event sheet editor. -ou can edit the appearance of the icon to suit your needs. Note that changing the icon will not change the appearance of the object itself Global$ &hecking this option makes your object global. +ee global objects. ,lobal objects do not destroy when a layout ends, and are accessible from all event sheet editor Show in editors$ *ntick and the object will not appear in the event sheet editor. *seful to prevent scenery or rarely used objects from cluttering the object selector in an event sheet Category$ %ype a object category to sort objects in to categories in the event sheet editor

Notes
!rder is not listed as a property but it is kept track of and available on the .ayers tab by selecting list by / )rder. %he / )rder of an object can be changed by right clicking on an object in the .ayout editor and selecting from the various options in the )rder submenu. / )rder is also affected by the .ayer that the object is on, objects on top layers will always be above objects on layers bellow them regardless of what is done using the order menu. Also note that you can mirror " #lip any .ayout )bject man$ally by entering negative numbers for 0idth and1or 2eight. %his is a 3hidden feature3. 4f you would like the object to mirror 5 flip a$tomatically 6depending on its Angle7, you can easily tell it so under the objects Angle Properties in the Properties Bar. Be aware that not all .ayout )bjects support this, though.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Conditions
Conditions are a very important part of how events work. An event can contain multiple conditions that test a set of criteria, and if these are met, a set of actions and sub-events can be run.

How conditions work


Every tick (once every time the screen is drawn), the event list is checked from top to bottom. The conditions in each event are checked in order from the top to the bottom. f all the conditions in the event are true, then the actions are done, and the sub-events are then tested in top-to-bottom order.

Events are tested in top to bottom order, once a tick. !ost "ames are #-synced, meanin" they draw the screen in sync with the display refresh rate. !ost users have a refresh rate ran"in" from $% - &'(), so this is also the appro*imate fre+uency at which the entire event list will be run. ,ince you cannot, and should not, e*pect a certain fi*ed framerate, see Time-elta for solutions to common related issues.

Object picking
There can be multiple instances of any ob.ect, and conditions will pick (or filter) only instances matchin" the condition. /or e*ample, the ,prite condition Is visible? will test every sin"le instance0s #isibility status. Any of the instances which are invisible are filtered out. Conditions pro"ressively filter instances, so if the second condition in the event was Is on layer 1, then only the instances which are visible are tested. 1f these, the ones on 2ayer 3 remain picked. 4hen an action is run on this ob.ect, it is only applied to the picked ob.ects. f the action in this event was Destroy, then only instances which are visible and on layer 3 are destroyed. 5sin" conditions as filters in this way, you can build up the lo"ic of the application or "ame. ,ometimes, the list of ob.ects which are picked is referred to as the Selected object list, or ,12.

5nreferenced ob.ects
f no conditions pick any instances of an ob.ect in an event, then the actions apply to all instances of the ob.ect. /or e*ample, the event Start of Layout: Destroy Sprite will destroy all instances of ,prite, because the condition did not pick any ,prites to destroy.

The E*pression rule


The e*pression 1b.ect.6 will retrieve the 6 co-ordinate of the first instance of Object that is picked. f Object is unreferenced in the event, it refers simply to the first instance to retrieve the value. This is worth bearin" in mind. ,ee the e*amples for more information.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Containers
4hen a condition picks an instance, if that instance is in a container, it also picks all the other associated instances in its container. Any actions actin" on the container ob.ects apply to associated instances - they do not count as bein" unreferenced. ,ee the containers article for more information.

Types of conditions
There are different types of conditions. The first condition in an event defines the type of event it is as well7 an event startin" with an evaluated condition is an evaluated event, an event startin" with a tri""ered condition is a tri""ered event, and so on.

Evaluated conditions
!ost conditions are evaluated, meanin" they are tested once a tick when the event list is run. /or e*ample, Mouse is over Sprite is tested once a tick. The actions in this event will be repeated so lon" as the mouse is over the ob.ect, because every tick the event is run, and the condition is found to be true.

Tri""ered conditions
Tri""ered conditions fire (or run their actions and test their subevents) when an event happens - such as a mouse click. Tri""ered conditions are denoted by the tri""er icon . The normal evaluation of the event list i"nores these events7 therefore their position in the event list does not matter, e*cept in relation to other tri""ers. !ultiple identical tri""ers (such as ' 0!ouse clicked0 events) tri""er in top to bottom order. There cannot be two tri""ers in one event. 1nce a tri""ered condition runs, the rest of the conditions in the event are tested in top to bottom order, as usual.

8epeatin" conditions
8epeatin" conditions work the same as evaluated conditions, but can repeat their actions and subevents more than once. This is useful if you need to, say, create '%% stars on the start of a layout. 8epeatin" conditions are denoted by the icon. /or e*ample the system condition Repeat 5 ti!es will cause the actions to be done '% times instead of once, and similarly for subevents, they will be tested '% times as well. ,ince events evaluate their conditions in top-to-bottom order, you can have further conditions belo" a repeatin" condition. These conditions will also be tested for every repeat, and the actions will not run if any of the followin" conditions is false for any repeat. 9ou can even have multiple repeatin" conditions in one event7 two Repeat 1 ti!es conditions in one event mean the same as Repeat 1 ti!es, since the second 8epeat is run 3% times by the first 8epeat. Additionally, you can use two #or $ac% Object conditions in one event, to iterate every possible combination of instances of two ob.ects. 4hile The &%ile system condition is special in that when it comes to be evaluated, it will continually check the conditions below it in the event. ,o lon" as these conditions are still true, it runs the actions and tests the subevents, and checks the conditions below it a"ain. /or e*ample:

,o lon" as the ,prite overlaps a ;,olid;, the action will repeat, movin" the ,prite ob.ect up one pi*el. The result is that the ,prite is moved above any solid to prevent it overlappin" it. Eventually the ,prite0s position no

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

lon"er overlaps a ;,olid;, and the condition is falsified. The &%ile condition stops, and the ne*t event is evaluated. /or Each The #or $ac% system condition repeats once for each instance of an ob.ect. /or each repetition, one instance of the ob.ect is picked. This is a useful way to overcome the limitations of ordinary condition behavior. ,ee the e*amples below.

Examples of use

1n the start of the layout, the event repeats 3%% times, creatin" 3%% sprites. Each sprite is positioned at a random 6 and 9 co-ordinate. 4ithout the Repeat condition, a sin"le sprite would have been created.

4hen the left mouse button is clicked, the actions are repeated for every instance of ,prite. (ere, one 'ubble ob.ect is created by each instance of Sprite. 4ithout the /or Each condition, only one 'ubble would be created when the user clicked, and it would be positioned by the first instance of Sprite, as per the E*pression 8ule (see above).

,imilar to the above, but < bubbles are created at every ,prite. =ote the sli"ht indentation on the second repeatin" condition7 this indicates the nestin" of the repeats.

Special events
The (o!pare )alues system condition
This system condition is notable in that it performs no ob.ect pickin" whatsoever. The parameters are simply evaluated as sin"le values and then the comparison is performed. f this condition is used to make a comparison such as Object*+ e,ual to , then as per the E*pression 8ule (see above), the 6 co-ordinate of the first (or first picked) instance of 1b.ect is retrieved, compared, and then a simple true or false result is obtained. =o ob.ects are picked. f this event then contained a Destroy Object action, as per the ob.ect pickin" rules, no Objects are referenced hence all Objects are destroyed re"ardless of their 6 co-ordinate. /or this reason, it is preferable to use the ob.ect0s own comparison condition - the ,prite ob.ect has, amon"st many others, a (o!pare + co-ordinate condition. Conditions within the ob.ects themselves test and pick appropriate instances7 the (o!pare )alues system condition does not. 5sin" a #or $ac% condition above a (o!pare )alues condition does allow you to test a comple* e*pression involvin" an ob.ect with ob.ect pickin", since for each repeat, the e*pression refers to the currently picked instance.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

The .l"ays system condition


The .l"ays event simply means a true result when it comes to be evaluated. Therefore, any actions in this event will be run once a tick. >ecause it simply results in true, addin" it to an e*istin" event with other conditions has no effect: it would add in a redundant condition that tests nothin" useful. t will not chan"e how the event behaves. >lank events t is possible to remove all conditions from an event so it has an empty condition area. n this case, it means the same as .l"ays: whenever this event is evaluated, it immediately runs the actions and tests the subevents. This can be useful if you have an event with lots of subevents, and you want actions to be run after all the subevents have been tested.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Containers
Containers are a method to link up instances of one group of objects to instances of another group of objects. For example, if you have ten turret objects, and ten tank objects, if you put "turret" and "tank" into the same container, each instance of turret will automatically have a corresponding tank assigned to it. You now have ten pairs of "turret and tank."

Contents
1 hat containers do ! "etting up a container # $xample % &ther uses ' (ips

What containers do
hen picking instances of one object in a container, the instances of the other objects in the container are also picked. hen "pawning one object in a )ontainer, new instances of the other objects in the container are automatically spawned and paired up. hen *estroying one object in a container, instances of the other objects in the container are also destroyed.

Setting up a container
+ )ontained object is selected (o place objects into a )ontainer with each other, select one object and open the )ontainer rollout on the properties bar. ,ext to )ontainer, click "+dd object" and select the object you wish to contain. ,ote that you can contain multiple objects. -n the layout, notice that when selecting one object in a )ontainer, the objects it is contained with highlight in yellow. (his is to indicate which instances of each type of object are paired up in the container.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Example
(he following examples assume that .(" /ehavior and (urret /ehavior are not used for the objects in 0uestion. ,ow that these two objects are contained together, picking instances of contained pairs to perform actions on is easy. For instance, if the tanks are moving you need to align each turret to match up with it1s corresponding tank. -f you don1t have these items contained, it can be problematic. (he following action 2in pseudocode3 would cause unpredictable results4
+ TankSprite is moving > TurretSprite: Set position to TankSprite

-n this example, every instance of the TurretSprite would align itself with whichever TankSprite is moving at the time. -f, however, TankSprite and TurretSprite are )ontained together, then picking one instance of TankSprite automatically picks the TurretSprite paired with it. (his means that the same event above would cause each TurretSprite to set itself to it1s proper TankSprite's coordinates. ,ote that you can use any condition that picks TankSprite, whether it1s a comparison for speed, visibility, angle, position, a check against a private variable, etc. + more complex example is aiming and shooting.
+ enemy.Value('active') Equal to 'yes' + TankSprite distance(TankSprite. !" enemy. !) #ess t$an %& > TurretSprite: 'otate % degrees to(ard enemy + Every %&& miliseconds > TurretSprite: Spa(n o)*ect )ullet

(his will cause the turret to rotate and fire when the tank is within '5 pixels of an enemy. "ince the turret and the tank are contained, only the turrets paired with the tanks that meet the distance condition will turn and fire 2note that the actual (urret /ehavior works differently than this example3. Finally, let1s destroy the tank6turret combo.
+ TankSprite is overlapping EnemyBullet > TankSprite: +estroy

(his will cause the tank to be removed from the layout. /ut since TurretSprite is )ontained with it, the instance of TurretSprite paired up with the detroyed tank will be destroyed as well.

Other uses
You can use containers for many tasks. (o match an animated sprite with a collision mask sprite (o connect objects with detectors for collecting passive input 2detecting walls, floors, etc.3

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

-f your objects have multiple parts 2separate torso, legs, arms, and head, for example3 (o give objects their own special data7storing objects, eg. to associate an array, hash table etc. per sprite.

Tips
8ake sure that when you create contained objects in your layout that you have an e0ual number of all the objects within the container in the layout editor. -f you have less TankSprites than TurretSprites, for example, the runtime will automatically create missing objects to ensure every container is complete. 9sually you want to set up these objects yourself, so you should make sure you have all the objects placed in the layout editor. -f you will only have one instance of each object at a time in your layout, you don1t need to use containers. )ontainers are a way of sorting multiple instances into groups, so solo instances do not need to be contained. For an example of )ontainers in action, be sure to check out the ".(" basics" template included with )onstruct.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

CRC32 Object
The CRC32 object allows you to hash strings and files with CRC32. CRC32 is a cyclic redundancy check, a non-secure hash function used to detect errors in code. It is often used to verify that a file download has completed correctly with no transmission errors.

Contents
!se "lo#ally 2 $roperties 3 Conditions % &ctions ' ()pressions * ()ample

Use Globally
+ark the CRC32 o#,ect as "lo#al in its Common properties, and place an instance on the first layout. The o#,ect will now appear in all layouts, and will #e the only instance you need in your entire application. If you do not use a glo#al CRC32 o#,ect, only use one per layout.

Properties
-ee Common $roperties. CRC32 does not have location, si.e or angle properties, as it is a non-layout o#,ect.

Conditions
/n hashed True if the hash file action is complete.

Actions
0ash file Takes one parameter, the file to #e hashed.

Expressions
"et file hash Retrieves the hash from the hash file action. 0ash string Takes one parameter,a string you wish to hash.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Example
The following e)ample shows hashing a file and a string. 1ote that the glo#al varia#le is not set until the file hashed condition is true. The ne)t step would #e to check the glo#al varia#le against some stored good known hash.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Edit images in construct externally


(Taken from the tutorial by David) Aussie Guy To use this feature, navigate to C: !rogram "iles #$irra Constru$t and make a ne% folder $alled &'mages&

( frame in an animation and sele$t &)aun$h *+,lorer&


-indo%s e+,lorer %ill laun$h %ith all your images e+,orted as ,ngs, %hi$h you $an drag dro, into another ,rogram.

/n$e you are done editing them, save, and $lose the folder

Cli$k yes and the images %ill be u,dated in Constru$t. The dire$tory %ont be $leared until you edit another image. Also, the feature is a bit e+,erimental, and doesn&t su,,ort adding additional frames. The Aussie Guy

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Effects
Effects in Construct are powered by pixel shaders, which require special hardware, except for PS 0.0 effects which use alternative methods of processing effects.
For details on creating effects, see pixel shaders.

Contents
1 Using effects 2 Pixel shaders in Application Properties 3 The 'Disable when:' effect property Destroy when' in !o""on properties # The P$%&ersion expression ' $(""ary

Using effects
Adding effects is tri)ial in !onstr(ct* si"ply clic+ Add effect in the ,ffects category in the property grid when yo( ha)e an ob-ect or lyer selected. .nce yo( ha)e added an effect/ so"e properties relating to the new effect appear in the property grid:

Additi)e effect's properties The category title 0 Additi)e Pl(s 1P$ 2.23 0 has the na"e of the effect and the pixel shader )ersion it re4(ires. The Name field allows yo( to gi)e the effect a c(sto" na"e. Disable when is for shader )ersioning. Remove effect will re"o)e the effect fro" the ob-ect type 1when yo( add or re"o)e an effect/ it affects all instances3. 5inally/ the properties in between/ s(ch as Intensity for Additi)e Pl(s/ are properties specific to the effect.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Pixel shaders in Application Properties


These properties contain so"e (sef(l controls for Pixel shaders. Shader version is yo(r local syste"'s s(pported )ersion. Run without PS 1ie. 6(n witho(t Pixel $haders3/ if tic+ed/ allows yo(r progra" to r(n on syste"s that don't s(pport the ga"e's shaders. 5or exa"ple/ if yo(r ga"e (sed 7arp 1a P$ 2.2 effect3/ by defa(lt the (ser will recei)e an error "essage if their co"p(ter does not s(pport at least P$ 2.2. 8y enabling 6(n witho(t P$/ the ga"e will r(n witho(t any error "essages/ b(t with all (ns(pported effects disabled.

The error "essage when a (ser's co"p(ter does not s(pport a pixel shader and 6(n witho(t P$ is disabled Simulate shader is a (sef(l option to see what yo(r ga"e will loo+ li+e on a co"p(ter with a lower pixel shader )ersion than yo( ha)e. 7hen this option is changed/ yo( will be re"inded whene)er yo( pre)iew that yo( are si"(lating a lower pixel shader )ersion than yo( ha)e/ so yo( don't accidentally lea)e it. 9o( can't si"(late a higher pixel shader than yo( ha)e 0 there is no s(bstit(te for the special hardware yo( need for pixel shaders. :ote yo( will also recei)e the abo)e error "essage when 6(n witho(t P$ is disabled and yo( are si"(lating an (ns(pported shader: !onstr(ct faithf(lly reprod(ces the r(nti"e beha)io(r on a co"p(ter when si"(lating a shader.

The 'Disable when:' effect property


This property allows yo( to conditionally disable the effect depending on the (ser's s(pported pixel shader )ersion. ;f yo( ha)e a 7arp 1P$ 2.23 effect set to disable when P$ 2.2 (na)ailable/ that si"ply "eans if yo( r(n it on P$ 1. or lower/ it gets disabled and renders nor"ally. 9o( can set (p two effects with opposite disabling to allow yo(r ga"e to s(pport two pixel shader )ersions. To the left is an exa"ple graphic:

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

This explosion is drawn on a blac+ bac+gro(nd and doesn't loo+ )ery realistic li+e that. There are two effects that sol)e this: Additi)e 1P$ 2.23 or $creen 1P$ 2.23/ $creen being a higher 4(ality blend. This is shown on the right. Altho(gh it is so"ewhat a "atter of opinion/ the $creen has a s"oother blend/ and Additi)e is harsher/ and also 4(ic+ly fills o(t white if o)erlapping another Additi)e blended ob-ect. !hoosing to (se $creen poses a proble" for (sers who don't ha)e P$ 2.2 0 disabling the effect lea)ing blac+ borders/ it's (gly. ;t is possible to set (p 'Disable when:' to (se the P$ 2.2 Additi)e blend where P$ 2.2 is not s(pported. 8y adding add a $creen blend and setting it to Disable when PS 2.0 unavailable/ !onstr(ct won't atte"pt to r(n $creen on a co"p(ter which doesn't s(pport it. Therefore by also adding an Additi)e 1P$ 2.23 effect/ and setting it to Disable when PS 2.0 available won't intefere on a co"p(ter which s(pports $creen/ b(t it will enable when $creen can't r(n. The end res(lt is rather nice: all the explosions (se Additi)e blending where P$ 2.2 is not s(pported/ and they all (se $creen blending when P$ 2.2 is present. This is called a fallback effect beca(se when one effect is not s(pported/ it falls bac+ to (sing a si"pler effect. Simulate shader co"es in handy for testing. $etting si"(late to P$ 2.2 and pre)iewing/ !onstr(ct si"(lates P$ 2.2 being (na)ailable/ and all the explosions switch to additi)e blends. T(rning off shader si"(lation when yo( ha)e P$ 2.2 will "ean they all (se $creen blends as nor"al. 5or this reason/ it is best to ha)e a co"p(ter with a high pixel shader )ersion for de)elop"ent/ so yo( can test yo(r set(p for all )ersions.

Destroy when' in Common properties

;f a (ser does not s(pport P$ 1. / yo( can disable the effect/ lea)ing the blac+ and white circle gradient ob-ect there/ b(t it loo+s rather (gly. ;t "ight be better to si"ply destroy the ob-ect

$o"eti"es yo( do not want an ob-ect to display at all if its effect is not s(pported. An exa"ple case of this is co"bining two graphics/ one with an effect/ to "a+e a glass orb effect: Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

1. $tart with a blac+ and white circle gradient and a se"itransparent glass orb graphic. 2. Add '<agnify' 1a P$ 1. effect3 to the circle gradient 0 notice it distorts bac+gro(nd 3. <o)e both ob-ects to the sa"e position and the glass orb appears to refract the bac+gro(nd. All yo( need to do is set Destroy when: in the circle gradient's Common properties to destroy when Pixel shader !" unavailable. ;f yo( now si"(late shader 2.2/ yo( will si"ply see the glass graphic on its own. This is an acceptable s(bstit(te for the eye candy Pixel shader 1. allows (s with <agnify.

The PS_ ersion expression


,)ents can be (sed to set (p other alternati)es depending on a (ser's pixel shader )ersion. 8y (sing the $yste" ob-ect's Com#are values expression/ yo( can co"pare PS$%ersion and chec+ if it is less than 2/ for exa"ple. !o"pare these ghost graphics. The ,xcl(sion effect (ses P$ 2.2/ b(t as a s(bstit(te where P$ 2.2 is (na)ailable/ s(ppose we want a se"itransparent effect instead.

.pacity cannot be conditionally enabled/ bec(ase it is a property/ not an effect. Also/ opacity effects will r(n e)erywhere/ beca(se they don't (se pixel shaders 1consider the" a P$ 2.2 effect3. $etting Exclusion to disable when PS 2.0 unavailable/ and (se the following e)ent:

;f a (ser's P! doesn't s(pport P$ 2.2/ the excl(sion effect is disabled and replaced with #2= opacity/ which at least loo+s so"ewhat ghostly. Again/ yo( can test this with $i"(late $hader in application properties: P$%&ersion ret(rns the shader )ersion yo( are si"(lating.

S!mmary
9o( can (se Disable when settings on effects to set (p effect fallbac+s/ or si"ply to t(rn off effects where they are not s(pported. Destroy when settings can si"ply get rid of entire ob-ects if they are (ns(pported and si"ply for eye candy. ,)ents (sing the PS$%ersion expression can set (p c(sto" beha)io(r for different pixel shader )ersions. The Run without PS option can re4(ire yo(r ga"e to ha)e a certain pixel shader )ersion to r(n at all. 5inally/ the $i"(late $hader property is i"portant for testing all these options/ and )erifying how yo(r ga"e appears on co"p(ters with a lower pixel shader )ersion/ or to see if it will e)en r(n at all 1beca(se of the 6(n witho(t P$ option3. These syste"s are designed to allow all yo(r (sers a good )is(al experience regardless of their pixel shader )ersion/ also allowing yo( to lower yo(r "ini"(" re4(ire"ents 0 so it is worth being fa"iliar with these controls. ;t is i"portant for yo(r ga"e to r(n and loo+ good on co"p(ters with any pixel shader )ersion>

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Expressions
Many actions and conditions have parameters, written as expressions, which are values to do with the condition or action. For example, in the condition 'Every X Milliseconds', an expression would be provided for the number of milliseconds. This might be a number li e !""", or a calculation. #asic syntax and operators $n expressions, text must be contained within %uotes &''(, and arrays within )*. The following is a list of operators which can be used in calculations and expressions+ Operator , 0 2 3 5 9 &( 8, >? >, >8, ?, ?8 @, and or, C @ at, H J+ Meaning -ddition 1ubtraction Multiplication 4ivision Modulus &remainder of division( :aise to power =arentheses &override order of operations( Test e%uality3ine%uality Example .,/ .0/ .2/ !" 3 / 67 5 !" &8 7( ; 9 / &8 <6( / 2 &7 , 6( a8b

Test less than, less or e%ual, greater than, greater or e%ual a > b Aogical -B4 Aogical D: 1tring concatenation -rray access Fonditional a 8 b and c 8 d a 8 b or c 8 d 'Eealth+ ' @ Founter.Galue )!, I, 6* at / &8 I( a 8 b J '- e%ual to #' + '- not e%ual to #'

Building strings with &


The @ operator is a very useful way of combining numbers in to strings. $t automatically converts any numbers to a string and appends them. For example, instead of+
"You have " + str(Player('lives')) + " lives left!"

you can use the @ operator li e so+


"You have " & Player('lives') & " lives left!"

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Object expressions
Most plugins have expressions of their own, which you can use to get information about that obKect. Lou can double clic an obKect in the obKect panel to see a list of all of them. - simple example is Sprite.X, which retrieves the 1prite obKect's X co0ordinate. DbKect expressions have an obKect name and the expression name separated by a dot, as in 1prite.X. 1ystem expressions have no obKect name or dot, such as WindowWidth, the width of the game display. Many expressions also use parameters, which are comma separated values in parenthesis after the expression name. - simple example is max(3, 8, 6), which returns the largest parameter &;(.

The 'Self' expression


-s a shortcut, you can use the obKect name '1elf' in an expression to refer to the current obKect. For example, in 1prite's '1et X co0ordinate' action, '1elf' refers to the 1prite. This would mean Self.X gives the current obKect's X co0ordinate, and setting the X co0ordinate to Self.X ! would move the obKect . pixels right. '1elf' cannot refer to the system obKect, so cannot be used in system conditions or actions. -s another shortcut, you can simply omit '1elf' and use+
.X + 5

$n the context of a 1prite's condition or action, this gives the X co0ordinate of . pixels to the right of 1prite. $n this case the '1elf' is implicit+ .X means Self.X, Kust you have omitted to write 1elf.

Default object expressions


=rivate variables can be accessed in in obKects li e the 1prite obKect as such+
Sprite.Value('My variable')

:emember to use 'single %uotes' on variable namesM 'double %uotes' mean text. 1prite also provides a shortcut to access a private variable+
Sprite('My variable')

Bote the omission of the dot or expression name. Nsing an obKect name directly with parameters in an expression li e this, is referred to as the default obKect expression. Many obKects use them as a shortcut to retrieve the obKect's most useful value+ using the name of a Text obKect on its own retrieves the currently set text, "o#nter returns the value of the Founter, and $rra%(3), $rra%(&, 8) and $rra%(', (, 3) are all examples of retrieving elements in the -rray obKect. :emember each plugin defines its own default expression+ not all are guaranteed to retrieve private variables li e 1prite can.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Families

Families are a way of grouping objects of the same plugin type together. For example, all sprite objects on a
player's team could be given the family Friendly. This then appears as an object type in the event sheet editor. You can then make events involving this family, and the events apply to all the objects which are a part of the family. The events treat them as a single object type. This saves you from having to repeat the same events for different object types. Families can be set up, viewed and edited using the family manager. This is accessed via the roject tab of the ribbon. Families store their own separate selected object lists !"#$s%. You can access private variables common to all objects in the family in the event sheet editor. Furthermore, if all objects in the family have the same behaviors, you can also access the family behaviors. #bjects can belong to more than one family. &ttributes are an even more generalised form of object grouping, and allow objects from different plugins to be added.

Adding a family to an object


Families can be added or removed via the property bar, when clicking '&dd new', only families which have not yet been used, or fit the same plugin type will show. #nce added, a ''emove' link allows families to individually be removed.

Using family private variables, effects or behaviors


(f all objects in a family have a private variable, effect or behavior in common, then it is accessible via the family in the event sheet editor. &ll objects must share the same variables)effects)behaviors with the same name as well, for this to work. *ote that adding a new object to a family with common private variables, effects or behaviors will invalidate all existing events using them, if it does not have the same common variables etc. To ensure consistency between objects, the family manager should be used to add and remove objects from families.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Family Manager Dialog

The family manager dialog allows simple viewing and editing of all families in an application. It is found under the Project tab on the ribbon. There is a list of all families on the left, with their icon, for representation. Upon clicking a family, all the objects that belong to it will appear in the right hand list. Objects can be added or removed using the buttons underneath. The three tabs at the bottom right show the private variables, effects and behaviors which are common to the family. This allows other such items to be added or removed in a safe way, ensuring that all objects in the family have a consistent set up. When remove is clicked when using private variables, a dialog will show which allows the user to select which objects should have the private variable removed. imilarly, when an object is added to a family, there is a prompt to add e!isting family variables to the object.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

FAQ
Here is a list of questions frequently asked on the forum. If you're new, it's recommended you read through these before posting. It's also recommended you try a tutorial before asking any questions, since the tutorials cover a lot of basic ground in using Construct.

Contents

1 Can Construct create (insert genre here) games? 2 How do I change the application icon? 3 Can Construct do 3D? 4 How do I make ob ects !ollow the screen automaticall"? # How do I make online games? $ %hat are sub&e'ents? ( How do I translate Construct? ) *" +cap !ile,Construct crashes+ Is this a bug? - How do I con'ert between te.t and numbers? 1/ How do I use (some ob ect)? 11 %hat0s the best wa" to pause m" game? 12 %here can I !ind a list o! ke"board shortcuts? 13 %here can I !ind a list o! operators used in e.pressions? 14 %ill Construct be able to e.port to *ac,1inu.,2342? 1# How do I pla" music across la"outs? 1$ %hat do 0stable0 and 0unstable0 builds mean?

Can Construct create (insert genre here) games?


Construct is a 2D game creation tool and can essentiall" make an" 2D game5 regardless o! genre+ 6o the answer is most likel" yes & "ou can make that game5 so long as it is 2D+ Construct does e'en ha'e some rudimentar" 3D !eatures like the 3D 3o. ob ect5 but it0s not 0true0 3D ("ou can0t load worlds5 models5 use cameras5 etc)+

How do I change the application icon?


7o change the icon shown in %indows5 na'igate to the 08esource 3ar0 and double click on the de!ault icon+ 9s o! the time o! writing (2nd :anuar" 2//)) other icon si;es and the top le!t window icon are not "et editable5 "et it is intended the" will be soon+

Can Construct do 3D?


7he real answer to this is 0no05 with the slight ca'eat that some basic 3D engines can be created5 using the 3D 3o. ob ect+ Howe'er it0s sa!e to sa" that "ou cannot do 0real0 3D5 as in5 load models and cameras and such+ 7he 3D 3o. is an e.perimental plugin5 and Construct was designed !or 2D game de'elopment5 not !ull" !ledged 3D games+ 9lthough more 3D !eatures is a possibilit" !or the !ar5 distant !uture5 Construct is at the moment !irst and !oremost a 2D game de'elopment program+

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

How do I make objects follow the screen automatically?


I! "ou want ob ects to sta" in the same place on screen e'en while scrolling (eg+ <I5 health bars etc)5 place the ob ects on a la"er with 6croll 2 rate and 6croll = rate set to /+ 7his pre'ents them scrolling+ =ou can use the same 06croll 2 rate0 and 06croll = rate0 'alues to create a paralla. e!!ect+

How do I make online games?


Currentl"5 "ou cannot make online games in Construct+ 9n online plugin will be completed be!ore 'ersion 1+/5 howe'er+ 9lso5 online high&score tables can be created using the H77> ob ect+

hat are sub!e"ents?


6ub&e'ents are simpl" other e'ents which run when the parent e'ent runs+ Consider this e.ample?
On Button Clicked: (sub-event) > Variable = 1: Close application (sub-event) > Variable = 2: Go to next la out

%hen the button is clicked5 there are two separate e'ents which run checking the status o! a 'ariable+ 7his can sa'e "ou a lot o! repeated e'ents+ @or more in!ormation5 see 6ub&e'ents+

How do I translate Construct?


%e appreciate all language translations since it helps bring Construct to an international audience+ @ind "our AlanguagesA sub&director" in the Construct install5 make a backup o! the Bnglish (<C) director"5 and translate the strings inside the te.t !iles+ =ou ma" not be able to !ull" translate Construct until 1+/+

#y $cap file%Construct crashes$ Is this a bug?


Yes. Construct should ne'er crashD e'en i! "ou do something completel" wrong5 "ou should at least get a prompt telling "ou what "ou did wrong5 then a grace!ul e.it (without crashing)+

How do I con"ert between te&t and numbers?


In most cases5 this is done automaticall"+ @or e.ample5 "ou can set a te.t ob ect0s te.t to an ob ect0s 2 co& ordinate+ Howe'er5 "ou ma" sometimes need to do this manuall"5 in which case "ou0ll want the s"stem e.pressions int()5 !loat() and str()+

How do I use (some object)?


1ook !or documentation here on the %iki & in the 4b ect 1ist or 3eha'ior 1ist+ Howe'er5 the documentation is a work&in&progress5 and there might not be an article on that ob ect+ @eel !ree to post on the !orum+ It0d also be great i! "ou could add what "ou learnt to the %iki5 so the ne.t person with "our problem can !ind out what "ou !ound outE

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

hat's the best way to pause my game?


6et the time scale to /+ 6ee time scaling+

here can I find a list of keyboard shortcuts?


6ee Ce"board shortcuts+

here can I find a list of operators used in e&pressions?


6ee B.pressions+

ill Construct be able to e&port to #ac%(inu&%)*+)?


*a"be one da"5 but not !or the !orseeable !uture+ Construct is de'eloped !or !ree b" 'olunteers+ It would e!!ecti'el" double our workload !or each plat!orm added+ 8ight now the most e!!ecti'e wa" !or us to work is to concentrate on one plat!orm+ Howe'er5 Construct is open source5 so i! "ou can interest other de'elopers in the work5 the" ma" be able to complete the work+

How do I play music across layouts?


<se a global 29udio2 ob ect+

hat do 'stable' and 'unstable' builds mean?


6ee 3uild 8eleases !or in!ormation on this+

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Function Object
The Function object is a simple object with a lot of very useful functionality for writing events. It revolves primarily around triggering an event which can return a value, also known as a Function. The function object has common properties.

Contents
1 Using Functions 1.1 Usefulness in vents 1.! "emember picked objects# 1.$ %arameters 1.& "eturning values 1.' (alling from e)pressions 1.'.1 )ample ! (ondition *liasing !.1 Isolated vs. Inline !.1.1 )ample !.1.! Further ideas

Using Functions
Use the Function +bject to create a new event with the condition On Function. nter "My function" as the function name. Ignore the second parameter for now. The action Call function will trigger this event. ,ou can have as many On Function events with the same name as you want, which will be triggered from top-to-bottom. *dd an action to the On Function event, eg. Destroy Sprite, and add a Call Function "MyFunction" action to another event. For e)ample.

+n any key pressed

(all function "MyFunction"

+n function "MyFunction"

/estroy 0prite

1henever you press any key, the 0prite is destroyed. The Call function action triggers the On function event.

Usefulness in Events
This functionality is very useful for making maintainable events. The above e)ample is very simple, but if the On Function event has a lot of actions which are repeated 2such as changing the 3oom for ' layers4, you can use a single Call Function action instead of having the actions repeated for several events. This then means there is only one event to change instead of many. Using 0ub-events, you can even run loops and other comple) events in an On Function event. *dditionally, you can call other functions in an On Function event - but not the same function 2recursion is not supported4.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Remember picked objects?


This parameter in the Call Function action determines whether objects picked by the calling event are transferred to the On Function event. For e)ample, consider.

0prite 5 co-ordinate is less than $66

(all function "MyFunction"

+n function "MyFunction"

/estroy 0prite

If Call function is set to Forget picked objects, all 0prites are destroyed regardless of their 5 co-ordinate. If Remember is used, the sprites with 5 less than $66 also remain 7picked7 in the On Function event, so only sprites with 5 less than $66 are destroyed. This would make the function e8uivalent to.

0prite 5 co-ordinate is less than $66

/estroy 0prite

0ometimes, however, picked objects are irrelevant 2such as in numerical calculations4, so the option doesn7t matter, in which case Forget is the preferred option.

Parameters
,ou can pass values to a function using the Add parameter action before calling the function. These can then be retrieved in the function event by inde) with the Param e)pression. g. Function.Param(1) retrieves the first value that was added, Function.Param(2) retrieves the second, and so on.

Returning values
The Set return alue action can be used inside a function to give a result from calling a function. *fter a Call Function action, the !et return alue e)pression 2Function."eturn4 contains the return value. Note: if you have used functions in other programming languages, Set return alue does not return from the function, it internally sets a variable and the function event returns after all actions and subevents have run. 9ultiple Set return alue actions in one function results in the return value being the last value set.

Calling from expressions


The Function object has the uni8ue ability to call any function from an e)pression. The set return value action determines what the result of the e)pression is. For e)ample.

0tart of :ayout

Te)t. 0et Te)t to Function.9yFunction

+n function "MyFunction"

0et return value to ;<ello, world=;

If the function name does not contain any spaces or invalid e)pression characters, it can be called by using the Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

function name as an e)pression, as in the above e)ample. Functions called from e)pressions always forget picked objects. >ote if the function called by the e)pression does not set a return value, in debug mode a warning is thrown, and in a normal preview, 6 is returned. ,ou can also pass any number of parameters to an e)pression function, eg.

0tart of :ayout

Te)t. 0et Te)t to Function.9yFunction2166, ??, $4

+n function "MyFunction"

0et return value to Function.%aram214 @ Function.%aram2!4 @ Function.%aram2$4

In this case, the te)t is set to ;1A6; 2the sum of the three parameters, 166 @ ?? @ $4.
Example

0uppose we want a function that generates a random number between two numbers, for e)ample Function."andomBetween216, !64 should give a number between 16 and !6. 1e could use the following.

+n function ""andom#et$een"

0et return value to Function.%aram214 @ random2Function.%aram2!4 - Function.%aram2144

Condition Aliasing
(ondition *liasing is a special case of calling functions, like a shortcut for testing several conditions in one. The condition Call alias triggers the condition On alias, which you can then add other conditions to. Then, add the action "eturn true 2in the (ondition *liasing category4 to the event. The Function object can then work out if the conditions turned out true by whether or not this action is called. For e)ample.

+n alias ;(trl* pressed; (ontrol key is down * key is down

"eturn true 2under (ondition *liasing4

;(trl* pressed;

0et te)t object te)t to ;0hortcut is pressed;

>ote the second event is a Call alias condition, which appears as just the alias name, for clarity. This demonstrates how you can simplify a number of conditions by giving them a name, aka. an alias.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Isolated vs. Inline


This parameter in the Call Alias condition is analogious to "emem%er pic&ed o%'ects in (all Function. In Isolated mode 2comparable to Forget4, On Alias is called and only the trueCfalse result is passed back - ie. if On Alias picked any objects, those are forgotten. In Inline mode 2comparable to Remember4, all currently picked objects are passed to the On Alias event, which can then pick other objects, and pass them back to the calling event again. In other words, with Inline aliases, object picking affects both events. *n e)ample.

;%ick 0prites in 3one *; 2inline4

/estroy 0prite

+n alias "Pic& Sprites in (one A" 0prite 5 is less than $66

"eturn true

In this case, because the alias is inline, On alias picks all objects with 5 less than $66. This is passed back to the calling event. Destroy Sprite destroys only sprites with 5 less than $66, because they were picked and remembered in the alias. If ;%ick 0prites in 3one *; was changed to Isolated, the picked objects would be forgotten and only the trueCfalse result used. In this case, as soon as a 0prite passed left of the 5 co-ordinate $66, all 0prites would be destroyed, because none are picked, since the alias did not transfer picked objects. Inline aliases can be combined freely, eg.

;%ick 0prites in 3one *; 2inline4 ;%ick 0prites in 3one B; 2inline4

/estroy 0prite

+n alias "Pic& Sprites in (one A" 0prite 5 is less than $66

"eturn true

+n alias "Pic& Sprites in (one #" 0prite , is less than $66

"eturn true

This will only destroy sprites in the area above and left of the point 2$66,$664.
Example

* condition to check if a te)t object contains a vowel.


+n alias ;Te)t contains no vowel; Find2Te)t.Te)t, ;a;4 e8ual to 6 Find2Te)t.Te)t, ;e;4 e8ual to 6 Find2Te)t.Te)t, ;i;4 e8ual to 6 Find2Te)t.Te)t, ;o;4 e8ual to 6 Find2Te)t.Te)t, ;u;4 e8ual to 6

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

"eturn true

+n button clicked DInvertE ;Te)t contains no vowel;

9essagebo). ;Te)t contained a vowel;

Further ideas

It is not yet implemented, but in future, it could be possible to add parameters to condition aliases. This would allow you to pass the string to test in a parameter rather than using a separate object in the above e)ample.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Behavior List
The following is a behavior list of currently documented behaviors. A list of objects can be found at the object list.

Game behaviors The following are behaviors which assist in game development.
Line Of Sight Assists in determining if an object can 'see' another object (ie, there are no obstacles in a straight line between them). This behavior's conditions provide the line-of-sight testing. rovides pathfinding and is commonly used to calculate routes around obstacles even in non-!T" games. Automatically resi#es an object when the user drags the mouse.

RTS

Selection Box

Shadow Caster Applies a shadow to an object if used with the light plugin. Turret $sed to ma%e an object rotate toward certain objects, as if it were an automatic gun turret. $sed to ma%e an object wrap around the other side of the layout if it moves out of the layout.

Wrap

Movement behaviors The following are behaviors which move other objects.
8 Direction Ball Bone Bullet Car Drag ! Drop ove ent &a%es an object move in a ', ( or ) direction fashion. &oves an object li%e a bouncing ball, with optional gravity. Allows objects to be lin%ed together and animated smoothly. rovides a realistic bullet style movement. &oves an object li%e a car, with s%idding and acceleration*decceleration. Allows objects to be pic%ed up and dropped with the mouse. &oves an object in a fi+ed grid, can be either player controlled or set to wander randomly li%e in ! - games. &oves an object with the mouse pointer.

"rid

ove ent

#ouse

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

$h%sics

rovides realistic physics, with weight, density, springs and friction. .reates a realistic platformer style movement, with slopes, moving platforms, jumping and jump through platforms. &oves objects in a sine wave style movement.

$latfor

Sine

Utility behaviors The following are utility behaviors which perform various operations on objects.
&ade Rotate Sha'e /ades objects in or out. 0asily rotates objects and handles acceleration*decceleration. "ha%es an object with a set intensity and area.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Hash Table Object


The hash table object allows storing of values under named keys. Keys can be created, altered and removed in runtime, thus making the hash table a dynamic one-dimensional table, which uses names instead of indexes. It can be thought of as a dynamic variable object that can create and delete named variables at runtime. Note: keys are converted to lower case. For exam le a key named !"ealth! would become !health!. #alues remain unaffected.

Contents

$ %ro erties & 'onditions ( )ctions * +x ressions , +xam le

Properties
-ee 'ommon %ro erties. "ash table does not have location, si.e or angle ro erties, as it is a non-layout object.

Conditions
For each key /e eats once for each key in the hash table. 0se the current key1value1index ex ressions to retrieve information about the current key. 'heck if key exist True if given key name exists. Is hashtable em ty True if there are no keys in the given hashtable.

Actions
Insert key Inserts a given key with given value into the hash table. -et key value -ets the value stored at a given key. )dd to value )dds to the value of the given key. -ubtract from value Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

-ubtracts from the value of the given key. 2elete key /emoves a key. 2elete all keys /emoves all keys of the hash table, effectively em tying it. -ave to file 3rites the hash table to a file on disk. 4oad from file /eads the hash table from a file on disk. 4oad from file and a /eads and a end ends the keys from a given file on disk.

Expressions
5et number of keys 6.Key'ount7 /eturns the number of keys within given hashtable. 5et current value 6.'urrent#alue7 /eturns the value of the currently icked key. 5et current index 6.'urrentIndex7 /eturns the index of the currently icked key. 5et current key 6.'urrentKey7 /eturns the name of the currently icked key. 5et value at key 6.Key7 /eturns value of the given key.

Example
This exam le shows how hashtables are very effective for storing key,value airs. 8ou will create a sim le greeting game where you will great the other objects based on how many times you have met them before. 3hat ha ens everytime you bum into another object the object9s uni:ue I2 is checked in the hashtable. If it does not exist, an entry is made. If it does, the value in the key is incremented. The layer then !s eaks! a greeting. To use this exam le, create a ;alloonTi object, two s rite objects, and a hashtable object. For the layer s rite, assign the <-way behavior. For the other s rite create a co y and lace both on layout6do not make these Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

s rites solid7. There are a few itfalls when using hashtables that this exam le will highlight=

Keys >0-T be strings. -o in this case the uni:ue I2 returned from the objects are integer, we make them strings by a ending a !s! to them. 3hen you rint out a hashtable value that has been converted in the above manner you must first store the value in a variable. This is because the "ashtable.getvalue call does not su ort concatenating the 0I2 and !s!.

+xam le-

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Hidden features
Hidden features are useful features which are not immediately obvious. Some of these features are not prominently documented, others are implicit tricks which might not become obvious until stumbled upon.

Contents

1 Importing (multiple) images 2 Object categories & 'Show in Editor' 3 egati!e dimensions " E#pressions $or colours (and other parameters) % &esi'ing with crop ( )unction e#pressions * Inheritance +a,ers

Importing (multiple) images


-he Import Images dialog o$ the animator It is possible to import a se.uence o$ multiple images $or an animation b, right/clic0ing the )rames 1indow o$ the animator and selecting import frames2 3 dialog will appear4 as0ing $or the images to import and o$$ering a number o$ use$ul tools li0e mirror5$lip and hotspot location2 -his $eature is also documented on the page $or the animator2

Object categories & 'Show in Editor'


3n o!erloo0ed entr, to the common properties o$ objects is the 'Show In Editor' chec0bo#2 6, un/chec0ing the bo#4 the respecti!e object will no longer appear in an, e!ent wi'ard4 0eeping it $ree o$ clutter (e2g2 objects li0e scener, etc2 that don't need to be used in e!ents)2 &ight below4 there is a '7ategor,' $ield that allows a categor, name to be speci$ied $or each object2 -his will $ile the corresponding object (and others with the same categor, name) under that categor,4 and sort them accordingl, in the e!ent wi'ard4 ma0ing them easier to $ind2

Negative dimensions
Sprites (and other objects) can be $lipped or mirrored b, speci$,ing negati!e dimensions $or their width and5or height properties2 3 negati!e width will mirror the Sprite (hori'ontall,)4 while a negati!e height will $lip it (!erticall,)2

E pressions !or colours (and other parameters)


1hen changing a colour parameter4 right clic0ing the parameter title and pic0ing use expression turns the colour selector into an input $ield in which e#pressions can be used4 such as the RGB s,stem e#pression2

"esi#ing with crop


3n o!erloo0ed $eature o$ the picture editor is the abilit, to resi'e the picture to an, content ,ou just pasted in b, hitting the crop toolbar icon2 -his also wor0s $or pictures which are larger than the current can!as si'e2 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

$unction e pressions
8sing the )unction object4 ,ou can use an, e#pression name and ha!e it call a $unction2 -his means ,ou can ma0e )unction2SomeE#pression return whate!er ,ou li0e4 and ,ou can pass parameters to it too9 see calling $rom e#pressions $or details and $or an e#ample2

Inheritance %a&ers
E!er, la,er has a propert, titled 'Inheritance +a,er'2 8sing this propert,4 it is possible to displa, the content's o$ another la,er / e!en $rom a di$$erent la,outs: ;ust speci$, the (uni.ue:) name o$ the la,er ,ou would li0e to 'inherit'4 and 7onstruct will search $or that la,er in the entire application2 -his is !er, practical to ma0e things li0e <8=s appear in multiple la,outs without ha!ing to cop, their containing objects2

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Hidden feature #9: Inherited Layers


(Credits to Aeal5566) I just found them and I have to say they are awesome. They are great for huds and other things that are on every layout but may change later in the game ma ing !rocess. Here is how they work. "irst ma e a new layout and name the layer something uni#ue (for my e$am!le well use %Inherited&'(%) then go to your games layout) clic on the layer that you want to be your hud and go over to its !ro!erties and it says %Inherited *ayer% ty!e in %Inherited&'(% and hit enter. The layer that you made on the other layout should be shown in your hud layer. +o if you have a game across multi!le layouts and want to ma e a change to the &'( it will be !ut through to all the layers it is inherited on Automatically. ,ou can inherit the &'( on all layouts and it will change Automatically.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Simple use of an I.N.I file


(Credits to ZOMGBananas) I had a bit of a look around, and I couldn't find any topics specifically refering to .ini files and how they are structured and used. So, I figured I'd post up a little about what I've learned after tearing apart other peoples .caps. It's nothing spectacular, as I'm still learning a majority of stuff as well. The first thing to know is how an .ini file is structured. They have

seperate parts! the "roup# the

item# and the value.

$n e%ample of ho& an .ini file mi"ht loo':


!ames"

!ame#$%red

!ame&$'ob

!ame($)ack

!ame*$Tom

In that e+ample, !ames" is the group, !ame#, !ame&, !ame( and !ame* are items, and %red, 'ob, )ack and Tom are values. Inside our .ini file, we can have as many groups and items as we need. In -onstruct, before we can do anything with an .ini file, we need to add in the I!I object. This object doesn't need to be placed in the layout, similar to the .ouse / 0eyboard object. Then we need to tell -onstruct to load the file. It's simple to do.

System 1 Start of 2ayout


Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

3 I!I Set I!I file to 4pp5ath 6 7names.ini7

5utting this as your first event will set the location of the .ini file you want to use. 4pp5ath tells -onstruct that the .ini file is located in the same place as the .cap or .e+e you are running. If you have your .ini file in a different location from your .cap or .e+e, you need to specify its location instead of 4pp5ath. 8hen we want to get a value from out of our .ini file, we need to specify which group and which item we want to get. In this e+ample, if we wanted to get the name )ack, we need to specify the !ames group, and the !ame( item. Say we want to display the name )ack in a te+t object when an event is met, like your player sprite overlaps an something else. To do this, you would do something similar to:

5layer is overlapping )ackTrigger

3 Te+t set te+t to I!I.ItemString97!ames7, 7!ame(7:

;sing an event similar to that should cause the name )ack to appear in the te+t object. To e+plain what the condition means, obviously we are taking the Te+t object, and setting the te+t to something. 8e have specified that we want to set the te+t to what we find in our loaded .ini file. Inside the brackets, we tell -onstruct e+actly which part of the .ini we want to display. 7!ames7 is the name of the group we want to look in. Telling -onstruct to look there will cause it to ignore any other groups in the file during this condition. Then, we tell -onstruct to look at the item !ame(. !ow that we have specified the group and the item, -onstruct can now take the string contained in !ame(, and display it in the Te+t object. 8orth noteing in relation to where we said I!I.ItemString in the above event. 8hen loading data from an .ini file, you can grab it in two different ways, with .ItemString or .Item<alue. If you are only storing te+t, or things you want to appear as te+t, then use .ItemString. =owever, if you are using an .ini file to load a value for something you need to use in any math, like a weapons power or a sprite location, you want to use .Item<alue. If you use ItemString when you want to load a number you want to manipulate later on, -onstruct will consider it as a te+t string, and you will be unable to use it in math operations and the like. >n the other side, if you load te+t using .Item<alue, -onstruct will be unable to use it in math, and will default it to a value of ?. So, when loading data from an .ini file, make sure you use the right e+pression for the purpose you want to use that data for.

This is only a simple e%ample of the use of an .ini file. >nce you begin to e+plore and understand how to Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

manipulate them, their uses increase dramatically. @ou can use an .ini file to store locations of sprites placed in a level editor for saving, or read them for loading them, or for various attributes for items in your A5B. 4 small A5B item list might look like this:

(Item)*

!ame$'ronCe Sword 5ower$&?

8eight$D -ost$#??

Eescription$4 simple, uninteresting sword cast from bronCe

(Item+*

!ame$=oly Sword 5ower$&??

8eight$(? -ost$#????

Eescription$4 sword of holy vengeance, once held by an angel

To make use of that data when loading, you would specify which one of the items you want to use 9if you wanted to use the =oly Sword, you would specify Item& as the group:, and then you can load the data from the items !ame, 5ower, 8eight, -ost and Eescription. ;se .ItemString for !ame and Eescription 9because the data inside is te+t, and we will only really use that data in a te+t object:, and .Item<alue for 5ower, 8eight and -ost 9because we want the data to remain as values, so we can use them later in eFuations to determine how much damage the sword does, how much it costs to buy one, and so forth:. =ow you would use that data is up to you to work out though, I'm only showing you how to get those values out of a .ini file. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Interface overview
This page summarises the UI features in Construct. Below is an image labelling the different parts of the interface.

Labelled Construct screenshot with UI features. See below for descriptions.

Contents

1 Design 2 Summar 2.1 !e board shortcuts 2.2 "ile menu 2.# $uic% access toolbar 2.& 'ibbon 2.( Bars 2.) *ditors 2.+ Dialogs

Design
The interface consists of the following. Clic% the lin%s to find out more about each element.

The ribbon, a tabbed toolbar with lots of buttons and options, at the top of the window. The main editor, the la out editor shown, which can be switched between with the Window tabs when se-eral are open. .ou can change between the la out editor and e-ent sheet editor b the Editor tabs towards the bottom. / number of bars, such as the properties bar, pro0ect bar, la ers bar, animator bar, resources bar and ob0ect bar.

Summary

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Keyboard shortcuts
See the %e board shortcuts page for information on the -arious shortcuts a-ailable.

File menu
The file menu is similar to traditional file menus, containing options to start new pro0ects, sa-e, open, load recentl used files, change preferences and so on. Select File - New - Direct-X Game to start a blan% new game. There are templates found at File - New - Template/Example with demonstrations of game engines and other e1amples made in Construct.

Quick access toolbar


This is a mini2toolbar alwa s on screen, which hosts the most commonl used commands for 3uic% access. B default Save and Preview are present. Clic% the Down arrow at the end of the row to4

Configure which options appear in the toolbar. 5o-e the toolbar abo-e or below the ribbon. 5inimi6e the ribbon, which auto2hides the ribbon and lea-es the tabs -isible.

Ribbon
See the ribbon page. .ou can switch between different ribbon pages using the ribbon tabs. These also automaticall change depending on where ou are. "or e1ample, the Events page is automaticall selected when ou open the e-ent sheet editor.

Bars
See the bars page. Bars can be rearranged to suit our taste in a number of wa s. .ou can4

Clic% and drag the title to doc% the bar an where, or undoc% it and lea-e it 7floating7. 8n a multimonitor s stem, ou can lea-e bars floating on a separate displa , freeing up room in the main editor window. Bars can also be doc%ed on top of another bar, and tabs appear to switch between them. This is how the three bars on the right hand side are doc%ed b default. Clic% the pin icon ne1t to the cross to auto i!e the bar. It appears -erticall in a tab, and the bar pops out when ou ho-er the mouse o-er it, sa-ing room. Clic% the cross to hide the bar. .ou can show it again using the 9ome tab on the ribbon.

Editors
The la out editor can be 6oomed b holding control and scrolling the mousewheel. 5iddle2clic% and drag can also pan2scroll the la out editor.

Dialogs
See a list of dialogs.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Construct Screenshots
Here are a selection of Construct screenshots. There are more screenshots in other sections to illustrate features. The Event Sheet editor. Shows the visual way in which Construct games are defined by events. Human readable, and powerful enough to make complex games. See Event Sheets for more screenshots on events.

The Layout editor. The interface for creating layouts and levels for your game and menus. b!ects can be arranged on separate layers, also allowing for effects like parallax and lighting maps "pictured#.

Effects in the Layout editor. $anipulating an ob!ect with an effect on it, with live preview.

A selection of Construct plugins. Construct has over %& built'in plugins which can be dropped in to a layout and provide functionality.

A selection of Construct behaviors. (ehaviors can be added to ob!ects for instant customisable capabilities, like a platform movement, or enabling drag'and'drop.

Effects at runtime. ) screenshot of an animated effect at runtime. Construct uses a fast *irect+ , hardware'accelerated renderer, with pixel shader effects.

Main interface

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Layer Properties
To bring up layer properties, left click any layer in the layer bar.

Layer Properties

Title: The name of the layer. You can use this name to refer to the layer in the event sheet editor. Visible: Toggle visibility of the layer in the layout editor. This does not affect the visibility of the layer at runtime. This option is useful with lighting layers or other layers with an opaque background, which may obscure other layers. You can also toggle this clicking the eye icon in the layer bar beside the layer.

Display Properties

Transparent: Specifies this layer has a transparent background. Background: Specifies the background colour of this layer when it is not transparent. Scroll X / Scroll Y: Allows you to scroll the layer independantly from the other layers Scroll X rate / Scroll Y rate: Affects how quickly the layer scrolls when the display scrolls. se for paralla!ing, eg. a background layer with rates of "#$ will scroll half as fast as a foreground layer with rates of %##$. se #$ for a & layer which should not scroll. Zoom X / Zoom Y: The 'oom of this layer eg. (##$ is twice as big, "#$ is half as big. Zoom X rate / Zoom Y rate: The rate of 'oom of this layer. se for paralla!ing, eg. &f you 'oom into the screen by (##$, a 'oom rate of (##$ will make the layer become ) times as big, while a 'oom rate of %##$ will make it ( times as big, and a 'oom rate of "#$ will make it %." times as big. A 'oom rate of # will make the layer stay %.# times as big no matter the 'oom. Opacity: The semitransparency to display this layer at. %##$ is normal, fading through to #$ as transparent. Filter: The colour filter to display this layer with. *hite maintains normal colouring. Force o n te!ture: +orces the layer to display on its own te!ture. This changes how effects work , a layer drawing to its own te!ture does not contain the background, so blending effects will render with the background colour, but this option is required to make the -rase effect work. .ote the layer draws to its own te!ture anyway when any effects are applied, opacity is not %##$, or filter is not white.

Inheritance

"n#eritance Layer: &f this is filled out, /onstruct will try to find a layer of that name and display it0s contents in the current layer. This also works between different layouts, so you can display the contents of another layout0s layer without having to copy any containing ob1ects.

Effects

See -ffects for information on effect properties. These allow you to apply an effect to the entire layer.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Layers Bar
The Layer Bar shows the layers in the current layout, and the objects on these layers. Like all other bars, it can be docked, undocked, hidden and pinned. Single clicking on a layer shows its properties in the properties bar, such as effects, scroll rate and zoom rate. To move an object from one layer to another you may click on the object and drag it to the appropriate layer in the layer bar. See also Interface overview.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Layout Properties
Layout properties can be accessed by selecting a layout in the project bar, or clicking an empty space in the layout editor.

Title: The name of this layout, which also is displayed in the Project Bar. Width & Height: The dimensions of the level. The white canvas you see in the layout editor is also this size. hanging the layout dimensions to a larger size uses no more memory than a small size so the dimensions can be whatever you want. Application background: !nable if you want your background not to use the Colour property, but to paint a "indows colour background according to the user#s theme, so your window looks like an application. This is enabled by default in the $pplication runtime. Colour: %f Application background is disabled, the background colour of the layout. Unbounded scrolling: By default, scrolling is restricted to keeping the window within the width&height of the layout. %f you enable unbounded scrolling, there are no limits imposed on scrolling, eg. you can scroll to negative '&( coordinates. Event Sheet: The event sheet attached to this layout. The layout uses this event sheet only, but the event sheet can include other event sheets, allowing for global events. )ee event sheets. Application Properties: )hortcut to display application properties.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Light Object
The Light object casts shadows off objects with Shadow Caster Behavior. A semitransparent shadow which does not darken when overlapping other shadows can be achieved using a layer. Use a shadow opacity of !!"# and place the light object on a layer using the layer opacity to change the semitransparency of the layer.

Common
The Light object has common actions# conditions and e$pressions %AC&s' for position# dimension# angle# visibility# filter# opacity# ( order# and count ) destroy.

Properties
See Common *roperties. Shadow filter Color of the shadow an object with Shadow Caster Behavior drops. +efault is black. Shadow opacity Semi,transparency of the shadow. +efault is !!".

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Keyboard shortcuts
Following is a list of keyboard shortcuts that you can use in Construct. See also Interface overview.

Contents

1 Global shortcuts 2 Layout editor shortcuts 3 Event sheet editor shortcuts 4 Picture editor shortcuts 5 Bone Editor shortcuts

Global shortcuts
Control + P Control + X Control + C Control + V Control + N Control + O Control + S Control + Shift + E Control + Shift + L Runs a preview o the current application! "ut "opy Paste #ew $irect% application &pen 'ave Go to event sheet editor! Go to layout editor!

Layout editor shortcuts


Shift + left click Control + left drag 'elect (ultiple ob)ects! "opy the current ob)ect instance to the dropped location!

Control + mousewheel *oo( in+out! Middle mouse button "lic, and dra- to pan.scroll!

old s!ace + left click "lic, and dra- to pan.scroll! Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

old Enter + left click Enter while dragging an ob"ect Shift while resi#ing Control + u!$down Control + Shift + L Control + Shift + % &rrow ke's Shift + &rrow ke's

'elect ob)ect underneath the selected ob)ect! /elp ul to select di icult.to.reach ob)ects! "reate another instance o the dra--in- ob)ect at the (ouse! Proportionally resi0e ob)ect! Brin- ob)ect orwards+bac,wards in * order! Loc, selected ob)ect1 so it cannot be selected! 2nloc, all ob)ects! 3ove ob)ect! 3ove ob)ect 4uic,ly!

Event sheet editor shortcuts


Shift + left click Control + left click Control + left drag a c e s 'elect all events+conditions+actions over a ran-e! 5dd clic,ed event+condition+action to selection!

"opy the current event+action+condition to the dropped location! 5dds an action to the currently selected event! 5dds a condition to the currently selected event! 5dds an event either under 6not as a sub.event7 the currently selected event or1 i no event is selected1 at the botto( o the current event sheet ! 5dds a sub event to the currently selected event!

Picture editor shortcuts


Mousewheel Shift Num !ad ( *oo( in+out! /old to (aintain proportions with tools! "enter the hotspot! &ther nu( pad buttons 1.8 assi-n hotspot to correspondin- ed-e or corner!

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Shift + cro! &lt + cro! Shift + click &lt Control + click

"rops but leaves a 1 pi9el wide transparent border all the way around the i(a-e! :his allows or s(oother.ed-ed rotations and scalin-! "rop all ra(es in the current ani(ation! $raw lines with the Brush tool! /old while (ovin- the hotspot or an i(a-e point to apply the chan-es to the entire ani(ation! Get colour o pi9el under (ouse!

Bone Editor shortcuts


Shift + left click 3ove a previously placed pivot point!

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Minimap Object
The Minimap object allows you to plot dots representing objects in the entire frame. Its most common use in a game is to act as a "radar" to show the player's position in relation to the enemy.

Contents

1 Properties 2 Common Conditions ! "ctions !.1 #ap $ %&pressions $.1 Co'ordinates $.2 #isc ( %&ample

Properties
Transparent )ets the minimap to be transparent on the screen. *ac+ground If the transparent button is not chec+ed, this sets the bac+ground color. -raw window -raws a window centered around the player's object. This windows mo.es with the player. /indow )pecifies the color of the border of the window. Points )i0e The si0e of the points drawn on the minimap 1se te&ture

Common
The #inimap object has common actions, conditions and e&pressions 2"C%s3 for position, dimension, .isibility, opacity,4 order,and count 5 destroy. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Conditions
Pic+ by comparison Ta+es three parameters, two .alues to compare and a comparison operator Pic+ by e.aluate Ta+es one parameter,a .alue6e&pression

Actions Map
Clear terrain -raw terrain Plot object Plot point

Expressions Co-ordinates
Con.ert layout 7 to map 7 Con.ert layout 8 to map 8 Con.ert map 7 to layout 7 Con.ert map 8 to layout 8

Misc
9et number of objects

Example
The minimap object should normally be placed on the 1ser Interface21I3 layer. This will insure that it stays in the same place no matter where your player mo.ed. To add basic minimap capability to any game perform the following actions:

In the ;ayout %ditor add the minimap object 2ma+e sure to place it in the 1I layer3. In the properties select how you want the map to appear. <or e&ample, ma+e the map transparent if you want it to be less noticeable. In your "lways2e.ery tic+3 condition, add new actions for your objects. <or e&ample, in the ghost shooter demo you would add two minimap actions. =ne for your player and one for the monsters.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

The following e&ample shows how to create a toggled minimap by pressing #,

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Mouse & Keyboard Object


The mouse and keyboard object allows reading of keyboard and mouse input.

Contents

1 Properties 2 Conditions 3 Actions 4 !pressions

Properties
"ee Common Properties. #ouse $ keyboard does not ha%e location& si'e or angle properties& as it is a non( layout ob)ect. *t is recommended that mouse $ keyboard ob)ect is made global for it to function across all layouts.

Conditions
+n click Triggers when the gi%en mouse button is pressed. Note it distinguishes between single and double click. +n any click Triggers when any mouse button is pressed. +n mouse button released Triggers when gi%en mouse button is released. #ouse button is down, True if gi%en mouse button is held down. +n ob)ect clicked Triggers when gi%en ob)ect is clicked onto with a gi%en button. #ouse is o%er ob)ect, True if mouse cursor is ho%ering o%er the gi%en ob)ect. +n mouse wheel up Triggers when mouse wheel is turned up. +n mouse wheel down Triggers when mouse wheel is turned down. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

+n key pressed Triggers when gi%en key is pressed. -ey is down, Triggers when gi%en key is held down. +n any key pressed Triggers when any key is pressed. +n control pressed Triggers when the Control key is pressed. Control is down, True if the Control key is held down. +n key released Triggers when gi%en key is released.

Actions
"et cursor %isible Toggles the %isibility of mouse cursor. Tip: You can use a custom sprite to act as a cursor with mouse's cursor disabled. "et mouse . "ets mouse cursor to gi%en . position& in screen co(ordinates. "et mouse / "ets mouse cursor to gi%en / position& in screen co(ordinates.

Expressions
0et mouse absolute . 1.Abs#ouse.2 0ets the mouse . position in screen co(ordinates. 0et mouse absolute / 1.Abs#ouse/2 0ets the mouse / position in screen co(ordinates. 0et mouse . 1#ouse.2 0ets the mouse . position on layout. "hortcut for the system e!pression. 0et #ouse / 1#ouse/2 0ets the mouse / position on layout. "hortcut for the system e!pression. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Object List
The following is an object list of currently documented plugins. Note that the system object is built in and thus not included. A list of behaviors can be found at the behavior list.

Contents

1 Audio 2 Controls 3 ata ! "iles # $ame % $raphics & 'nput ( 'nternet ) *ther + ,rofessional 1- .ystem

Audio
Audio Converter ID3 MOD Text-to-speech XAudio2 Convert sounds between different formats. /etrieve ' 3 information tags from media files li0e 1,3. ,lay module audio files 2.mod3 .it3 .s3m3 .4m5 6ave some te4t automatically read out to the user. ,lay music and sound effects for your game.

Controls
B lloon Tip B r Ch rt Button Co!bo Box Co!!on Di lo" #dit $TML List List Box Mess "e Box %ro"ress B r isplay a balloon tip prompt. isplay a bar chart. A push button or chec0 bo4. A list3 dropdown3 or dropdown list control. .how common dialogs li0e file3 folder and colour pic0ers. isplay an edit bo43 for data input and display. isplay a fragment of 6T17 formatted te4t. /epresent data in a list or grid with headers. A scrollable list control. ,rompt the user with a message bo4. A progress bar control.

Data & Files


Arr & Bin r& C'C32 .tore an array of data3 in 13 2 or 3 dimensions. 1anipulate binary files. Compute C/C32 values.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

(ile (ile )p& $ sh T ble I*I %rint Text M nipul tor +ersion In,o -I%

1anipulate files on a user8s hard drive. .ee which files are being modified on the user8s system in real9time. .tore values under named 0eys. 1anipulates 'N' data files. .end items to the printer. "unctions for processing te4t. /etrieve version information from files. 1anipulate :', compressed archives.

Game
3D Box Box C nv s C rd . !e Dropsh do/ .r dient Li"ht Mini! p Object0% irer % rticles %l s! )prite Tiled B c1"round A bo4 which displays in 3 . An outlined or filled rotatable bo4. A surface that can be drawn to and process effects. .tore a dec0 and draw cards. Automatically attach a dropshadow to an object. .how a gradient over an area. Cast shadows off objects with the shadow caster behavior. ,lot points representing objects on the layout. ynamically pair objects together. Create particle effects. ,rocess ,lasma effects. An animated game object with behaviors and effects. isplay a tiled te4ture3 which can be scaled3 rotated and moved.

Graphics
I! "e List I! "e M nipul tor Text .tores a list of images in memory3 for use in control objects li0e the list object. ,rocess images in memory. isplays te4t with a specified font3 si;e and colour.

Input
Mouse 2 3e&bo rd Ta0e input from the mouse and 0eyboard.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Internet
Do/nlo d $TT% ownload files and pages from the internet. Communicate over the internet via the 6TT, protocol.

Other
A+I D te (unction L &out Ti!eline 4ebc ! ,lay A<' files. "unctions for processing dates and times. Call named functions3 with parameters3 and even call functions in e4pressions. .how another layout within this layout. .chedule events over a timeline. .how video from a webcam.

Professional
%ro,iler A very high resolution timer.

System
Clipbo rd % th %rocess 'e"istr& )&s In,o 4indo/ 1anipulate what is stored on the user8s clipboard. 1anipulate paths and path names. .ee which processes are running on the system. Access the system registry. /etrieve information about the user8s system. Change aspects of the runtime window.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Optimisation tips
Here are some tips to maximise the framerate in your games. Enabling FPS in caption in application properties will place the FPS (frames per second) rate in the window titlebar - fullscreen games will ha e to code their own FPS counter! which is explained in the article about tic"s.

Contents

# $nderstanding optimisation #.# %P$&'P$ parallelism ( )ptimising rendering (.# *extures (.#.# *extures and +,-. (.( Pixel shaders (.(.# $se PS /./ effects (.(.( - oid redundant effects (.(.0 $sing layers to optimise high ob1ect counts (.(.2 3umpmapping s. Heightmapping (.0 *iled 3ac"grounds (.2 Experiment4

Understanding optimisation
'ames should use V-synced framerate mode in application properties. *his pre ents tearing! impro ing the display 5uality. 6n this mode! when the display has finished rendering! the system waits until the next ertical sync on the monitor. %ommon refresh rates range from 7/H8 to 9:H8. Setting your game to run with Unlimited framerate mode will allow you to see how fast your game can run! with the system ne er waiting! wor"ing at #//; capacity. )ften this is ery high! in the hundreds of frames per second. 6deally your game will always achie e at least #// FPS - this means it is wor"ing fast enough to comfortably achie e +-sync rate on all monitors. 6f the framerate falls below +-sync rate! the game may start to appear choppy< there won=t be any tearing! but some frames will simply not be displayed! because the system is still busy processing the last frame. >ith a well designed game! the gameplay will proceed at the same speed in both +-Sync and $nlimited framerate modes. 6f parts of your game run extremely 5uic"ly in unlimited mode! read the article on *ime?elta to resol e this! since it is an important part of a professional game.

CPU/GPU parallelism
6n %onstruct! the e ent list and other general tas"s are completed by the %P$ (central processing unit) in your computer. *he hardware-accelerated ?irect@ A display engine sends drawing commands to the 'P$ (graphics processing unit)! a seperate! specially designed processor for rendering. 6n %onstruct! the 'P$ is busy rendering the pre ious frame while the %P$ is running the e ent list and generating a list of draw commands for the next frame. *he important concept is that the %P$ and 'P$ are always wor"ing at the same time. *his means the time it ta"es for any gi en frame to complete is whichever took longest: the drawing! or the e ent list. A/; of games will re5uire longer to draw the screen than process the e ents! which means typically! the game events have no impact on performance. - fre5uent misconception is that you can impro e the framerate by remo ing redundant e ents or using different combinations of e ents to do the same thing but 5uic"er. >hile good Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

practice! this often does nothing to impro e the framerate. For a complete description of how the %P$ and 'P$ wor" in parallel! and how to measure which is fastest! see the article on tic"s.

Optimising rendering
-s we ha e established abo e! it is most important to optimise the rendering of your game. *his section includes tips on how you can achie e this.

Textures
- general rule of thumb is that the 'P$ is much more efficient at rendering the same thing repeatedly than constantly drawing different things. For example! Sprites showing the same texture are drawn much more efficiently when no other ob1ects come in between them in the B-order. %onstruct=s renderer draws all ob1ects from bac"-to-front. :// ob1ects showing the same texture in contiguous B-order will be drawn efficiently! whereas if another :// ob1ects showing a different texture are interspersed (ie. drawing ob1ect -! ob1ect 3! ob1ect -! ob1ect 3...) the rendering is less efficient. *his is important with particle effects! especially when particles of differing textures are used. -n easy way to guarantee contiguous B-order is to place all ob1ects of the same texture on their own layer.
Textures and VRAM

.ost (in fact! probably all) ideo cards will place textures on a power-of-two si8ed surface in memory (ie. 0(x0(! 72x72! #(9x#(9 etc). *his means a (:Cx(:C si8ed image will re5uire memory for a :#(x:#( surface to be allocated! on to which the (:Cx(:C image is stored. 6f the texture is resi8ed to (:7x(:7! it can fit on the next si8e down surface! and use less +,-. by a factor of 2 (:#(x:#( D (7(#22 pixels! (:7x(:7 D 7::07 pixels). 3ear in mind! howe er! it is only worth optimising for this in extreme circumstances! such as with ery large textures 1ust abo e a si8e boundary! or with large numbers of textures.

Pixel shaders
Use PS 0.0 effects

Shaders are often intensi e on the 'P$. -ny pixel shaders in %onstruct mar"ed PS 0.0 do not re5uire or utilise special pixel shader hardware! and are ery fast to process. $sing PS /./ effects instead of effects which are PS #.# or abo e can impro e performance in many cases.
Avoid redundant effects

Shaders often impact performance! and using a shader on a button! bac"ground! scenery or anything else which is static is a waste of rendering time - %onstruct redraws the entire display e ery frame regardless of whether anything has mo ed or not. $se image processing software li"e Photoshop to pre-render the final image you want! and place this image in your game without any effects on it. *he end result will loo" identical and render much faster. 6n addition! many effects can be especially intensi e! including blurs. *ry to pre-blur whene er possible. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Using la ers to optimise !ig! o"#ect counts

Sometimes! applying a pixel shader to many ob1ects can be done more efficiently using a layer. 6f you apply the effect to the layer and place all ob1ects you want to ha e the effect on that layer! the pixel shader is only processed once! but for a larger area. *his can substantially impro e performance< rendering a fullscreen blur on :// pre-rendered ob1ects can be significantly faster than running :// indi idual blur shaders.
$umpmapping vs. %eig!tmapping

*he 3umpmapping shader (which uses normal maps) is faster than the Heightmapping shader! because the Heightmapping shader first con erts it to a normal map! then bumpmaps it. Eo con ersion is done with 3umpmapping! so it is faster. Howe er! normal maps cannot be rotated! so you may prefer heightmapping in some circumstances. .ore detailed information is in the 3umpmapping article.

Tiled Backgrounds
*he tiled bac"ground plugin renders fastest with a s5uare power-of-two si8ed texture! i.e. #7x#7! 0(x0(! 72x72! #(9x#(9 etc. $sing a texture of this si8e also results in ery smooth scrolling! since other si8ed textures may introduce FseamF artefacts along the edges of tiles.

Experiment!
Ha e a play around and see what you can come up withG often you can use layers or techni5ues similar to the ones listed here to achie e rendering which loo"s similar! but renders a lot faster. )ften this is a satisfactory result.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Pairer Object
The pairer object allows more control over object pairing. Unlike containers, with the object pairer you can dynamically create pairs of objects during runtime. Of course, the object pairer only allows grouping two objects together.

Contents

1 Properties !onditions " #ctions $ %&pressions ' %&ample

Properties
(ee !ommon Properties. Pairer does not have location, si)e or angle properties, as it is a non*layout object.

Conditions
+or each paired ,terates through each paired object Pick paired (elects the paired object

Actions
!lear all Pairs -emoves any pairings that have been set Pair Objects Pairs two objects together. .ou can pair sprites with tiledbackground objects.

Expressions
/one

Example
0avid provided a great e&ample of working with the object pairer on the forum pairer e&ample. ,n the e&ample, you pair green and brown object together. !licking on one of the brown sprites calls the pair object action. Then when you mouse over the objects, if that object had been previously paired it is picked and highlighted red. The e&ample is shown below1 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

PCM Audio
PCM ('Pulse code modulation') Audio is an uncompressed format for representing sound signals digitally. Among other uses, it is the format in which sound is stored on standard audio CDs. Wave files (.wav) tend to contain PC audio, although they can actually contain a num!er of formats such as P", ADPC and others. Construct's #Audio$ o!%ect only supports .wav files in PC , ADPC or &W A format. 'ince PC Audio is not compressed, the files don't have to !e decompressed !efore they are played, which means that they have a lower CP( usage. )n the other hand, the uncompressed files are *uite large. At CD *uality, each minute of sound ta+es up more than ,- mega!ytes. .n this case you'd pro!a!ly prefer a compressed format to save space.

Finding out the format of a WAV file


Windows 'ound /ecorder can identify the format of a WA0 file. 'imply right clic+ the WA0 file and select Record, or find it under 'tart 12 Accessories 12 3ntertainment 12 'ound recorder. )nce the file is open, select 4ile 12 Properties. 5he Format: te&t descri!es the WA0 format, which will loo+ something li+e6 PCM 22.050KHz, 16 Bit, Stereo 5his shows the file is in PC format. #Audio$ also supports ADPC . Any other formats (such as layer1", A1law, u1law etc) will not !e a!le to !e played, and you'll have to convert them first. P37

Converting to PCM
.n 'ound /ecorder, select 4ile 12 'ave As. .n the save dialog, there is a !utton under Format: la!elled Change. 5his !utton opens a dialog which allows you to select the PC format. 5ry to also match the fre*uency, !its, and mono8stereo settings of the old format in PC to ensure a high *uality conversion.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Picture Editor

The Picture Editor is the default image editor for Construct. It is used for editing icons, such as the application icon, and textures, animations and images for objects, such as sprites. See also the Interface overview. The Picture Editor will open automaticall whenever ou create a new Sprite or Tiled !ac"ground. To open the Picture Editor manuall , ou can do one of the following#

Clic" $Edit$ next to the Icon or Small Icon in an object%s common properties &ouble'clic" (or right'clic" and select $Edit icon$) on the default application icon in the resources bar Edit a specific object* for example# select a sprite and double'clic" one of the sprite animation frames in the animator bar

The Picture Editor appears as shown on the right. It is divided into seven sections#

The Menu Bar, located at the top The Tool Bar, located at the left The Image Window The Color Selector, located at the right The Filmstrip, located below the Image +indow. This is onl shown when editing animations The Swatch Palette, located below the ,ilmstrip The Coordinates Dialog, located in the bottom right'hand corner

Contents

- The .enu !ar / The Tool !ar 0 The Image +indow 1 The Colour Selector 2 The ,ilmstrip 3 The Swatch Palette 4 The Coordinates &ialog

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

The Menu Bar

,rom left to right the items on the .enu !ar are as follows#

New# Create a new image file Open# 5pen an existing image file. Supported file t pes are .png, .jpg, and .bmp. The Picture Editor will correctl automaticall appl alpha channel information for .png images, so images with transparenc will be imported correctl Sa e# Save the current image as an external file Pre!erences# Edit the Picture Editor preferences Cut# Cut the current selection of pixels Cop"# Cop the current selection of pixels to the clipboard Paste# Paste the current selection of pixels from the clipboard Delete# &elete the current selection of pixels #ndo# 6ndoes the precious action. Construct supports multiple levels of 6ndo $edo# 7edoes a previousl undone action. Construct supports multiple levels of 7edo Flip %ori&ontal'# ,lip the current image or selection hori8ontall Flip (ertical# ,lip the current image or selection verticall $otate# 7otate the current image or selection Crop# Trims an excess transparent pixels from the outer edge of our image. 9and tip# use Shift:Crop to leave a - pixel transparent border around our image. This can improve the ;ualit of rotations and scaling in objects li"e Sprite. <nother tip# This tool will also wor" the other wa and enlarge our image boundaries to accomodate an content bigger than the current image si8e, which is hand for resi8ing after pasting). $esi&e# 7esi8es the image boundaries. 7esi8ing will not stretch our image, it simpl trims space from or adds space to the right and bottom edges of our image

The Tool Bar


,rom left to right the tools available are as follows#

Freest"le Select# Select pixels freehand. Clic" and drag our selection Pol"gonal Select# Select pixels with a straight'edged pol gon. Clic" and drag to begin our selection, clic" to add new points to the pol gon, and double'clic" to end our selection $ectangle Select# Select a rectilinear area of pixels. Clic" and drag to ma"e our selection Ellipse Select# Select an elliptical area of pixels. Clic" and drag to ma"e our selection Wand# Clic" to select a single area of one color Color Select# Clic" to select all areas of one color Magni!"# Clic" to 8oom the image window. <lternatel , scrolling the mouse wheel up or down will 8oom the image window in or out E"e Dropper# Clic" to select the foreground color from the image Pencil# &raw with a one'pixel brush. Clic" and drag to create a freehand line. The left mouse button will draw with the foreground color and the right mouse button will draw with the bac"ground color Brush# &raw with the brush. The settings for the brush can be accessed when the brush tool is selected. These settings appear below the .enu !ar Eraser# Erase pixels with the brush. The eraser shares the same settings as the brush tool Te)t# Create rasteri8ed text within the image window.This feature is not yet implemented. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Flood Fill# Clic" to flood a single area with the selected color. =eft clic" to fill with the foreground color and right clic" to fill with the bac"ground Change Color# Clic" to change all areas of one particular color to the selected color *ine# Clic" and drag to draw straight lines. Shares the settings for the brush tool $ectangle# Clic" and drag to draw a rectangle. 9old shift while dragging to restrict the rectangle to a s;uare Pol"gon# Clic" and drag to begin drawing a pol gon. Clic" to add points to the pol gon. &ouble'clic" to close the pol gon Ellipse# Clic" and drag to draw an ellipse. Shares the settings for the 7ectangle tool. 9old shift while dragging to restrict the ellipse to a circle %otspot# Set the hotspot of our image. >ote that this applies onl to sprites and the bac" face texture of the 0& !ox. ?ou can place the hotspot with the mouse, or use the numerical "e pad to align our hotspot. ,or instance, press 2 to center the hotspot, press 4 to place the hotspot in the upper left'hand corner Image Point# Set up one or more image points for our image. >ote that this applies onl to sprites

The Image Window


This is the drawing area of the Picture Editor. The boundaries of our image are indicated b a blac" rectangle. ?ou can 8oom the image window with the .agnif tool, or b scrolling the mouse wheel up or down. If our image exceeds the bounds of the image window, ou can navigate with the scrollbars or drag the window with the middle mouse button.

The Colour Selector


Clic" the color selector to pic" our desired color. =eft clic"ing will select the foreground color, and right clic"ing will select the bac"ground color. The slider next to the color selector will adjust our color%s luminosit (a range of blac" to white). ?ou can also manuall enter values into the color selector, for either red, green, and blue (7@!), or for hue, saturation, and luminosit (9S=). ?ou can also set our chosen color%s opacit with the opacit slider. < value of 8ero is completel transparent, and a value of /22 is completel opa;ue. !elow the color selector are two boxes and a button. The color in the upper box indicates the currentl selected foreground color, and the color in the lower is the bac"ground. The button next to these boxes will toggle the foreground and bac"ground colors.

The Filmstrip
The filmstrip onl appears when editing an object with animations. It allows ou to navigate through the frames in the selected sprite%s animation, allowing ou to edit several frames without opening them individuall . Clic" on a frame to view that frame in the image window. Currentl ou can onl navigate through frames that are created before opening the Picture Editor.

The Swatch Palette


This is a customi8able palette that will allow ou to save the colors that ou use the most. The foreground color is indicated b a thin, white border and the bac"ground color is indicated b a thic", white border. +hen ou change a foreground or bac"ground color, that change is reflected in the swatch ou have selected. To save that color for later use, switch our selection to a different swatch. Clic"ing a swatch will automaticall load that color. >ote that this feature is not et complete, as it will not save our palette when ou close the Picture Editor. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

The Coordinates Dialog


This dialog shows information on the current percent of magnification and the x, coordinates of the tool tip. There is also an automatic calculation that shows the total number of pixels moved from the origin of our stro"e. ,or instance, if ou want to measure out a line that is exactl ten pixels long, clic" and drag to start our line. +hen the dialog shows a result of AB,CD, release the mouse (the calculation is 8ero'based, so 8ero counts as -).

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Pixel Shaders
Pixel shaders are advanced visual effects that require special hardware to run. There have been several updates to pixel shaders since their introduction in 2000, and the specific version your computer supports depends on the hardware. To check your version, create a new DirectX !ame. "nder application properties, find the Pixel shaders headin!. #hader version !ives your computer$s maximum supported pixel shader version.

Contents

% &ersions 2 'reatin! shaders 2.% #hader information 2.2 (arameters 2.) 'omment modifiers 2.).% *+,D-,. /+D 2.).2 ',+##. #0/(1234 2.5 &ariables

Versions
(ixel shader %.0 was introduced with DirectX 6.0 in late 2000, so they have been around for a while. -very version is backwards compatible with the previous, so if your computer supports (ixel #hader 7(#8 version 2, it also supports %.0, %.%, %.5 and so on. 1isted are the versions supported by 'onstruct and the first !raphics hardware that supported it. Pixel shader %.0, %.% %.5 2.0 Introduced 2000 200% 2002 Supported by 4e9orce ) #eries ,adeon 6:00, 4e9orce 9X series ,adeon :00, 4e9orce 9X series, 2ntel 4/0 00

There are newer pixel shader versions, but 'onstruct does not take advanta!e of these yet. 0ny decent modern !raphics card will support (# 2.0, but cheaper or older hardware may not support (# 2.0 or even pixel shaders at all. 2n this case, you can still use (# 0.0 effects in 'onstruct, since they do not require any pixel shader hardware.

Creating shaders
'onstruct$s effects are written in .fx files in the -ffects; subdirectory of the 'onstruct installation folder< each file is a different shader.

Shader information
'onstruct interprets the first four lines of an .9X file as= Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

%= #hader name 2= 0uthor )= (ixel shader version 5= Description These lines must be comment lines. The (ixel shader version line must be one of (# 0.0 7for render states only8, (# %.%, (# %.5 or (# 2.0 and correspond to the shader compiler used 7e!. (# 2.0 for compile ps>2>08. ?ere is an example of 0dditive (lus$ first four lines=
// // // // Additive Plus Ashley Gullen PS 2.0 Additive blend with intensity.

Parameters
'ustom parameters can be added to effects, which the user can modify in the effect properties These values are not bounds checked or limited. 0 parameter is defined via a comment in the format=
//#PARAM type variable-name initial-value : label : des ripti!n

type can be float, or percent. *oth are ordinary floats, except percent is displayed as a percenta!e value, with %.0f equatin! to %00@. variable-name is the name of a float variable declared in the ?1#1 script, for example, float myVariable< should this parameter be $my&ariable$. initial-value is the initial value of the parameter, for example, 0.:. label is the label of the item that appears in the property !rid. description is the text that appears in the description pane of the property !rid when the item is selected. ?ere is an example excerpt from 0dditive (lus.fx that describes its 2ntensity parameter=
//#PARAM per ent intensity " : #ntensity : #ntensity !$ the e$$e t. $l!at intensity%

Comment modifiers
*y default, for maximum efficiency, 'onstruct clips the effect to the obAect$s boundin! box, and assumes the effect can be drawn directly to the screen. #ome effects need this behaviour modified. The existence of these comments anywhere in the .9X file have the followin! effect=
BORDER-MODE

#pecifyin! //#BORD R!"OD means effect is not clipped strictly to the boundin! box< a proportional mar!in is added around the area the effect runs in, which is always at least )2 extra pixels. -ffects such as warp require this, since the amplitude of the wave is otherwise clipped to the boundin! box.
CROSS-SAMPLING

#pecifyin! //##ROSS!S$"P%I&' means the effect is not drawn directly to the layout. -ffects such as /a!nify sample from the back!round with modified Tex.xy co.ordinates. This means if the effect is drawn directly, parts of the effect are sampled before they have been rendered, and parts afterwards, resultin! in corrupt !raphics. "sin! this modifier causes the effect to render to an intermediate texture, resultin! in a Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

properly calculated effect.

Variables
The followin! variables can be used in .fx files. Bhen present, 'onstruct will update them with their relevant values. Declaration texture 9ore!roundTexture< Description The texture of the obAect or layer !iven the effect, with all precedin! effects already processed< the fore!round.

The texture of the back!round to the obAect or layer !iven the effect. 3ote with an texture *ack!roundTexture< obAect on a layer with an effect on, BackgroundTexture is a texture with only the layer rendered so far. texture #ourceTexture< texture (reviousTexture< float frame'ounter< float box1eft< float boxTop< float box,i!ht< float box*ottom< float boxBidth< float box?ei!ht< float hotspotX< float hotspotC< float pixelBidth< float pixel?ei!ht< The texture of the obAect or layer !iven the effect, without any precedin! effects havin! bein! processed. The ori!inal texture. The texture of the previous effect in the effect chain. 2ncrements every frame. The left of the boundin! box of the obAect in the window, in texture co.ordinates. The top of the boundin! box of the obAect in the window, in texture co.ordinates. The ri!ht of the boundin! box of the obAect in the window, in texture co. ordinates. The bottom of the boundin! box of the obAect in the window, in texture co. ordinates. The width of the boundin! box of the obAect in the window, in texture co. ordinates. The hei!ht of the boundin! box of the obAect in the window, in texture co. ordinates. The X co.ordinate of the hotspot of the obAect with the effect, in texture co. ordinates. The C co.ordinate of the hotspot of the obAect with the effect, in texture co. ordinates. The width of a pixel, in texture co.ordinates. The hei!ht of a pixel, in texture co.ordinates.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

PLUGIN]Orbiter Behavior
Orbiter Behavior: License: Freeware Version: 1.0 Creator: Chris Hackmann(AKA, linkman200 ! What does this plugin do? " #his is a behavior which can be a$$e$ to ob%ect to make them orbit another ob%ect. #his &s&all' takes a small bit o( com)le* math, b&t the Orbiter behavior takes all the math o&t an$ )rovi$es s)ee$ im)rovements over $oin+ it with events. What features does it have? " ,o& can chan+e man' orbit o)tions, incl&$in+ s)ee$, ma*im&m $istance, ma*im&m , $istance, the an+le o( the orbit, an$ the ste) o( the orbit. ,o& can also retrieve all o( these val&es at r&ntime, incl&$in+ the c&rrent $istance between the orbiter an$ the orbite$. .ee below (or a com)lete list o( )arameters, actions, an$ e*)ressions.

Parameters:
- Speed: .et the startin+ s)ee$ o( the orbit in )i*els")er"secon$. - X-Distance: .et the startin+, ma*im&m - $istance o( the orbit. - Y-Distance: .et the startin+, ma*im&m , $istance o( the orbit. - Angle: .et the startin+ an+le o( the orbit. - Start step: .et the startin+ ste) in the orbit (rom 0"/00. 1( the startin+ ste) is set to 20, the ob%ect will start o&t one 3&arter o( the wa' thro&+h it4s initial orbit.

Actions:
- Set Object to Orbit: .et the ob%ect that the orbiter will orbit. #his onl' has to be set once. - Set Orbit Distance: .et the ma*im&m - an$ , orbit $istances at the same time &sin+ O56 val&e, settin+ both settin+s to the same amo&nt. Expressions: - Get Orbit Distance: 7et the c&rrent $istance (rom the orbiter to the orbite$. 1( the ma*im&m - an$ , orbit $istances are the same, this val&e will be constant. Shared Actions/Expressions: - Set/Get Orbit Speed: .et8+et the c&rrent s)ee$ o( the orbit. - Set/Get Max X-Distance: .et8+et the ma*im&m - $istance o( the orbit. - Set/Get Max y-Distance: .et8+et the ma*im&m , $istance o( the orbit. - Set/Get Orbit Angle: .et8+et the an+le o( the orbit. - Set/Get Orbit Step: .et8+et the c&rrent ste) o( the orbit. nstallation: #o install the )l&+in, sim)l' e*tract the the contents o( the 91: (ile into the main Constr&ct (ol$er. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

How To: Create a plugin


From construct
Creating plugins via the SDK is a fairly simple task for those who know C++. This article attempts to outline the steps needed to create your first plugin.

Contents

1 Preparing The environment ! "eginning development # $dit%time Properties & 'untime ( )ctions* Conditions* $+pressions

Preparing
The first step to creating a plugin is knowing what you are going to ,e creating. -n this tutorial we will ,e creating a plugin which is capa,le of performing some simple maths on colours in such a way that we can easily calculate a colour ,etween two other colours. .or e+ample* if we have a ,unch of grass sprites/

0e would ,e a,le to use the plugin to make the colour of each individual instance of the grass ,e a random shade ,etween green and dark ,lue/

0e will ,egin ,y planning how to do this. .or simplicities sake at the moment* we are going to have 1 action 1 set colours* and 1 e+pression* colour. 0e will also have edit time properties that allow us to specify colour 1 and colour . 2kay* the planning is over. 3et4s ,egin ,y heading over to SDK download page and downloading the latest sdk. 5ou will need 6C++ (* 6S 77&* or 6S 778 or to compile it. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

9o to C:\Program Files\Scirra\ and e+tract the folders/

2pen up SDK and make a copy of the folder Template Win32 VC8 Static and name it Gradient Calculator. 0e are now ready to ,egin. ote: )void using the :.C SDK unless your plugin re;uires it* eg. if your plugin implements an :.C control. The 0in! SDK compiles to a much smaller filesi<e.

T!e en"ironment

.igure #* file view 2pen Template S#$%sln. -f you switch to the file view you will see a list of files =figure #* to the right>. The SDK is designed so everything is split into different files. 3et?s ,egin ,y compiling our plugin so we can see what it looks like so far. Simply click &uild'&atc! &uild* in the "uild menu.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

0e can now go into Construct and have a look at what our plugin looks like. 5ou should see the following properties/

5ou can have a look at the actions* conditions and e+pressions ,y switching to the event sheet editor.

(eginning de"elopment
@aming and changing the icon % you don?t necessarily have to do this at the start of your proAect* ,ut it?s a good idea to get this part over and done with. .irst go into your resource view and open up the String ta,le. .eel free to change any of the strings as you feel appropriate.

-f you open up the ,itmap section you will see two ,itmaps for your plugin. 2ne is the ! +! * the other is a 1(+1(. These can ,e # ,it images or lower. Try to make them representive of the o,Aect so they can ,e easily identified. .inally* go to the proAect properties and open up each of the configurations* and change the output file name =Configuration Properties B 3inker B 9eneral B 2utput .ile> to GradientCalc%cs)C this is the uni;ue filename which represents the plugin.

*dit+time Properties
"egin ,y opening up main%!. This file contains the declarations of the plugin for the edit%time and runtime/ $dit$+t and $+t2,Aect. 9o to the $dit$+t and add in the following two mem,er varia,les/ Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

0hile we?re here* find the line which declares ,#*-F./GS* and make sure it contains OF_NODRAW* for e+ample/ #define IDE_FLAGS OF_NODRAW. This will prevent it drawing in the layout editor* as it does not need to. -nclude these two varia,les in the 0nPut function. 0nPut is called when you create a ,rand new o,Aect from the insert o,Aect dialog. -t is appropriate to use this function to set the values to their default/

@ow look for the Seriali<e function. This is located in Seriali1e%cpp* and is used ,y the edit%time when the o,Aect has to ,e saved =eg. 0hen you are saving your application* or for creating undos when you change properties>. 0e?ll add the two new varia,les we added to ,e seriali<ed/

@ow finally* we want the properties ,ar to display our varia,les and allow us to modify them. This is done in the property ta,le located in *dittime%cpp/

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

2untime
)fter fleshing%out the edit%time* we also need to flesh out the runtime. .irst* go ,ack to main%!* and this time go to the $+t2,Aect class and add/

Dust like the edittime* we also need to add these two varia,le to the seriali<e function* otherwise if the runtime saves itself =eg. People save their progress in their game> it won?t reflect the same values.

)nd finally* we have to add to 0nCreate. This function is called when the plugin is created at runtime* and the edit%time version of the e+tension gets seriali<ed so you must transfer the information to the runtime/

) few notes a,out this/ you must seriali<e an empty version integer ,efore anything else* as it is saved at edit% time. )lso* you must call ar.detach() when done seriali<ing.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

/ctions3 Conditions3 *)pressions


2pen up /C* Ta&le%cpp to see your ta,le of actions* conditions* and e+pressions. )s you can see* the template contains a couple of e+amples* which we will ,e replacing/

5ou must use )DDP)'): ,efore adding an action* condition* or e+pression for it to work. :ore information can ,e found a,out adding )C$S in the )C$ ta,le documentation. This action and e+pression must ,e added to main%!/

@ow open Conditions%cpp and empty it so the old function isn?t there anymore =as we aren?t using conditions>/

0e?re now going to add our action. 2pen up /ctions%cpp and update it to look like this/

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

@ow to write the guts of the code. To make the code a little easier to read* - added another function called lerp* which lets you feed one num,er* and a second num,er* and a ratio float* and it will calculate an integer to give ,ack. 0e apply this to all ! channels of the colour* and end up with code that looks like the ,elow/

)ssuming we wrote this without any typos* it is safe to compile this and test it out on our grass e+ample/

The results are impressiveE

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Plugins
A plugin brings functionality to Construct. Plugins range from the Sprite object - the basis of most games - to controls like Button and invisible plugins like XAudio . A list of documented plugins can be found at the object list. !ou can insert a plugin multiple times to have multiple object types" such as #SpriteA#" #SpriteB# and so on. $ach of these types can then have multiple instances. %his distinction is important &hen referring to them in the event sheet editor. 'amilies allo& you to group object types from the same plugin (such as SpriteA" SpriteB and SpriteC) and use events to treat them as a single object type.

Creating Plugins
Plugins are compliled *++ files using the Construct Plugin S*," renamed to the .cs- e-tension. %he S*, compiles under modern .icrosoft C// compilers. Steps to creating plugins0 1. . :. <. =. 5. ?. 7. 2nstall a compatible 2*$ and compiler3 4isual Studio 5 - 4isual Studio 667. 8n9ip the S*, template Create a property table" and edit time settings such as dra&ing and setting up of your object;behavior Create an AC$ table" and functions to match it 'ill out the runtime functions" such as >nCreate" >n*estroy" and debugger functions Change the resources to match your object name" description etc Create an object icon %est and debug your plugin

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Process Object
The process object allows you enumerate and get information on running processes. It would be useful if you want to set certain processes to high priority(less likely to be preempted) without using the task manager manually. You might also use this to determine if a certain process is still running and kill it if it is nonresponsive.

Contents

!roperties " #onditions $ %ctions & '(pressions &. 'numeration &." Information ) '(ample

Properties
*ee #ommon !roperties. !rocess does not have location+ si,e or angle properties+ as it is a non-layout object.

Conditions
-or each process Iterates through each running process !rocess e(ists True if parameter matches the name of a running process.

Actions
.ill process Takes an integer+ the process id (!I/) that you want to kill. *et process priority Takes one parameter the priority(idle0normal0high0realtime). 1ost windows processes run in normal priority. If you want ma(imum #!2 time then set the priority to realtime

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Expressions Enumeration
3et process I/ 4eturns an integer+ the !I/. 3et process name 4eturns a string+ name of the process. 3et process si,e 3et process thread count 4eturns an integer+ the number of threads in the process. 3et process usage

Information
3et all process names 4eturns a list of all process names. This could be stored in an array or hashtable. 3et current process 4eturns an integer+ the !I/ of your program5process. 3et process priority

Example
The following e(ample demonstrates how you might use the process object to enumerate+ store+ and display a list of running processes. %dd !rocess+ 'dit6o(+7ashTable+ and 1ouse.eyboard objects to the layout and then add the below in the event sheet editor. The mouse trigger was added to prevent the list from printing in an infinite loop.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Project Bar

Example project with layouts and event sheets The Project Bar allows you to manage your applications edited in Construct. Like all other bars it can be docked, undocked, pinned or hidden. Single clicking on an application or a layout from the Project Bar shows their properties in the properties bar. ouble click on a layout or e!ent sheet to open it. "ight click on an application or layout to show more options in a menu. See also #nterface o!er!iew.

Application options

$dd layout% $dds a new layout to the application Show plugins% Shows list of plugins used in the application, including information on the plugin licenses. Close project% Closes the application

Layout options

$dd layout% $dds a new layout to the application Clone layout% &akes clone of current layout. This is a new layout with duplicate instances of the same objects on the selected layout. elete layout% eletes selected layout.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Properties Bar
Example of layout properties

The Properties bar contains all the settings for whatever you have selected - an object, layout, layer, application, etc. Much of your application will be set up using the properties bar. The information panel at the bottom of the Properties bar shows a description of the currently selected item. This is helpful for setting up properties you are unfamiliar with. s with all other bars, you can pin, rearrange and tab the bar as you please. !ee also "nterface overview.

Properties
#ere is a list of some of the properties you will commonly be using in the properties bar.

pplication properties $ayout properties $ayer properties %ommon properties

!ee also the reference for individual objects and behaviors, since they define their own properties.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Ribbon Bar
The Ribbon bar contains the core functionality of Construct, and commands such as previewing, exporting, as well as editor commands. See also Interface overview.

Contents

1 Home tab !ro"ect tab # $ayout tab % &b"ects tab ' (vents tab

Home tab

The home tab contains general functionality, such as clipboard operations, and hiding and showing of bars. There are also )uic* lin*s to various online resources.

Project tab

The pro"ect tab represents the current application. There are commands to preview, debug, and to export. There are also shortcuts to manage global variables, event sheets and transitions.

Layout tab

The layout tab appears when a layout is opened+ it contains operations for the layout editor, such as enabling a grid, grouping ob"ects, and selecting ob"ects. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Objects tab

The ob"ects tab shows options to order the current selection, as well as add behaviors and effects if applicable.

Events tab

The events tab shows automatically when switching to the event sheet editor+ it contains operations such as inserting events, conditions, sub,events, comments, and groups. There is also the option to change the view style of events

Chronological shows an icon for each action $ist view shows a line with the full description text per action

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Runtimes
The runtime your application uses is defined by the Runtime property in application properties. Depending on the runtime you use, certain features will be available or unavailable, and the requirements to run your game change.
The runtimes provided in the current Construct release are as follows.

DirectX 9 runtime
The DirectX 9 runtime, currently the primary choice for games developed in Construct, has all features available. Window controls such as button ob!ects" do not have transparent bac#grounds, and will not scroll or $oom with the display. The DirectX 9 runtime is hardware%accelerated and can run effects on hardware that support them. &nd%users running a DirectX 9 game will have to have DirectX 9 or newer installed. 'f they have DirectX 9 installed it must be updated to the (ugust )**+ version or newer. 'f these requirements are not met, the following message is displayed,
You need the August 2008 DirectX update in order to run this application. Click 'OK' to open the DirectX download page, where ou can install the August 2008 DirectX !nd"#ser $unti%e. &ress 'Cancel' to e'it the application.

'f the user clic#s OK, a browser opens to this -icrosoft download page where they can obtain the latest version of DirectX, which after they.ve installed, they can then run the game.

Application runtime
The (pplication runtime does not have the DirectX display engine, hence you cannot show any DirectX graphics sprites, tiled bac#grounds, etc", but it also means there is no requirement to have any version of DirectX installed at all for it to run. The main purpose of this runtime is for application development using windows controls buttons, combobo/es, dialogs, and such". This runtime also has a smaller filesi$e and is quic#er to load. Application properties 0ramerate mode % Runtime

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Scirra Construct - Free DirectX Games and Application builder


Scirra Construct is a game development project licensed under the GNU GPL that allows you to create
DirectX 9-based games and applications in a !"# !G environment$ #t includes an event based system %or de%ining how the game or application will behave& in a visual& human-readable way$

Scirra Construct is power%ul and easy to use program$ #t allows users %rom any bac'ground create their
own games (uic'ly and easily without any prior programming 'nowledge$

Scirra Construct features:


"uper %ast hardware-accelerated DirectX 9 graphics engine$ )dd multiple pi*el shaders %or advanced special e%%ects& including lighting& +D,& distortion& lenses and more$ Physics engine %or realistic object behavior$ Place object on di%%erent layers %or organi-ing display& paralla*ing& or whole-layer e%%ects$ Debugger giving you complete control over all aspects o% your game %or testing purposes$ "maller& %aster speciali-ed runtime %or applications$ ./0 plugins ranging %rom 1iled 2ac'ground to database access$

"cirra 3onstruct is a %ree& open source development so%tware$$ "cirra has also released the %irst plugin "D4 %or developers to write their own plugins in 300$

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Script Editor

The Script editor The Script editor allows the editing of python scripts, using a form of intellisense and a function list. All elements of objects can be edited; the tutorial box at the bottom shows example scripts.

Function list
The function list to the right is context sensitive; when typing Sprite., a list of all ACEs and attributes of the sprite will appear. This narrows down as more eys are typed.

Snippets bank
!nippets are commonly used bloc s of "ython code, which can be saved and inserted #uic ly. They are accessed from the toolbar, and stored in a $!nippets$ directory under Construct%s installation.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

System Actions

Inserting a system action The following system actions are found in the System object.

Contents

1 Application 2 Create 3 isplay ! "#ent groups $ %lobal #ariables & 'ayers ( 'oops ) Script * System 1+ Time

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Application
,e-t 'ayout %oes to ne-t layout. If current layout is last. the application e-its. /re#ious 'ayout %oes to pre#ious layout. If current layout is first. the application e-its. %o to layout %oes to Layout using Transition with Duration. If the go to layout is the current layout it is restarted. Layout0 'ayout to go to Transition0 Transition to use Duration0 uration 1in milliseconds2 to use if a transition is selected Close Closes application. Cancel close Cancels an attempted close. "nd modal layout If the current layout is modal. it ends it. Set fi-ed 3/S rate If 3/S mode is set as 3i-ed. sets the ma-imum 3/S rate. ,ote if the game is performing badly. 3/S rate can still drop below this number. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Set FPS0 number to set ma-imum 3/S to Sa#e4load to dis5 Sa#e or load the current application state to4from dis5. Operation0 Sa#e4'oad File0 String that contains the file to Sa#e4'oad 6uic5sa#e46uic5load Sa#es4loads the current application state in memory. Save/Load0 6uic5sa#e46uic5load

Create
If you pass a family to a Create Object action. it will create a random object from the types in that family. Create object Creates selected object on a gi#en layer. at a gi#en point. Object0 7bject to create Layer0 'ayer to create object on X co-ordinate0 8 #alue of point to create object at Y co-ordinate0 9 #alue of point to create object at Create object by name Creates an object of a gi#en name. on a gi#en layer. at a gi#en point. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Na e0 ,ame of object to create Layer0 layer to create object on X co-ordinate0 8 #alue of point to create object at Y co-ordinate0 9 #alue of point to create object at Create object relati#e to object Creates selected object on a gi#en layer. with a gi#en offset from another object. Object0 7bject to create Layer0 'ayer to create object on X o!!set0 number to add to 8 position of another object Y o!!set0 number to add to 9 position of another object Object to position to0 7bject that the new object is offset from Create object at image point Create an object at an image point of another object.

Display
Scroll to 8 Scroll the current #iew to the designated 8 coordinate. X0 8 to scroll to Scroll to 9 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Scroll the current #iew to the designated 9 coordinate. Y0 9 to scroll to Scroll to object Scrolls to the location of an object. Object0 7bject to scroll to Set display angle Sets the current display angle. "n#le0 Angle to set display to Set global filter Sets the current global filter. Filter0 3ilter to set to. Set :oom Set the current :oom. 1++ is normal. 2++ is 2++;. etc. $oo 0 <oom ; Set layout si:e Set the current layout si:e. %idt&0 ,ew width of the layout 'ei#&t0 ,ew height of the layout Set display resolution Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Set the current display resolution. %idt&0 ,ew width of display 'ei#&t0 ,ew height of display Set motion blur "nables or disables the #arious motion blur settings. O!!0 isable motion blur ()-(*)0 "nable motion blur. See =otion >lur. Set fullscreen Toggles fullscreen mode on or off.

Event groups
Set group enabled "nable or disable a group of e#ents. +nable0 The new status of the group ,roup na e0 ,ame of the group to edit

Global variables
Set #alue Sets the #alue of a global #ariable -ariable0 ?ariable to set #alue of Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

-alue0 ?alue to set #ariable to Add to #alue Adds a #alue to a global #ariable -ariable0 ?ariable to add #alue to -alue0 ?alue to add to #ariable Subtract from #alue Subtracts a #alue from a global #ariable -ariable0 ?ariable to subtract #alue from -alue0 ?alue to subtract from #ariable

Layers
Set scroll 8 ratio Sets the 8 scroll rate of a layer. for paralla-ing layers. 1++ is normal. 2++ is 2++;. etc. Layer0 'ayer to set scroll 8 ratio of Scroll X .atio0 ,ew scroll 8 ratio for 'ayer Set scroll 9 ratio Sets the 9 scroll rate of a layer. for paralla-ing layers. 1++ is normal. 2++ is 2++;. etc. Layer0 layer to set scroll 9 ratio of Scroll Y .atio0 ,ew scroll 9 ratio for 'ayer Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Set :oom Sets to <oom 8 and 9 ratios of a layer. 1++ is normal. 2++ is 2++;. etc. Layer0 layer to set :oom 8 and 9 ratios of X $oo .atio0 ,ew 8 :oom ratio Y $oo .atio0 ,ew 9 :oom ratio Set :oom offset ,ot yet supported. Layer X .atio Y .atio Set #isible Toggles the #isibility of a layer Layer0 'ayer to set #isibility of -isibility0 Toggle the #isibility of the layer Set opacity Sets the opacity 1semitransparency2 of a layer Layer0 'ayer to set opacity of Opacity0 ,ew opacity of 'ayer from + 1in#isible2 to 1++ 1opa@ue2 Set colour filter Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Sets the color filter of a layer Layer0 'ayer to set color filter of Filter0 ,ew color filter of 'ayer

Loops
Start loop Starts a loop and triggers the corresponding A7n 'oopA system condition the gi#en number of times. Na e0 ,ame of loop to start Count0 ,umber of times to loop Stop loop Stops a loop before it has finished. Na e0 ,ame of loop to stop >rea5 >rea5s the current while or for loop

Script
Bun script "-ecutes a /ython script Pyt&on Script0 Command to e-ecute

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

System
3lush clipboard 3lushes the clipboard. Set clipboard te-t Sets the current clipboard te-t. Te)t0 ,ew te-t to set Crite to I,I file "dits an entry of an I,I file /N/0 3ile path of I,I file to edit ,roup0 %roup of entry to edit /te 0 "ntry to edit Te)t0 Te-t to set entry to /lay sound /lays a sound 1for games. use the irectSound 7bject instead2 File0 3ile path of sound to play Fla#s0 3lags to play =essage boisplays a message bo- that interrupts the application 0essa#e0 Te-t to display in the message boPlease purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Title0 Title of message bo1uttons0 >uttons to display on message bo- 19es4,o or 9es4,o4Cancel2 /con0 Icon to display in the message bo- 1A"rrorA displays an A8A. ACarningA displays a ADA2

Time
Set time scale Set the time scaling factor of the runtime. used for slow motion 1and fast motion2 effects. +.$ corresponds to halfEspeed slowEmotion. See Time Scaling.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

System Expressions
The System object provides many built in expressions for common tasks. They are all listed here. System expressions are used without an object name, eg. max(a, b, c). "System" is not a valid object name in Construct.

Contents

Colours ! "isplay # $ayers % $oops & 'ouse ( 'ath (. Standard mathematical functions (.! )ther mathematical expressions * +ython , Text - System . Time

Colours
/012/, 0, 13 /eturns a single value describing a colour with the given red, green and blue. 0et/ed2/013 /eturns amount of red 2between . and !&&3 in color described by RGB 0et0reen2/013 /eturns amount of green 2between . and !&&3 in color described by RGB 0et1lue2/013 /eturns amount of blue 2between . and !&&3 in color described by RGB

Display
"isplay4ngle /eturns angle of displayed layout "isplay"evice /eturns text describing the video hardware on the system, eg. "567"74 0e8orce ,,.. 0T" Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

"isplay9idth /eturns width of the display, also the screen resolution for 8ullscreen mode "isplay:eight /eturns height of the display, also the screen resolution for 8ullscreen mode "istance2x , y , x!, y!3 "istance2;x , y <, ;x!, y!<3 /eturns the distance between points 2x , y 3 and 2x!, y!3, using the pythagoras theorem s=rt2dx>dx, dy>dy3 Scroll? /eturns the current ? co@ordinate in the centre of the visible screen. ScrollA /eturns the current A co@ordinate in the centre of the visible screen. Scroll?$eft /eturns horiBontal position of visible left edge of layout Scroll?/ight /eturns horiBontal position of visible right edge of layout ScrollATop /eturns vertical position of visible top edge of layout ScrollA1ottom /eturns vertical position of visible bottom edge of layout 6/am /eturns the estimated total video texture memory remaining, in bytes. This is global to the system, so the returned value will be lower if another 6/4'@consuming application, such as the Construct 7"C itself, is open. 4lternatively, you can pass a parameter to find the followingD

6/4'2"usage"3D the approximate total 6/4' used by the current application. This is the total textures E targets. 6/4'2"textures"3D the approximate 6/4' used by SpriteFobject textures 6/4'2"targets"3D the approximate 6/4' used by Grender targetsG, like the screen, backbuffer, canvases, and engine textures for processing effects.

Hoom? /eturns the current global horiBontal Boom. 4 value of .. corresponds to a Boom factor of ..I HoomA Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

/eturns the current global vertical Boom. 4 value of .. corresponds to a Boom factor of ..I

Layers
$ayerCount /eturns number of used layers $ayer5ame2number3 /eturns name of the given layer number $ayer)pacity2number3 $ayer)pacity2layerJname3 /eturns opacity of given layer 2returns values from . to ..3 $ayerScroll/ate?2number3 $ayerScroll/ate?2layerJname3 /eturns factor of scrolling given layer in horiBontal direction 2returns value .. for ..I factor3 $ayerScroll/ateA2number3 $ayerScroll/ateA2layerJname3 /eturns factor of scrolling given layer in vertical direction 2returns value .. for ..I factor3 $ayerHoom?2number3 $ayerHoom?2layerJname3 /eturns factor of Booming given layer in horiBontal direction 2returns value .. for ..I factor3 $ayerHoomA2number3 $ayerHoomA2layerJname3 /eturns factor of Booming given layer in vertical direction 2returns value .. for ..I factor3

Loops
$oop7ndex /etrieve the current 2top@level3 loop index. 4lso retrieves 8or Cach loop index. $oop7ndex2loopJname3 /etrieve the loop index of a specific loop $oop$ength Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

/etrieve the current 2top@level3 loop length @ the number of iterations being run. $oop$ength2loopJname3 /etrieve the loop length of a specific loop

Mouse
'ouse? The ? co@ordinate of the mouse cursor in the layout. +assing a layer name or number as a parameter retrieves the mouse ? co@ordinate adjusted for that layerGs Boom, scaling etc, eg. MouseX("Layer 1") 'ouseA The A co@ordinate of the mouse cursor in the layout. +assing a layer name or number as a parameter retrieves the mouse ? co@ordinate adjusted for that layerGs Boom, scaling etc, eg. MouseY("Layer 1")

Math Standard mathematical functions


The following standard mathematical functions can be used in expressionsD

sin 2sine of an angle in degrees3 cos 2cosine of an angle in degrees3 tan 2tangent of an angle in degrees3 asin 2inverse sine, returns degrees3 acos 2inverse cosine, returns degrees3 atan 2inverse tangent, returns degrees3 s=rt 2s=uare root3 abs 2absolute value3 exp 2exponent, eKx3 ln 2logarithm to base e3 log . 2logarithm to base .3

The K operator can also be used to raise to the power. See expressions.

Other mathematical expressions


4ngle2x , y , x!, y!3 4ngle2;x , y <, ;x!, y!<3 /eturns the angle, in degrees, between the points 2x , y 3 and 2x!, y!3, using atan!2y! @ y , x! @ x 3. 4ngle"iff2a, b3 "ifference between two angles. 4lways works by the smallest angle between the two, and works around the full circle. Ceil2number3 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

/ound a number up 2eg. ceil2(. 3 returns *3. Clamp26alue, $ower bound, Lpper bound3 /eturns Value if it is between Lower bound and Upper bound. /eturns Lower bound if Value is less than Lower bound. /eturns Upper bound if Value is greater than Upper bound Cosp2a, b, x3 Cosine interpolation from a to b, x as percentage 2... @ ..3. Cubic2a, b, c, d, x3 Cubic interpolation, x as percentage 2... @ ..3. C=uivalent to lerp2=arp2a, b, c, x3, =arp2b, c, d, x3, x3 8loor2number3 /ound a number down 2eg. floor2(.*3 returns (3. 8ormat"ecimal2number, 53 /eturns a string with number given to $erp2a, b, x3 $inear interpolationD Calculates a E x2b @ a3, or linearly interpolates a to b by xI. Cg. lerp(a, b, )&(%) gives the value !&I of the way from a to b $inearaim21ullet ?, 1ullet A, 1ullet Speed, Target ?, Target A, Target Speed, Target 4ngle3 /eturns the angle an object should aim at in order to fire a bullet that will intersect with the targetGs movement. This is sometimes referred to as predictive aiming, and is better than firing bullets directly at their targets. Marp2a, b, c, x3 Muadratic interpolation. /eturns lerp2lerp2a, b, x3, lerp2b, c, x3, x3 max2a, b N,c,...O3 /etrieve the maximum of the given values. Aou can pass any number of values min2a, b N,c,...O3 /etrieve the minimum of the given values. Aou can pass any number of values /andom253 /eturns a random number between . and , not including 2eg. Random(*) gives one of ., , !3. 7f floating@point number, a random floating point number is generated up to but not including , eg. Random(1&)) gives the range N., 3 /otate4ngle2start, end, step3 /otate angle GstartG towards GendG by GstepG degrees. Cxpression e=uivalent of the Sprite actions G/otate towards positionG etc. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. is a decimal places, eg. !orma"#ec$mal(%&'''', () gives &.*,

/ound2value3 /ounds +alue to its nearest whole number, eg. Round(,&-) gives ' Sign2x3 /eturns x F abs2x3 if x PQ ., else .. Hero+ad2number, 53 /eturns a string with number given to .ero/ad(%,, ,) gives "))))%," digits, with leading Beros where number has less than digits. Cg.

Python
+ython2string3 /eturns a python script variable or function

Text
8ind2source, string N, startO3 /eturns the index of the first occurence of s"r$n0 in source, optionally providing the $ndex as the search start index 0etToken2string, 5 N, delimiterO3 /eturns the th token in s"r$n0 using del$m$"er. The default delimiter is comma 2,3 if you do not specify your own. CxamplesD Ge"1o2en("a,b,c", () gives "b", Ge"1o2en("one3"wo3"4ree35our", (, "3") gives ""wo" $en2string3 /eturns the number of characters in the s"r$n0. $eft2string, 53 /eturns a string with the left $owerCase2string3 Converts s"r$n0 to lowercase. 'id2string, index, 53 /eturns the 5ew$ine 4 string containing a line break. Cg. "6ello" 7 ewL$ne 7 "8orld" 5umTokens2string N, delimiterO3 /eturns the number of tokens in s"r$n0 using del$m$"er. The default delimiter is comma 2,3 if you do not Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. characters after $ndex in s"r$n0. characters of string, eg. Le5"("6ello", (3 gives "6e"

specify your own. CxamplesD um1o2ens("a,b,c") gives #, um1o2ens("one3"wo3"4ree35our", "3") gives % /emove2source, string3 /emoves all occurences of s"r$n0 within source /eplace2source, find, replace3 /eplaces all occurences of 5$nd in source with replace /everse2string3 /eturns s"r$n0 reversed /ight2string, 53 /eturns a string with the right Trim2string3 Trims s"r$n0, removing all trailing and leading whitespace characters LpperCase2string3 Converts s"r$n0 to uppercase characters of s"r$n0, eg. R$04"("6ello", *) gives "llo"

System
4pp+ath /eturns the path to the current application. 7n exported applications, this is the folder that contains the .C?C file. 9hen previewing, this is the folder that contains the .C4+ file. 5ote newly@created applications return an empty string for this value when previewingR you must first save your application so a .C4+ file exists for 4pp+ath to give the path to. The trailing backslash is included, eg. 9:;Games;My 0ame; Count'atching2oid3 Count'atching2object name3 /eturns the number of instances of the object type specified by )7" 2number3 or object name 2string3 that met the eventGs conditions float2value3 Convert the given string or integer to a floating point number. global2G6alue nameG3 /etrieve a global value, as defined in application properties int2value3 Convert the given string or float to an integer. $ayout5ame Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

The name of the current layout. $ayout5umber The current layoutGs number. $ayout9idth /eturns the width, in pixels, of the current layout $ayout:eight /eturns the height, in pixels, of the current layout +SJ6ersion /eturns the +ixel Shader version supported on your computer. 7t returns values such as ., . , .%, !, # str2value3 Convert the given number to a string. 7n most cases this can be done automatically with the S operator. See expressions. Total)bjects The total number of object instances that exist Total)bjects2number3 Total)bjects2layerJname3 The number of object instances on the given layer

Time
TickCount /eturns number of frames 2ticks3 rendered by the application from its start. Time"elta /eturns amount of time, in seconds, between the current tick and the last tick. See Time"elta Timer /eturns the amount of time, in milliseconds, that the current layout has been running. This value is affected by the time scale. TimeScale /eturns the runtime time scaling factor, for slow@motion effects. See time scaling

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

System Object
The System Object is the only built-in object in Construct, which has no actual instances, specific properties or presence in the layout editor, and exists in every Construct application. It represents the Construct engine itself, providing access to the layout, layers, the display, Python, motion blur, global variables, timers and other useful general functionality, li e comparing numbers.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Text Manipulator Object


The Text Manipulator object allows you to work with and modify text and text files. You can use the object for common tasks like reading in text files and parsing strings. As an alternative, the system object has several text manipulation functions.

Contents

1 se !lobally " #roperties $ %onditions & Actions ' (xpressions ) (xample

Use Globally
*ark the Text *anipulator object as !lobal in its %ommon properties, and place an instance on the first layout. The object will now appear in all layouts, and will be the only instance you need in your entire application. +f you do not use a global Text *anipulator object, only use one per layout.

Properties
,ee %ommon #roperties. Text *anipulator does not have location, si-e or angle properties, as it is a non.layout object.

Conditions
/or each substring Takes one parameter, a string that acts as a delimiter. This condition iterates through all text assigned by a previous text manipulator action. 0n line read All actions under this condition will only be attempted once a previous line is read. ,tring is set All actions under this condition will only be attempted once a previous set string action is complete.

Actions
1owercase %onverts text to lowercase. ppercase %onverts text to uppercase. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

1oad file 1oads the entire file into memory. You should use the 2/or (ach substring2 condition in conjunction with this action. 3ead file line by line 0nly reads in each line at a time. se in conjunction with the 20n line read2 condition and the 2!et latest line2 expression. ,ave file ,aves the file to disk, by default in the same directory as the executable. 3eplace Takes two parameters, the original text and the new text. All occurrences of 2original2 are replaced by 2new2. 3everse string 3everses the current string. ,et string Trim left Trim right

Expressions
!et lowercase ,elects and converts chosen text to lowercase !et uppercase ,elects and converts chosen text to uppercase !et current substring 3eturns the current substring. sually used in conjunction with a /or (ach condition. !et latest line 3eads in the next line. !et reverse 3everses chosen text 3eplace Takes three parameters. The text to affect, the original string, and the new string that replaced all occurrences of the original. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

!et length 3eturns the length of the text manipulator string. !et string 3eturns the entire string. +f you used the load file action, this would return the entire file contents. !et count Takes one parameter, a delimiter. 3eturns the count of all substrings. !et substring Takes two paramters, a delimiter and an index. 3eturns the string located at the chosen index. 1eft Takes one parameter, an integer count. 3eturns that number of characters from the left. *iddle Takes two integer parameter, a substring position and count. 3eturns the characters from that position. 3ight Takes one parameter, an integer count. 3eturns that number of characters from the right. Trim left Trim right

Example
The following example shows reading in an entire text file into memory, parsing line by line using a delimeter, and storing the contents in an array. 4ote that the delimeter used is 24ew1ine2. Also, the expression 2!et%urrent,ubstring2 is properly used in conjuction with for each.

This could be used to read item lists into an array. /or example, if your text file had item stats such as5

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Text Object
The text object displays text in a layout. In the Direct-X runtime, it can have effects applied to it, making it a versatile object. It can also be used in the pplication runtime, !here it is displayed in a !indo!. It can be used to display "#$ style scrolling text using the Write Text action.

Properties (See also Common Properties)


Text The initial text the object displays. %lick View All to open a dialog to edit the text in a larger !indo! !ith the ability to add line breaks. &ou can also open this dialog by double clicking the object. 'ont The font name to use for the text. (i)e The font si)e. The si)e is a pixel si)e, not a point si)e like in !ord processors. *old Dra! the text as bold. Italics Dra! the text as italics. Invisible on start +ake the object invisible on startup. ,ori)ontal alignment (et ho! the text aligns inside its bounding box. -ertical alignment (et ho! the text aligns inside its bounding box. %olour %hoose the colour for the text. .pacity %hoose the opacity /semitransparency0 of the text, from 12 /transparent0 to 3112 /opa4ue0.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Tiled Background Object


Contents

1 Tiled Background Object 2 Properties 3 Common 4 Object Conditions 5 Object Expressions Object !ctions "1 #iles "2 Po$er%o&%t$o textures onl'

Tiled Background Object


T(e Tiled Background object allo$s images to be tiled )uickl' and easil'* $it( less o& a texture and si+e impact t(an using a single sprite" ,t can (a-e e&&ects applied to it just as ot(er game objects can* and be placed in la'ers &or parallaxing" ! ne$ texture can be loaded using actions* at runtime" ,t renders &astest $it( a s)uare po$er%o&%t$o si+ed texture* i"e" 1 x1 * 32x32* 4x 4* 12.x12. etc" /sing a texture o& t(is si+e also results in -er' smoot( scrolling* especiall' $(ile +oomed in" Ot(er si+ed textures ma' split slig(tl'" ,& a po$er%o&%t$o texture is used* t(e background texture can also be rotated* o&&set and scaled"

Properties
0ee also Common Properties" ,mage 1Edit2 Click to edit t(e Tiled Background texture"

Common
T(e Tiled Background object (as common actions* conditions and expressions 1!CEs2 &or position* dimension* -isibilit'* &ilter* opacit'* 3 order* and count 4 destro'"

Object Conditions
T(ere are no object speci&ic conditions &or t(e Tiled Background object"

Object Expressions
T(ere are no object speci&ic expressions &or t(e Tiled Background object"

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Object Actions Files


5oad texture &rom &ile 5oads t(e gi-en image &ile and uses it as t(e Tiled Background6s texture" 0ee 0upported ,mage #ormats"

Power-of-two textures only


T(ese actions onl' (a-e an' e&&ect i& t(e texture used is a po$er%o&%t$o texture" T(is means bot( t(e $idt( and (eig(t must be a po$er o& t$o* ie" 4x 4* 12.x12.* 25 x25 etc" 0et image angle 0ets t(e angle o& t(e texture* $it(in t(e bounds o& t(e Tiled Background" T(e texture rotates about t(e center" ,& t(e $idt( or (eig(t o& t(e Tiled Background c(anges t(e center point around $(ic( t(e angle is set $ill also c(ange" 0et image o&&set 7o-es t(e texture $it(in t(e bounds o& t(e Tiled Background along t(e 8 and9or : axis" /se&ul &or creating a scrolling%background e&&ect" 0et image scale 0ets t(e si+e o& t(e texture $it(in t(e bounds o& t(e Tiled Background" T(e de&ault scale is 1 11;;<2" 0etting t(e scale to 2 $ill make t(e texture t$ice as large* setting it to 2"5 $ill make it t$o and a (al& times larger* etc"

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Time Delta
TimeDelta is a system expression that returns the time, in seconds, since the last tick. For example, at 100 FPS (Frames Per Second), each tick takes 1/100 of a second or 0.01 seconds, so Time elta !ill "e 0.01. #n reality, the framerate !ill $ary some!hat, so the returned %Time elta% $alues !ill "e close to & "ut not exactly & this $alue. ' elta' refers to the change in a (uantity, so Time elta refers to the change in time. The $alue returned "y TimeDelta is affected "y the time scale.

Contents

1 Pro"lems usin) tick&"ased "eha$iors and mo$ements * Solutions + ,eha$iors - .pplyin) to acceleration and rotation / Testin) your Time eltas 0 .d$anced uses of Time elta 1 ra!"acks 1.1 2andom $ariation

Problems using tick-based behaviors and movements


.ll )ames should use V-Synced framerate mode in application properties, !hich synchronises the display renderin) !ith the monitor's refresh rate, to pre$ent tearin) and produce the "est (uality display. 3o!e$er, this presents )ame desi)ners !ith a pro"lem4 e$eryone's monitor runs at a different refresh rate, $aryin) !idely & some as lo! as 0035, and some as hi)h as 1*035. #f an o"6ect mo$es one pixel e$ery tick, it could end up mo$in) t!ice as (uickly on one computer than another, 6ust "ecause of the refresh rate7 8orse, players could end up reducin) the refresh rate of their monitor to slo! do!n the )ame, and make it easier. Finally, if the )ame is doin) a lot of hea$y renderin), the framerate may fall as a result & if your )ame is mo$in) half as fast !hen it falls to +0 FPS, players may )et frustrated and (uit. Further, effects like 9otion ,lur (!hich "oosts the tick rate) and Time Scalin) (!hich alters the )ame timers) !ill only !ork properly if you make use of Time elta.

Solutions
:ne solution could "e to use Fixed framerate mode, !hich caps the maximum framerate at the same $alue for e$ery"ody & for example, 00 FPS. This is a poor choice, "ecause it !ill reduce the display (uality "y introducin) tearin), and it still doesn't sol$e the pro"lem completely4 if your )ame is fixed at 00 FPS and poor performance reduces it to +0 FPS, it still runs half as fast. #n a nutshell, don't use fixed framerate mode for games! . "etter solution is to make the o"6ect mo$e at a rate of pixels per second. #f it co$ers *00 pixels of )round in one second, that's the same speed re)ardless of your refresh rate. That means at /0 FPS it needs to mo$e pixels e$ery tick, and at 100 FPS it needs to mo$e * pixels e$ery tick. #f the o"6ect is set to mo$e Every tick to4 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Object.X + (200 * TimeDelta)

;ote that at 100 FPS, Time elta < 0.01 and *00 = 0.01 is *4 that's the * pixels per tick !e needed. .nd at /0 FPS, Time elta < 0.0* and *00 = 0.0* is -. #n )eneral, to mo$e an o"6ect at a rate of pixels per second, simply use4
Set X to .X + (r * TimeDelta)

and similarly use > for the > axis.

Behaviors
?onstruct's "eha$iors are all already pro)rammed to !ork in units of pixels per second. This means they're all )uaranteed to mo$e at the same rate on any computer, no matter the framerate. #t is only !hen you mo$e o"6ects $ia e$ents that you can )et in to tick&"ased pro"lems.

Applying to acceleration and rotation


The same pro"lems can occur !ith rotation and acceleration. @et's first look at rotation. #f an o"6ect rotates 1 de)ree clock!ise e$ery tick, it !ill spin t!ice as fast at 1*0 FPS than at 00 FPS & this is no )ood. Time elta can "e applied in the same !ay to make it rotate at a rate of de)rees per second & for example4
Rotate object clockwise by 360 * TimeDelta degrees

!ill result in the o"6ect completin) one full rotation e$ery second, at any framerate. >ou should also use the same formula for rotatin) to!ards an an)le, o"6ect or position. Sometimes you !ant to apply acceleration to an o"6ect $ia e$ents, such as an o"6ect fallin) !ith )ra$ity. #f its speed is already set up in pixels per second, acceleration !ill "e in pixels per second per second, or ho! much the speed chan)es "y, e$ery second. 8hen addin) or su"tractin) from the speed, you must also multiply the difference "y Time elta, 6ust like !ith ordinary speed. A B$ery Tick C .dd 500 * TimeDelta to '> Speed' (the acceleration) C Set > to . ! " Speed" * TimeDelta (the speed) ;ote that 500 is the acceleration in pixels per second per second & assumin) it is stopped at the start, after one second it !ill mo$e at /00 pps (pixels per second), after t!o seconds 1000 pps, after three seconds 1/00 pps, and so on. This is completely framerate independent so your o"6ects accelerate at the same rate no matter the framerate7

Testing your TimeDeltas


.n easy !ay to check if your )ame !ill run at a relia"le speed is to ena"le #nlimited framerate mode, and ena"le FPS in Caption. ependin) on your )ame and hard!are, you'll no! "e runnin) at any!here from a fe! hundred frames per second to a fe! thousand & a tick rate !hich could easily "e ten times hi)her than your refresh rate. #f your )ame is correctly coded, all o"6ects and motion !ill happen at exactly the same speed as VSynced mode & nothin) !ill "e )oin) faster than usual. This pro$es that no matter the refresh rate, motion "lur settin), or slo!do!n your )ame experiences & o"6ects !ill keep mo$in) at a steady pace, impro$in) playa"ility and fairness. >ou can also set your )ame to Fixed framerate mode and specify a $ery lo! FPS & e). 10 FPS & and test that e$erythin) is still playa"le, and not mo$in) slo!er than normal. 2emem"er to set it "ack after!ards, you Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

definitely !ant to pu"lish your )ame usin) D&Synced mode7

Advanced uses of TimeDelta


#f you !ant an o"6ect to mo$e smoothly to!ards a point, in a tick&"ased )ame, you may try hal$in) the distance to the tar)et e$ery tick. The Time elta&e(ui$alent $ersion of this is4
ler (c!rre"t#$% target#$% & ' 0.01 ( TimeDelta)

The "old num"er can "e chan)ed to ad6ust ho! (uickly the o"6ect approaches the tar)et.

Drawbacks
This system can cause pro"lems $ery lo! framerates. . )ame runnin) at / FPS means a fast&mo$in) o"6ect )oin) at /00 pixels per second !ill "e 6umpin) 100 pixels e$ery tick. This can cause pro"lems !ith collision detection4 if the o"6ect is small, it is possi"le it !ill %step% o$er an o"stacle !ithout re)isterin) a collision. ,ein) a!are of this can help you desi)n your )ame to a$oid this situation.

#ma)e demonstratin) ho! a fast mo$in) o"6ect may not re)ister a collision at lo! framerates. ?onstruct pro$ides a !ay to help miti)ate this pro"lem4 the minimum FPS, in .pplication Properties. #f you set the minimum FPS to e). */ FPS, TimeDelta !ill stop increasin) if the framerate falls "elo! */ FPS. This means the )ame slo!s do!n, and o"6ects don't start leapin) a lon) !ay e$ery tick. .lthou)h the slo!&motion effect in extreme circumstances can "e annoyin), it su"stantially impro$es the )ame's relia"ility at $ery lo! framerates, since o"6ects are much less likely to pass throu)h each other. Finally, another dra!"ack is if for some reason a sin)le tick takes extraordinarily much lon)er to render than all the other frames, motion could appear to 6ump. 3o!e$er, this case is fairly rare & )ame framerates do not $ary that "adly on a tick&"y&tick "asis.

Random variation
The timer that is measured to determine the $alue of Time elta is not perfectly accurate. #t often $aries a small amount tick&"y&tick. This can in turn cause mo$ements to ha$e a fe! pixels of inaccuracy, for example, 6umpin) a sli)htly different hei)ht, or a "all rollin) sli)htly further. .dditionally it can cause the Physics mo$ement to "eha$e in sli)htly different !ays. Esually, these errors are $ery small and nothin) to !orry a"out. 3o!e$er, some specific )ames (such as lo!&resolution pixel&dra!n retro )ames) re(uire mo$ements to "e exact to the pixel. #n this case, you can ena"le Override TimeDelta in .pplication Properties to force it to return a constant $alue. This is not recommendedF your )ame !ill suffer many of the pro"lems mentioned in this article, especially if it is D&synced. #f you are not sure if your )ame needs it, lea$e it off.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Time Scaling
Time scaling is a feature in Construct that allows you to change how quickly time is passing in the game universe relative to the real world. It allows for slow-motion effects, effective pausing, and even fast-motion effects.

Contents

1 Setting a time scale !ow timescaling works " #seful effects ".1 Slow-motion ". $ausing

Setting a time scale


#se the system action %Set timescale%. & value of 1.' corresponds to normal time. & value of '.( means time in the game passes at half the normal rate.

How timescaling works


Setting a time scale affects)

The values returned *y Time +elta.

&s a result, all *ehaviors in Construct, which rely on Time+elta, are also affected.

The frequency with which the system condition %,very - milliseconds% triggers. The rate at which the system e.pression timer increments. The pitch of sounds played *y the -&udio /*0ect, which speeds up and slows down play*ack according to the time scale.

Timescaling will affect the entire play*ack of your game, providing it uses Time +elta. &ny motion not coded with Time +elta 1eg. moving an o*0ect a distance every tick2 will not *e affected - this is why it is important to use Time +elta throughout your game if you plan on using time scaling.

Useful effects Slow-motion


Set the time scale to '.1 and your game proceeds at 1'3 the speed of normal, creating a very convincing and effective slow-motion effect. Since the framerate is not affected *y timescaling, motion still proceeds very smoothly and the result can *e very pleasing. &lternatively, you can set the time scale to a num*er greater than 1. & timescale of dou*le the normal speed. means your game proceeds at

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Pausing
Set the time scale to ' and the game will come to a halt, since game-time is fro4en. !owever, the framerate is not affected, and events continue to run. This can allow you to control a pause-menu or allow other commands to *e carried out while the game is paused.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

XAudio2 actions
This is a list of actions in the XAudio2 object.

Contents

1 Cache 2 Channel 3 Files 4 Master 5 Music 6 Positioned sounds 7 esources ! "ettin#s

Cache
Cache director$ %oad all &A'( X&M and X&MA )iles in the #i*en director$ in to +e+or$. ,se)ul on start o) la$out to -reload audio. Cache )ile %oad the #i*en audio )ile in to +e+or$. Free cache .elete all audio )ro+ the cache( )reein# u- the +e+or$. "et cache li+it &hen the Cache -ro-ert$ is set to Sounds under 3mb( this chan#es the li+it( in +e#ab$tes.

Channel
/0it loo1) a channel 2as -la$ed loo-in#( e0itin# the loo- causes the sound to )inish -la$in# once it has )inished the current re-itition. Pla$ "tart a channel -la$in#. "et )re3uenc$ ratio Adjust the rate at 2hich a channel is -la$in#. 2.4 +eans double the s-eed( 4.5 +eans hal). ,se)ul )or en#ine sounds. "et +uted Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

"et 2hether a channel is +uted 5silent6 or not. "et -an Chan#e the le)t7ri#ht balance o) a channel. "et -osition "et the current -la$bac8 -osition in the channel9s audio )ile( in seconds. "et reser*ed "et a channel9s reserved status. eser*ed channels 2ill not be o*er2ritten b$ an auto-la$ed sound. "et *olu+e "et the *olu+e( in decibels( o) the current channel. Positi*e *alues a+-li)$( ne#ati*e attenuate. "to:alt -la$bac8 o) a channel. "to- all channels :alt -la$bac8 o) all channels( sto--in# all audio. ,nreser*e all channels Mar8 all channels as not reser*ed( so auto-la$in# a sound can use an$ channel.

Files
Auto-la$ )ile %oad an audio )ile to an$ channel 2hich is not -la$in# and not reser*ed( and start it -la$in#. %oad )ile %oad an audio )ile to a s-eci)ic channel. 1t 2ill re+ain in a sto--ed state until the Play action is used.

Master
"et +uted "et 2hether the o*erall out-ut is +uted 5silent6 or not. "et *olu+e "et the *olu+e o) the o*erall out-ut.

Music
Pause +usic Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Pause the -la$bac8 o) +usic. Pla$ +usic )ro+ )ile %oad a +usic )ile )ro+ dis8( and start it -la$in#. "ee XAudio2 )or su--orted )or+ats. Pla$ +usic )ro+ resource %oad a +usic )ile )ro+ a resource( and start it -la$in#. esu+e +usic esu+e -aused +usic. "et +usic loo-in# /nable or disable the loo-in# o) the current +usic )ile. "et *olu+e "et the *olu+e o) the +usic -la$bac8. This is not a))ected b$ the +aster *olu+e. The units o) *olu+e are di))erent )or +usic( and ran#e )ro+ 47144( as o--osed to decibels )or sounds.

Positioned sounds
Attach channel to object Attach an alread$7-la$in# channel to an object. The channel9s *olu+e and -an 2ill u-date accordin# to 2here the object is relati*e to the listener. Auto-la$ )ile at object %oad and -la$ an audio )ile on an$ channel 2hich is not -la$in# and not reser*ed. The channel9s -an and *olu+e 2ill continuall$ u-date to re)lect the object9s -osition relati*e to the listener. Auto-la$ )ile at -osition %oad and -la$ an audio )ile on an$ channel 2hich is not -la$in# and not reser*ed. The channel9s -an and *olu+e 2ill de-end on the -osition relati*e to the listener. Auto-la$ resource at object %oad and -la$ a resource on an$ channel 2hich is not -la$in# and not reser*ed. The channel9s -an and *olu+e 2ill continuall$ u-date to re)lect the object9s -osition relati*e to the listener. Auto-la$ resource at -osition %oad and -la$ a resource on an$ channel 2hich is not -la$in# and not reser*ed. The channel9s -an and *olu+e 2ill de-end on the -osition relati*e to the listener. "et listener object "et an object 2hich re-resents the listener. All -ositioned sounds chan#e their -an and *olu+e accordin# to 2here the$ are relati*e to the listener. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

"et listener -osition "et the listener X and ; co7ordinate. All -ositioned sounds chan#e their -an and *olu+e accordin# to 2here the$ are relati*e to the listener.

Resources
Auto-la$ resource %oad a resource to an$ channel 2hich is not -la$in# and not reser*ed( and start it -la$in#. %oad resource %oad an audio )ile to a s-eci)ic channel. 1t 2ill re+ain in a sto--ed state until the Play action is used.

Settings
These actions si+-l$ +odi)$ the 9Positioned sound9 -ro-erties.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

XAudio2 conditions
This is a list of conditions in the XAudio2 object.

Channel
Any channel is playing? True if any of XAudio2's sound channels are playing anything. Channel is muted? True if the given channel has been muted. Channel is playing? True if the given channel is currently playing audio. Channel is reserved? True if the given channel has been marked as reserved by the Set reserved action.

Master
aster is muted? True if the master output has been muted by the Set master muted action.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

XAudio2 expressions
This is a list of expressions in the XAudio2 object.

Contents

1 Audio statistics 2 Autoplay 3 Channel 4 Master 5 Positioned sounds

Audio statistics
Get RM le!el Get the root"#ean"s$uare le!el o% the audio output. RM is a &ind o% a!era'e le!el o!er ti#e. Pass 1 as the para#eter %or the le%t channel and 2 %or the ri'ht channel. The !alue ran'es %ro# (.( to 1.(. Get acti!e channels Return the nu#ber o% channels that are acti!ely readin' their source data. Get audio CP) usa'e * Get the CP) usa'e ti#e spent on audio processin'. Get latency Get the latency o% the audio playbac&. Get #e#ory usa'e Get the a#ount o% #e#ory used by +Audio2 and the cache. Get pea& le!el Get the pea& le!el o% the audio output. This ran'es bet,een (.( and 1.(. 1.( is the clippin' le!el- so i% the pea& le!el e!er e.ceeds 1.(- the audio has clipped and beco#e distorted. /ou should a!oid this situation since it reduces the audio $uality si'ni%icantly. Pass 1 as the para#eter %or this e.pression to retrie!e the le%t channel pea& le!el- and 2 %or the ri'ht channel.

Autoplay
Get last channel autoplayed Get the last channel nu#ber that an autoplay action played on. )se%ul i% you ,ant to autoplay- then #odi%y the channel the sound ,as played on.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

Channel
Get len'th The len'th- in seconds- o% the sound loaded to the 'i!en channel nu#ber. Get position The current playbac& position- in seconds- o% the sound in the 'i!en channel nu#ber.

Master
Get #aster !olu#e Get the #aster channel 0o!erall output1 !olu#e- in decibels.

Positioned sounds
Get listener + Return the current listener + co"ordinate. Get listener / Return the current listener / co"ordinate. Get #a. pan Return the maximum pan settin'. Get #a. !olu#e Return the maximum volume settin'. Get #in distance Return the minimum distance settin'. Get #in !olu#e Return the minimum distance settin'. Get pan distance Return the pan distance settin'. Get rollo%% Return the rolloff factor settin'.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

XAudio2 Object
API, on which it is based.
There is a video tutorial by Thomas Mahler on using the XAudio2 object which you can view here. Also, for a full description of all actions, conditions and expressions in XAudio2, clic the lin s on the right. XAudio2 has two main ways of playing sounds! as music "actions under the music category#, or on one of several channels "actions under all other categories#. Music can only play one thing at a time, li e the game$s music trac . There are lots of channels, however, and these can be used to play lots of sound effects simultaneously. %ou can play sounds and music either from external files or binary resources.

Use globally
Mar the XAudio2 object as Global in its Common properties, and place an instance on the first layout. The object will now appear in all layouts, and will be the only instance you need in your entire application. This also allows you to seamlessly play music and sounds between layouts. &f you do not use a global XAudio2 object, only use one per layout. 'ne XAudio2 object can play () sounds at once by default, and using multiple objects initialises the sound engine multiple times, which is resource consuming.

Supported file formats


*ifferent file formats are supported by channels and music.

Supported channel file formats


o o o

+A, files with the following formats! -.M A*-.M x+MA '// files. 0ote '// files are fully decompressed before playing, meaning large '// files may consume a lot of memory. The above formats all have built1in support and don$t re2uire any codecs to be installed

Supported music file formats


XAudio2 can play the same formats as +indows Media -layer, because they use the same music engine. This includes, but is not limited to!

M-3 +MA

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

+A, /enerally you cannot play '// files as music, because it re2uires the +indows Media -layer codec for '//. 4owever, if you distribute and install the +indows Media -layer codec for a format with your game, you can still play it with the -lay Music action.

Caching
XAudio2 caches sounds in memory to improve performance. This does not apply to music. This prevents unecessarily accessing files off the dis again and again during the game 1 sounds can be played 2uic ly from memory once they are loaded. 5y default, sounds under 3mb are cached the first time they are played while sounds over 3mb are removed from memory after being played. %ou can change this with the Cache property in XAudio2. This can mean a slight delay while a sound is loaded for the first time during a game. %ou can counteract this by using the Cache file or Cache directory actions to pre1load sounds in to memory at the start of your game. The cache can use a lot of memory if your game or application plays a very large amount of audio. &n this case you can turn caching off, or use the Free cache action to uncache everything. 4owever, most games will probably not find this a problem, but it may be relevant if you allow the user to load and play their own files from dis .

Autoplaying
XAudio2 provides numbered channels on which to play sounds. Autoplaying a sound means playing it on any channel which is not currently playing something else. This is a convenient way to assign sounds to channels. &f you reserve a channel, this means autoplaying a sound will never pic that channel. This is useful if you want something li e an ambient loop playing which should not be interrupted by general game sound effects.

The 'Master' channel


The Master channel is a special channel through which all other sounds are played. &t represents the end result of what you hear. %ou can mute and change the volume of this channel, and it affects all sounds on all channels. The master channel does not affect music. %ou can get the current level of the output using the Get RMS level or Get peak level expressions. 6emember if the pea level exceeds 7.8 "a full1scale wave#, the sound has clipped, and become distorted. The limiter in properties dynamically adjusts the level of the master channel depending on how loud the output is. The sound will distort unpleasantly if the output level becomes too high, so it$s recommended to use a limiter to eep the level below distortion point.

Positioned sounds
XAudio2 allows for sounds to be played at a position in 2* space. This simply automatically sets the left1 right pan and volume of the sound depending on where it is relative to the listener. %ou can set the listener position or object, and play sounds at positions, via actions under the Positioned Sounds category. 9ee the reference for more information on these actions. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

XAudio2 properties
This is a list of properties in the XAudio2 object. XAudio2, like all objects, also has Common Properties.

Properties
Channels The number of channels for XAudio2 to use. Autoplaying a sound will have this many channels to choose from, so you can have up to this many sounds playin simultaneously. The default value of !" is recommended. #a$ fre%uency ratio The ma$imum ratio you can pass to a Set frequency action. &sin lower values uses less memory. The default value, ", means you cannot play a sound faster than four times its ori inal fre%uency. #aster volume The volume of the master channel 'the overall output of all channels(, in decibels. )* or )! is a small reduction, and helps reduce clippin distortion if a lot of sounds are playin at once. Cache +efault settin for cachin . ,ptions are

Off- nothin is ever cached. Playin a sound file will always access the hard disk. Sounds under 3mb- sounds under *mb, when decompressed, are cached. This prevents lar e files from bein cached and wastin memory. All but OGG- ,.. files are fully decompressed before playin or cachin , so if you are usin lar e ,.. files for music, this option will not cache ,.. files. All- all sounds are cached, no matter how bi they are.

Positioned sounds
#a$ volume The ma$imum volume of a sound played within the miniumum distance to the listener. #inimum volume The %uietest a positioned sound will play. #inimum distance /ithin this distance to the listener, sounds are played at the maximum volume. 0ounds only start to et %uieter with distance beyond this distance. 1olloff factor 2ow %uickly sounds et %uieter with distance. &se a hi her value to make sounds et %uieter more Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

%uickly. #a$ pan The most that a positioned sound will be panned, in decibels. 0ince 34d5 is the point at which sounds are perceived either fully left or fully ri ht, this is the default. Pan distance The hori6ontal distance between a sound and the listener for it to reach the maximum pan.

Limiter
7imiter enabled 8f too many sounds are playin simultaneously, the output can become unpleasantly distorted. The limiter, when enabled, effectively dynamically turns down the volume of the master channel keepin it undistorted. 8t is hi hly recommended you leave the limiter enabled. 1elease The time, in milliseconds, in which the limiter will chan e the volume. This value can be between 3 and 29. Threshold The threshold level at which the limiter will start attenuatin . This appears to be in arbitrary units from 3)3499 'the developer documentation for this feature does not specify the units(.

Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

You might also like