Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Collision Detection

  1. #1
    Junior Member
    Join Date
    Sep 2013
    Posts
    7
    My Mood
    Inspired
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Collision Detection

    I'm trying to make a simple 2d game in a java applet. It's literally 2 different colored squares drawn into the screen in the paint method and I can't figure out collisions between the 2 squares. I've read up about getters and setters and they seem to be a big part of the process but if someone could make me a snippet if code where just 2 squares collide that would be awesome thanks


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Collision Detection

    I wrote a tutorial on exactly this, let me know if any of it is confusing: Keyboard Input - Tutorials - Static Void Games
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Collision detection
    By Cutupangels in forum What's Wrong With My Code?
    Replies: 2
    Last Post: September 10th, 2013, 07:48 PM
  2. AI, Collision Detection, and Timing
    By Staticity in forum Java Theory & Questions
    Replies: 0
    Last Post: March 20th, 2012, 02:12 PM
  3. collision detection not working...
    By skberger21 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 10th, 2011, 09:02 PM
  4. Collision Detection difficulties
    By Uritomi in forum What's Wrong With My Code?
    Replies: 3
    Last Post: May 20th, 2011, 10:10 AM
  5. 2D Collision Detection
    By Cuju in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 3rd, 2010, 10:39 AM