Results 1 to 2 of 2
  1. #1
    CNew is offline Member
    Join Date
    Dec 2010
    Rep Power

    Default Need help with simple game! *collision*

    I am making a game where i have to images. I have one moving with the arrow keys and one is moving up on its own then when it gets to the top it comes back to its starting point and does it again.

    I need help for detecting collision between the 2 images and when they collide jus having sumthing simple come up like " you lose"
    any help would be appreciated

  2. #2
    javaman1 is offline Member
    Join Date
    Sep 2010
    Rep Power


    Your question is a bit vague, but you could use a simple if statement that compares the location of the two. Just a suggestion. And as for a message that says you lose, you can use a JOptionPane or have a new JPanel created inside your GUI.

Similar Threads

  1. need help with a simple game im making
    By frallan in forum AWT / Swing
    Replies: 2
    Last Post: 11-30-2009, 11:36 AM
  2. Simple Game example
    By mayuresh34 in forum CLDC and MIDP
    Replies: 1
    Last Post: 10-08-2009, 02:21 PM
  3. Simple Dodging Game
    By Tb0h in forum New To Java
    Replies: 1
    Last Post: 07-18-2009, 03:30 AM
  4. Collision Detection (Game)
    By mscwd in forum Sun Java Wireless Toolkit
    Replies: 0
    Last Post: 01-28-2008, 09:34 PM
  5. Listener collision on game
    By cachi in forum Java Applets
    Replies: 1
    Last Post: 08-07-2007, 08:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts