701 reputation
624
bio website
location
age
visits member for 2 years, 5 months
seen 6 hours ago

4h
awarded  Popular Question
6h
comment How to use setInterval and clearInterval
You should look into requestAnimationFrame() instead, same basics but optimized for animation loops. Here's a good explanation: paulirish.com/2011/requestanimationframe-for-smart-animating
6h
comment 2D collisions between 2 arrays
I've updated my hitboxes like in this video: youtube.com/watch?v=8b_reDI7iPM but I still get the same results of the bullet just going straight through the enemy (not always). Even when slowing down the speed to 2px per frame (width is 36 and 56, it should detect a collision between all those frames). Any clue what I could be doing wrong?
10h
accepted 2D collisions between 2 arrays
10h
comment 2D collisions between 2 arrays
Nevermind, judging by AlphaSpirits answer it seems it's 2 problems causing this. And the bullet not hitting has nothing to do with the loop.
10h
comment 2D collisions between 2 arrays
Seems logical now that you say it.
10h
comment 2D collisions between 2 arrays
Yeah I was thinking that too, but one of the enemies can't be killed first even though nothing has been spliced. If the other 2 enemies are dead though then I can kill it. It's really confusing me.
10h
comment 2D collisions between 2 arrays
Oh, well if there's any other way to handle an array that can be anything between 0 and 100 let me know. :)
10h
comment 2D collisions between 2 arrays
@wondra Could you elaborate? The "long life" sounds logical without even knowing what it is. What causes it and what's the solution?
10h
asked 2D collisions between 2 arrays
Jul
19
awarded  Popular Question
Jul
3
awarded  Popular Question
Jul
2
awarded  Curious
May
7
awarded  Notable Question
May
7
awarded  Popular Question
Apr
26
awarded  Notable Question
Apr
2
awarded  Popular Question
Feb
27
awarded  Yearling
Jan
2
awarded  Notable Question
Dec
9
awarded  Popular Question