Examples using Region and/or Region.Intersect?

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

Hello all,

Anyone got links to some examples of using Region and/or
Region.Intersect in a graphical / gaming enviroment?

Am investigating into using it for hit-lines in my game.

Brian
 
Hello Brian,

If your game is 2D, or at least you hit-test 2D projections, you can create
regions for two entities you are going to check for a collision and then
intersect these regions. Then check whether the resultant region is
non-empty and if it is, you've got the collision, otherwise there was no
collision.
 
Thanks for the advice but i've really no idea of creating Regions etc.

That's why i'm looking for examples.

My hitlines up until now have been 6 lines (each with a StartPoint and
EndPoint) - 2 hitlines each side of the table, and 2 on top and bottom
(the reason i've the 2 is to leave a space for the goal) like so:
_ _
|_ _|

Tough to visualise, i know!

Should i use a GraphicsPath and add all the Start and End Points?

I'm really puzzled.. anyone shed some light on this or point me toward
some examples?

Brian
 
Thanks for the advice but i've really no idea of creating Regions etc.

That's why i'm looking for examples.

My hitlines up until now have been 6 lines (each with a StartPoint and
EndPoint) - 2 hitlines each side of the table, and 2 on top and bottom
(the reason i've the 2 is to leave a space for the goal) like so:
_ _
|_ _|

Tough to visualise, i know!

Should i use a GraphicsPath and add all the Start and End Points?

I'm really puzzled.. anyone shed some light on this or point me toward
some examples?

Brian
 
Back
Top