We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionExhibition › Simple Rectangular Collision; beginner
Page Index Toggle Pages: 1
Simple Rectangular Collision; beginner (Read 584 times)
Simple Rectangular Collision; beginner
Mar 26th, 2010, 10:04am
 
Hi All:

I know there are tons of threads on this topic, but I wanted to put my first working version of a simple rectangular collision engine out here for discussion:

adam [dawt] theoherns [dawt] com/applets/matching_v003/

(apologies for the mangled URL, I'm not yet allowed to post links on the forum)

Eventually I want for these to float around the canvas as though on water, bouncing off of one another and the edges of the screen, with angular momentum etc.

I'm building a game in which each rectangle will actually be text, and you drag/drop matching text boxes on top of one another.

My question is about structure: I'm new to OOP, and I'm trying to implement Control-Model-View architecture, but I really only have a superficial understanding of what that means and how to use it in practice. I would be eternally grateful if some code warrior out there could take a look at my source and let me know how to improve!

Many thanks. Processing rocks!!

Adam
Page Index Toggle Pages: 1