• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

HTML5 [SOLVED]Game works fine on PC but keep freezing/glitching on HTML5

C

Codoral

Guest
Hi all
My game seems to not working very on HTML5 platform. For example, i have a grenade launcher object with movement code in step event and a firing system as following:
An alarm(0) with only a comment so it can countdown.
A global left mouse pressed event with the code

if alarm_get(0)=-1
alarm_set(0,8)
And i put this line of code in the step event of the object i mentioned above

if alarm_get(0)>6
instance_create(x,y,obj_bullet)

What i intend to do here is to create a short delay so my grenade launcher can't fire continuously, that would make it overpowered . The game works fine on PC but when i test it on HTML5 i get numerous of glitches such as:
  • Completely freeze whenever i hold and/or press left mouse, no bullet spawn at all.
  • Blank screen.
  • Animation glitching.
When i remove all code line that refers to the alarm and put this line of code in the global left pressed event:
instance_create(x,y,obj_bullet)

then it works flawlessly on both PC and HTML5
I've test on IE, Chrome(gives the worst result, consume a HUGE amount of memory, can't even move), Firefox, upload it on GameJolt but nothing seems to work.

Did i do something wrong or is my HTML5 module broken?
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
If I remember correctly, alarm_get\alarm_set are not implemented on HTML5. If you run the game in debug mode, you could put the cursor on address bar, press F12, and it would show you the errors and their origin (stacktrace) when something happens.

Why don't you structure that code like if (alarm[0] == -1) alarm[0] = 8 instead?
 
C

Codoral

Guest
If I remember correctly, alarm_get\alarm_set are not implemented on HTML5. If you run the game in debug mode, you could put the cursor on address bar, press F12, and it would show you the errors and their origin (stacktrace) when something happens.

Why don't you structure that code like if (alarm[0] == -1) alarm[0] = 8 instead?
OMG it worked! Thank you so much for this!
GM Manual really need to point out what is implemented in the HTML5 module and what is not, it just state that "some" function may not work. Really vague for a manual.
 
Top