Posts

Showing posts from October, 2014

Detecting the input device (C2/HTML5)

Image
While getting familiar with the Construct 2, I started to wonder would it be possible somehow detect what kind of a device is used as an input device for HTML5 game. In principle, HTML5 will run on almost all platforms, so it would be very useful to see whether the player is using mouse or touch screen as a input device.

I created a simple Breakout game clone to find out how the control method could be detected easily.
















Game is very simple one, and it has no extra features included. I also tried to add some comments to ease up understanding what has been done and why. I am not too sure if everything is done "correct" way, but anyways this example is working somehow with my own devices (Android tablet, Lumia phone, Linux and windows computers).

Game events 2-4 are the most interesting ones from this article point of view. Please see the .capx or the picture below to see how detection was done in this case.















controlMethod variale is used to store the information about the input d…

Construct 2: if-then-elseif-else statement

Image
Do you have an idea how to implement IF-THEN-ELSEIF-ELSE statement with Construct 2? At least I had to think for a while how to do it. It seems that this basic structure is not so straightforward to implement in C2.

I was creating a very simple game where boxes were moving from left to right. See example below:
The color of each box is chosen randomly, so it required the usage of random() function and if-then-else statement. There are probably several ways to do this, but I wanted to make this as simple as possible inside one single event and action box. 
Normally I would create a if-then-elseif-else structure like this to select color for the box (pseudo-code just for an example):
if randomNumber == 0       set colorOfBox = "red" else if randomNumber == 1       set colorOfBox = "yellow" else if randomNumber == 2       set colorOfBox = "green" else       set colorOfBox = "blue" end if
But when using Construct 2 things were bit more complicated for me: …

Testing and polishing

Image
I've been bit busy with my daily work for last couple of weeks, so gamedev activities have got less attention than normally. But still there has been some progress since my last update.

My original plan was to finish and release "Dualball" flash game in the end of September, but now it seems to take some more time. Game itself is in pretty good shape: the mechanics works, there are no detected major flaws currently, and 75% of planned levels are ready and tested quite well. 
We have done thorough testing ourselves and a number of serious bugs have been found and corrected during the process. Gameplay tests have been run on both computer and touch-screen tablet to get some extra coverage. It has been interesting to see that some bugs are not easily visible on both platforms: E.g. "ball ground check" routine worked fine on computer, but on tablet there were strange malfunction with it. So I strongly recommend you to test your games on multiple platforms in early …