Results 1 to 1 of 1
  1. #1
    Lionlev is offline Senior Member
    Join Date
    May 2012
    Posts
    172
    Rep Power
    3

    Question Collision detection isn't working...... Help please? [FIXED]

    Yello, it's me again with another problem...
    Java Code:
    public void isColliding(){
    		if(charac.getBounds().intersects(map.wall.getBounds())){
    			System.out.println("collision is true");
    		}
    	}
    Basically I've got a charac rectangle and another rectangle in class Map (map) and Rect's name is wall..
    in the main class I've got a thread loop that starts isColliding function every few milliseconds.

    Why isn't it working? Should I show all the codes?

    UPDATE:
    Fixed, charac didn't update it's x coordinates that's all....
    Sorry :D
    Last edited by Lionlev; 10-14-2012 at 05:29 PM.
    WARNING I am Russian so it's possible that I wont understand you correctly...

Similar Threads

  1. Collision detection
    By mwr1976 in forum Java 2D
    Replies: 2
    Last Post: 04-14-2012, 01:45 PM
  2. Collision Detection
    By Äppelpaj in forum Java 2D
    Replies: 1
    Last Post: 10-13-2011, 04:29 PM
  3. Collision Detection
    By sunde887 in forum Java 2D
    Replies: 2
    Last Post: 10-08-2011, 12:40 AM
  4. Collision Detection?
    By Alerhau in forum New To Java
    Replies: 39
    Last Post: 09-07-2011, 05:55 PM
  5. Really Need help with some collision detection
    By Harwad in forum New To Java
    Replies: 1
    Last Post: 01-23-2011, 01:38 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
  •