Game not working in browser

Get help using Construct 2

Post » Mon May 14, 2012 11:25 am

I am going nuts!

My game works perfectly when I do a publish test and in dropbox

Parking Panic

but i cannot get it to work within my site.

The arrow keys scroll the entire page, and ignore the game.
B
11
S
2
Posts: 127
Reputation: 1,532

Post » Mon May 14, 2012 12:27 pm

Can no one help with this?
B
11
S
2
Posts: 127
Reputation: 1,532

Post » Mon May 14, 2012 12:32 pm

[quote]Browser shortcut keys

In some browsers, some keys are shortcuts for browser actions. For example, space bar sometimes is a shortcut to scroll down the page. If any events exist for 'On key pressed' with a given key, Construct 2 blocks the browser from performing its normal action. For example, if you wish to prevent space bar scrolling down the page, add an empty 'On Space pressed' event, if you don't have one already.
[/quote]
From the manual entry about keyboard.

Same goes for the keyboard Up and Down keys.
Be sure to "intercept" those keys in your application (as explained in the entry).

The reason you haven't noticed it earlier is that the exported index.html page is just made of the canvas and no other elements.

Also strange thread title as it is quite far from the described issue.Kyatric2012-05-14 12:34:24
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Mon May 14, 2012 1:02 pm

Its difficult to summarize it in the subject line.

But thank you for your prompt reply.

I will give it a try.Pixiefingers2012-05-14 13:08:18
B
11
S
2
Posts: 127
Reputation: 1,532

Post » Fri May 18, 2012 10:41 am

When you say "On (key) pressed"

Do you mean as a Condition? A sub Event or just plain stand alone event?

Below the "(Key) is Down" or above?
Pixiefingers2012-05-18 10:44:56
B
11
S
2
Posts: 127
Reputation: 1,532

Post » Mon May 21, 2012 8:25 am

*bump*
B
11
S
2
Posts: 127
Reputation: 1,532

Post » Mon May 21, 2012 1:27 pm

You just need an empty "On key pressed" event on its own in your project to block the key.

e.g. just an empty "On spacebar pressed".

You also need to click inside the iframe before the game will accept keyboard input, which I mentioned in another thread.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Mon May 21, 2012 1:46 pm

did it all :-(
B
11
S
2
Posts: 127
Reputation: 1,532


Return to How do I....?

Who is online

Users browsing this forum: Justin1967, Yahoo [Bot] and 23 guests