GameMaker converted game to HTML5, showing huge bugs

1.1k views Asked by At

I recently made a game with game maker and I've tried converting it to html5, but it's got some big errors... here is the game in html format: http://ivatrix.com/Game/index.html

First off, text is meant to appear in the top left like how you can see in this screenshot: http://gyazo.com/baa386fe06cfac9439c83b6e5192efd8 the text only appears after you create a combo.

Secondly, when you click on an orb it's meant to scale down to half it's size then scale up to 1.5x it's size, but instead it's shrinking until it's 1px large then infinitely increasing in size. Draw code is here:

if sl=1
 {
  if (s=0.6 or s=1) then d=d*(-1)
  s+=d
  if(frozen=1)
    {
    draw_sprite_ext(sprite_index,global.skin,x,y,s,s,0,c_blue,1)
    }
}

And then there's other small errors like some text won't display, particle effects don't seem to draw, the game always returns saying there is no match on the board. That's all I've found so far.

Does anyone have any idea what I can do to fix this?

Thanks.

1

There are 1 answers

1
Ivatrix On BEST ANSWER

Since no one has provided an answer and I've found one myself, I'll put it up here so others in the same boat can benefit as well. Practically, the source of all my problems with floating point numbers being irregular, for example instead of it being 1 it could be 1.000000003, which meant if you were to check if that variable was equal to one, it would return false. Further information here: http://help.yoyogames.com/entries/77891197-HTML5-Issues-And-Differences

So for an example in my case, I changed the line

if (s=0.6 or s=1) then d=d*(-1)

to

if (s<0.6 or s>1) then d=d*(-1)

And now the problem is fixed.