New answers tagged

0

I'm unfamiliar with phaser, but a general way to achieve this is to create two Image objects, each one having half of the picture, and position the second below the first, so it looks like one complete image. At the moment the user answers, you can use setTint() to change only half of the picture. This method has its limitations, as you can't dynamically ...


1

I was expecting that it was trivial to seed the javascript pseudo-random number generator. Turns out you can't, at least not in any standard portable way. Alright, we are going to implement one. The following is mulberry32 in JavaScript: function mulberry32(a) { return function() { a |= 0; a = a + 0x6D2B79F5 | 0; var t = Math.imul(a ^ a >...


0

Your first problem doing this would be with JavaScript. It doesn't really have a deterministic, seedable random number generator. (Deterministic means it produces the same array of values every time you use it given the same starting conditions, seedable means you can set those starting conditions). C# does have this, when you create a new Random object you ...


0

Aside from DMGregory suggestion to enforce a maximun timestep... You can use the visibility API. To do so, you will register an event handler visibilitychange event of the document. It will fire when the user switches tab from or to your page. In the event handler you can use Document.hidden or Document.visibilityState to check if it is visible. It is up ...


0

The first point to note, is that an axis aligned bounding box(AABB) is a special case of the Orientated Bounding box(OBB), thus, it is possible to treat AABB as OBB. Secondly, you will need a robust and reliable narrow phase collision detection algorithm. I recommend starting with Separating Axis Theorem, or SAT for short. It's fast-ish, and easy to ...


1

An update for the first week of 2020's: Cocoonjs was probably a solid solution for this issue in the past but they are shutting down.. a quote from their official web site that says it all It is with deep regret that we announce that we will stop providing our beloved service, Cocoon. We started Ludei/Cocoon because we believed the future of app ...


0

Globally uniform chunk boundaries Resolving those chunk edge discrepancies can be done without interpolation. I would suggest using a global function (e.g. 2D Perlin) to define chunk edge heights, so that all chunk edges (at least) align. This is basically like having a series of empty buckets with each neighbour pair of bucket sides having matching heights:...


Top 50 recent answers are included