Here is 2D collision processed with EJS event.
You can lean how to use EJS event to process collision.
Download the jar file, double click to run it, then
right click mouse and select "open ejs model" to view how it was created with EJS.
(You need to [url=http://www.um.es/fem/EjsWiki/Main/Download]download EJS[/url] and installed it -- i.e. unzip downloaded ZIP file.)