Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 Re: Help Me ! » Programming Algorithm » 2007-11-10 10:26:45

I program in Basic (small basic to be precise). Can you explain this in english? It doesn't have to be so comprehensive, I just need to know what to look out for, and I can program it myself.

Thanks again.

#2 Help Me ! » Programming Algorithm » 2007-11-05 04:36:50

wolfcomm
Replies: 6

I'm programming a strategy game, and I'm making an AI algorithm that will move units to their destinations. I need to make sure that units won't run into walls though.

So I need a function (parameters: origin x, origin y, destination x, destination y, object x1, object y1, object x2, object y2). The object in this case would be a wall with two points (x1, y1, x2, y2). The function needs to return a boolian (true/false) if the wall intersects the path. As in, does it cross between the origin and destination. In other words, we have two finite lines (path of movement and wall), and I need to know if they cross.

How do I do that?

Thanks in advance!

Board footer

Powered by FluxBB