123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|114|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> Drawing Circles

Wed, 04 Oct 2006, 04:05
mike_g
I'm trying to make a line of sight function for my game, but I am not very good at maths.

If you run this demo you can see a function that draws on a grid from the player to the distance he can see. It has a diamond shape that dont look right so now I want a circle.

I found the formula for a circle but kinda made a mess of what I was trying to do. You can see my mess by commenting out LOS and un-commenting LOS2.

Anyway can someone please show me, in stupid peoples terms, how I can create a circle.

Wed, 04 Oct 2006, 04:34
Jayenkai


Circle = CenterX+(Sin(Angle)*Distance), CenterY-(Cos(Angle)*Distance)


Oh, and if you tweak the "Step 5", you get a "Blindspot" type effect..

-=-=-
''Load, Next List!''
Wed, 04 Oct 2006, 06:46
mike_g
Thanks Jay Diablosdevil posted a different version on Dev Crunch, you both seem to be using trigonomery, so i guess it must a better way to do this. I'll check em both out when I get home and figure out how they work.