Tag Info

New answers tagged

0

This effect is likely done with blending modes. http://blogs.adobe.com/webplatform/2014/02/24/using-blend-modes-in-html-canvas/ You would create a gradient light texture like: and set the composition/blending mode to either additive or multiply (or some other mode for a different effect) and then draw it on top of the area you want lit up. I'll see if i ...


0

How do you want to use CSS? Would you want to create the card images as HTML elements with single glyphs for images such as hearts? I'd consider that a very bad and inefficient idea. Using PNG graphics (or images in general) is most likely the most compatible way of doing this. If you're careful, you'll even make the game work on older browsers not ...


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

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 ...


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 ...


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 ...


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 ...



Top 50 recent answers are included