• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • 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 simple game breaks when adding simple particles

F

Fefson

Guest
I made a simple game, based on the space-shooter-tutorial. It works flawlessly up until the point that I add some simple star-particles to my bullets. It still works untill the n-th round, then something goes wrong with the collisiondetection. Is it a bug? Should I do it differently? I've tried different approaches but the result remains... The problem is only in the html5-version, not the windows-testversion
 
F

Fefson

Guest
Sorry, I needed sleep :oops:
I've uploaded the 'bad' version to http://fefson.be/spel/error/
Sometimes it goes wrong after the first shot, sometimes it takes up to 5 shots...
There's also a version that works fine without particles at http://fefson.be/spel/
The code for the collision event that checks the collision between bullet and 'enemy is:
Code:
a = (instance_nearest(x, y, obj_enemy));
if (a.textopenemy == global.uitkomst){
    if (global.aantalOeftespelen<=1){
        room_goto(rm_klaar);
        exit;}
    global.aantalOeftespelen=global.aantalOeftespelen-1;
    with (instance_nearest(x, y, obj_enemy))
   {   instance_destroy();
    }
    room_restart();
    exit;};
  
if (a.textopenemy != global.uitkomst){
    room_goto(rm_fout); exit;};

with (instance_nearest(x, y, obj_enemy))
   {   instance_destroy();
    }
Where 'textopenemy' is the number on the enemies and 'global.uitkomst' is the correct answer. If they match, the room restarts and the number of rounds to be played is decreased by 1. If they don't match, you're send to room 'rm_fout', which dispolays the correct answer.

When the bullet gets created, I also have an
instance_create_layer(x,y,"lay_particles",obj_bulletparticles);
Which only has a step-evetn with the code
Code:
x = obj_bullet.x;
y = obj_bullet.y;
effect_create_below(ef_star, x , y, choose(0, 1, 2), c_yellow);
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Okay, you need to file a bug report for this I think. If the only difference between the two versions is the the particle code and it works fine on Windows, then something is wrong. I played both versions and the "broken" version is definitely doing something screwy! You can do this from the Help menu in GMS2, selecting Report a Bug. Please link to this topic and include a link to the project itself (you can export the project as a YYZ file and then link that in the report).
 
F

Fefson

Guest
I just filed the report! Thanks for the walkthrough :)
I must admit, it saddens me a bit. I'm at my first little project, and allready ran into 2 bugs (animation speed of background not being respected in html5 is the other one). What will the future bring...
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Yeah, the HTML5 target has been less of a smooth carry over from 1.4. :(

If it's any consolation, the next few updates should fix most of those bugs as YYG have been working hard to resolve everything.
 
Top