background preloader

Construct

Facebook Twitter

Construct 2 Tutorial - Breakout Clone (Part 12: Finishing Touches - Final) Construct 2 Tutorial - Breakout clone (Part 5: the "Fire-Ball" effect and Paddle Images) Construct 2 Tutorial - Breakout Clone (Part 11: Win/Lose Conditions) Construct 2 Tutorial - Breakout Clone (Part 10: Adding Text) Construct 2 Tutorial - Breakout Clone (Part 4: the "Thru-Ball" effect) Construct 2 Tutorial - Breakout Clone (Part 3: Ball and Explosion Images) Construct 2 Tutorial - Breakout Clone (Part 1: Tile Map Setup) Construct 2 Tutorial - Breakout Clone (Part 6: the "Laser Paddle") Touch controls and a trick to detect input method.

These days it's naïve to assume everyone on the web has a mouse and keyboard.

Touch controls and a trick to detect input method

On the modern web, many people are now browsing via touchscreen devices like iPhone, iPad and Android phones. If your game can only be controlled by mouse and/or keyboard, users on these devices will be unable to play your game! However, it's easy to have on-screen touch controls - and there's a clever and simple trick to detect whether the user has a touchscreen device, too. Mouse input for touch First of all, if you're designing a game specifically for touchscreen devices, or your game only uses mouse clicks, use the Touch object.

That easily allows for both mouse and touch input, which for simple games is enough on its own. On-screen touch controls For many other games, on-screen buttons are necessary for controls. First, if you don't have one already, make a non-scrolling layer (you don't want the buttons to move off the screen as you scroll through the level!). Now, make sure that layer is selected. 1. 2. Construct 2 Tutorial - Breakout Clone (Part 8: Powerup Setup) Isometric Example. Control the character box with the arrow keys.

Isometric Example

The isometric effect is done using 8-way direction on the player object. In front of the house there is a "on player overlap" object that sets the house graphics on a layer behind the player. Behind the house graphics there is another "on player overlap" object, that sets the house graphics on a layer in front of the player. There is also a copy of the player object that is spawned every tick at the player position in order to see the player behind the house. There is also an object covering the collision of the house with the "solid" behaviour applied.

Copy and Paste Code Copy + paste this code onto your website so your visitors can play it! <! On WordPress? If you are a WordPress user you will first download the iFrame Plugin. [iframe 640 480] <! How to make iPhone and iPad games. How to export to CocoonJS. Note: when exporting for Android, we recommend using Crosswalk instead since it has better compatibility with Construct 2 games.

How to export to CocoonJS

For more information see How to export to Android with Crosswalk. CocoonJS is still a good way to publish for iOS. HTML5 game performance on mobiles is often a problem, especially with old devices. CocoonJS by Ludei is a service that wraps your game as a native mobile app (similar to how PhoneGap works), but also significantly boosts performance using hardware acceleration. This can result in a 5-10x performance increase, often resolving performance problems. Integrating with CocoonJS features To add CocoonJS specific features to your game, such as adverts or in-app purchases, add the CocoonJS object to your project. For more information about how to set up the Cloud Compiler for adverts, refer to the official Ludei documentation here: Exporting for CocoonJS In the Export Project dialog, choose Export for: CocoonJS.

Open the folder exported to. Compatibility. How to preview on a local network. Previewing on a LAN address in Construct 2 allows any device on your Local Area Network (LAN) to preview your project. For example, if you have both a PC and an iPad on Wifi, you can preview your game on the iPad without having to go through the whole export-project process. Alternatively other PCs and laptops on the network can share the preview, which can be handy if you're working together in a team. It's a great time saver! Here's how to set it up. However, you must have administrator access to your computer for it to work, and please note this feature is not available in the free edition. Step 1: enable Preview on LAN Open the Preferences dialog from the File menu. If you already know your computer's LAN address, you can enter it now. The dialog below should appear. Note localhost means the preview only runs on your computer - you can't preview on the LAN in this case, but you also don't need administrator permissions to preview.

Click OK. How to export to the Intel XDK. Note: for Android, we strongly recommend using Crosswalk instead of this tutorial.

How to export to the Intel XDK

For more information, see How to export to Android with Crosswalk. The Intel® XDK provides HTML5 publishing services. Like PhoneGap, this allows you to package up your game as a native iOS or Android app and publish it to the app stores. Intel also provide a technology called App Game Interfaces which boosts the performance of games using hardware acceleration. This can result in a 5-10x performance increase, often resolving performance problems.

Note: the Intel® XDK and App Game Interfaces were formerly known as appMobi and directCanvas respectively before Intel acquired them.