Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Polygon and polygon collision

Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am new in 2d animation, and now learning the basic collision detection and stuck at this part . For the code below there are four objects. Rectangle, triangle, hexagon, circle(only circle is static).  I can make the
rectangle - triangle collide/bounced (horizontally) each other. But when it come to hexagon - triangle (vertically), i cannot make it collide because i am using wrong method right(line 154-166) ?

What i understand from my research (youtube/ google) to get polygon-polygon collide is, we need to change the polygon to rectangle by using the code below right ? ( correct me if im wrong).

my question is
how do i use the above  code to put it in the below code. and what i need to add to make hexagon - triangle collision happen. Appreciated if you can give hint or link to make me easier to understand. Thanks

You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic