-
Collisions.
I was just wondering how you go about doing collisions. The easy way is to do the 'intersect' code, but that works only with rectangles. Another way is to have the coordinates of each line and check with something that has the coords of the character and the object with the boundaries, but then round objects can still be a problem. Also, if you happen to have a thin 'pole' in the middle of the playing field and its width is smaller than the distance you are traveling you might pass right through it.
Anyways, all that was said to ask: How do you go about collision detection?
-
Your code must have a way to determine if two graphical objects share some
2D space. One way to do it is to make an abstract superclass that extends the
Polygon class and defines some basic methods like draw, move and perform and also
has a defined center Point. Descendants from this class should easily give the
collision precision you need.
eschew obfuscation
-
Hi
I will sugestd that you take a closer look at this homepage:
http://www.diku.dk/~kenny/pubs.html
This homepage has some good stuff about collision detection.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks