Reputation
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
9 20
Newest
 Necromancer
Impact
~99k people reached

  • 0 posts edited
  • 0 helpful flags
  • 321 votes cast
Jun
1
comment How to follow object on CatmullRomSplines at constant speed (e.g. train and train carriage)?
BTW railroads and roads mostly use circular arcs instead of catmull-rom or bezier splines. The math is simpler in some ways, especially the math for following the paths and determining lengths of sections.
May
30
comment 2D Boxes/Vertices merging
The "connected components labeling" algorithm can find everything connected together. You mark each "object" with a separate identifier (int or color), then you only keep the edges that are between two tiles from different objects. If you have only one object, or objects that don't touch, it's even simpler: keep only the edges between two tiles of different objects.
May
19
awarded  Custodian
May
19
reviewed Approve Is a game engine actually needed to make games?
May
18
comment Line of sight on a 2d grid
Sorry - I forgot to "save" the jsfiddle code. See jsfiddle.net/M9y6z/2
May
18
comment Line of sight on a 2d grid
I made an updated jsfiddle that shows how using manhattan length, as well as round instead of float, generates the same points as line_slope() but with much simpler code: jsfiddle.net/M9y6z (I also updated line_slope to use Math.round since the question is asking about tiles)
May
18
comment Line of sight on a 2d grid
BTW, use length = Math.max(Math.abs(x1 - x2), Math.abs(y1 - y2)) to match the interpolation code I posted. I believe it will not generate any duplicates, and then you don't need lastX and lastY.
May
17
answered Line of sight on a 2d grid
May
16
comment Dynamic thruster balancing of space ship
I went down a similar path and ended up writing a demo on this page. As you move the thrusters around (drag them on the ship to set position and power) it draws three shapes. The intuition is that you can think of all possible movements as a point in 3d space (x, y, rotation), and being limited to 0-1 is a constraint in that space. So you end up with a 3d shape containing all possible movements. If you want no linear velocity you're looking at the (x=0,y=0) line in that space (Q,W,E,S all 0 in my demo)
May
14
comment How can I Intercept object with a circular motion
Idea: Consider what the intercept looks like in space-time. The spaceship's trajectory is a line in (x,y,t) space, and it has a minimum slope (relative to t). The planet's trajectory is a helix. Among all lines that meet that helix and exceed the min slope, which one intercepts at the lowest t? Might be messy this way :(
Apr
21
comment Can I prevent diagonal movement from exploring more of the map?
Would a circular shape help here?
Apr
14
answered Generate a 2D distance grid in one pass
Mar
27
comment How to make character gain acceleration?
The simplest thing to do is probably to use interpolating functions such as the ones shown on easings.net (they don't have implementation code though)
Mar
10
answered Java Scrolling 2d Block game - Optimise my code?
Mar
3
answered Modify random distribution functions :: Make it less likely to get multiple similar values in a sequence
Feb
15
awarded  Nice Answer
Feb
10
comment 2D to 3D perlin noise, I'm not sure I get it
The sides of your blocks aren't tall enough to draw the difference between adjacent heights; if you drew taller sprites, I think it would cover the gaps.
Jan
29
awarded  Nice Answer
Jan
25
comment How to implement uniform grids
Take a look at gameprogrammingpatterns.com/spatial-partition.html
Jan
25
comment How can I incorporate the path of a jump into my A* implementation?
@eBusiness: with Dijkstra you have a variable cost, not 1 at every step, and you have to order the queue just like A*. I think you're thinking of Breadth First Search.