Tag Info

Hot answers tagged

3

At first glance, I would say you're going to have a problem with splicing during the loop. Say you're at index 1 and you have a collision. You then remove that spot, and now everything moves up a space. But your loop counter still increments. So what used to be in the second index is in the first one, and you went from the first to the second, skipping it ...


2

You problem is in speed of checking for collisions. there are two possible solutions: Check several (n) times each frame (=move 1/n speed n times) Instead of point-rectangle intersection perform line segment - rectangle intersection the first solution is fast and easily implemented, on the other hand it doesnt really solve anything, if your bullets are ...


1

As far as I know, phaser is 60 frames per second only, and you don't have access to the delta time. If you want to simulate 30fps for example, you could skip the update() every second frame. Read more here: http://www.html5gamedevs.com/topic/2959-how-to-set-fps-to-30/ It is therefore up to you to make sure that every frame runs within 16ms (1000 / 60) so ...


1

It's really your tools' responsibility to respond appropriately to events, so I'd recommend representing each of your tools as an object containing functions that handle mouse events and delegating the event handling to the currently active tool. In practice, you can do this by defining your tools var railsTool = { onMouseUp : function(event) { /* ...


1

If I understand correctly, you have a bullet "object" of size 36x6 colliding with an enemy of size 56x69. Let's take a look at each step of the collision: bullets[a].x + 36 >= enemies[b].x This will test if the bullet right side is to the right of the enemy's left side. Right after, you have this: bullets[a].x <= enemy[b].x + 56 Here, you test ...


1

I agree with Oliver Schöning's response. I haven't used ImpactJS before, so I'll talk about C2: C2 pros: Very well documented. Many tutorials. Dedicated plugins: Platformer games become very easy to develop. The SDK is extensible with your own plugins and behaviors. C2 cons: To integrate some third party plugin in your game (e.g. Socket.io) you must ...



Only top voted, non community-wiki answers of a minimum length are eligible