Reputation
1,275
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
3 10
Newest
 Yearling
Impact
~37k people reached

Apr
21
comment Canvas slowly degrades in performance after a while
Glad you could get your frame-rate back ! :-) ( I explained a bit more. )
Apr
21
revised Canvas slowly degrades in performance after a while
added 319 characters in body
Apr
21
answered Canvas slowly degrades in performance after a while
Apr
21
comment Canvas slowly degrades in performance after a while
please factorise your code !! ( var ctx=Canvas2D.ctx). The slowdown might be related to the garbage collector : try to create only one Vector2 and reuse it in your for loops.
Mar
15
comment JavaScript 2D liquid flow
I had done once this quick spring physic based simulation, check my S.O. answer : stackoverflow.com/questions/19787775/…
Mar
11
comment Increasing chance of good loot after multiple tries
The intent of this 'max' is mainly, for instance, to avoid several 'epic' items to be looted in a row, a thing i'd expect to be very undesirable. With the max, you can have only 1 epic or none, which i would prefer. Obviously this makes coding and balancing coefs harder..
Mar
11
revised Increasing chance of good loot after multiple tries
added 2 characters in body
Mar
11
revised Increasing chance of good loot after multiple tries
added 719 characters in body
Mar
11
answered Increasing chance of good loot after multiple tries
Mar
8
comment Should enemies still attack if they cannot see the player?
Another interesting point of the Far Cry gameplay is that, once a base is on alert, reinforcement is called after xxx minutes : this way you can't just hide and wait to kill enemies one by one : you have to kill them fast before being overwhelmed by the new troops.
Mar
1
comment How should I efficiently clear and redraw my canvas with lots of animated sprites?
True that : measure first. Moreover : 1) Javascript's overhead is especially high (vs the same draw load in C++ for instance) and 2) both context2D and webGL are using the GPU to draw, so good luck beating a GPU with a dirty rect algorithm made in JS.
Feb
20
comment Any algorithm for leveling system based on difficulty
You should add more informations to your question : Is it a team vs team game or player vs team ? What are the range of the various values (level, xp, score, ...) ? And give a few examples of match and corresponding scores. It might even help you find the formula !
Feb
13
comment Floating point determinism with respect to procedural generation, clustering and GPU offloading
One way to ensure determinism is to reduce the bit precision by yourself, so that you match the lowest precise platform : expl -> 16 bits : x_fp16 = floor( x * 65536) / 65536. But then you'll have to call such a function on each computation, which might be both slower and harder to code.
Jan
12
comment Collision resolution when moving in two directions
i'm surprised you seem to re-locate the player at x-/+tileWidth or y-/+tileHeight except for the right where you relocate at x-playerWidth. Could you show what prints when there's the bug ?
Jan
11
comment Area attack collision resolving
If the hit is only considered when the projectile is entering the enemy's BBox / collision geometry, wouldn't it be ok ?
Jan
11
answered Collision resolution when moving in two directions
Jan
10
revised How To generate spiky terrain in 2D?
added 61 characters in body
Jan
10
answered How To generate spiky terrain in 2D?
Jan
7
comment Fixed Time Step Flutter
Ho yes, in the high fps case, i think anyway that one should skip frames ( == lower render rate ) to 60Hz, to avoid the computer heating / the fan going crazy. I once had such a display, and Javascript isn't just efficient enough, the noise/heat/power consumption (for a laptop) is far more annoying than the very little gain in smoothness, especially for a (simple) 2D game. After all, 120Hz is for pro-gamers playing fps mainly. (if i may i posted on codepen about the animation loop : codepen.io/gamealchemist/post/animationcanvas1 )
Jan
6
comment Fixed Time Step Flutter
!! Warning : be prepared to suffer !! : rAF is not synced on screen, it is a timer launched quite at the same time as a vsync, with quite the same duration as the screen fps.... !!!! That's why even with a browser alone on your computer, after a fresh restart, no other tabs, no draw mades, you might still miss a frame if that nasty stuff gets out of sync......