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 4 of 4

Thread: Collision with drawn lines?

  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    25
    My Mood
    Bored
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Collision with drawn lines?

    Basically, I want to achieve a way to for-see and calculate collision with lines that players draw. Like in line rider without all the fancy pants physics. The type of collision I'll be achieving will be from an isometric view. Can someone help me with this?


  2. #2
    Senile Half-Wit Freaky Chris's Avatar
    Join Date
    Mar 2009
    Location
    Wales, Bangor & England, Warwickshire
    Posts
    820
    My Mood
    Cynical
    Thanks
    7
    Thanked 104 Times in 90 Posts

    Default Re: Collision with drawn lines?

    Store the line details and compute object movements a step ahead in time to see if they collide?


    Chris
    chris[at]javaprogrammingforums[dot]com

    Prifysgol Bangor University, North Wales

  3. #3
    Junior Member
    Join Date
    Aug 2011
    Posts
    25
    My Mood
    Bored
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Collision with drawn lines?

    I thought of this but doing it wouldn't really be that easy. I can't think of an efficient way of doing it essentially.

  4. #4
    Senile Half-Wit Freaky Chris's Avatar
    Join Date
    Mar 2009
    Location
    Wales, Bangor & England, Warwickshire
    Posts
    820
    My Mood
    Cynical
    Thanks
    7
    Thanked 104 Times in 90 Posts

    Default Re: Collision with drawn lines?

    For a small number of objects, even a brute force solution is reasonable.

    Otherwise you might wish to consider looking into spactial partitioning algorithms.


    Chris
    chris[at]javaprogrammingforums[dot]com

    Prifysgol Bangor University, North Wales

Similar Threads

  1. Issues with selecting a drawn circle on graphics
    By Diplo in forum What's Wrong With My Code?
    Replies: 5
    Last Post: July 31st, 2011, 11:53 AM
  2. Collision
    By risen375 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: June 28th, 2011, 07:02 AM
  3. Need help with collision in a game!
    By Skyhigh32 in forum Java Theory & Questions
    Replies: 5
    Last Post: May 18th, 2011, 12:12 AM
  4. Collision Detecting
    By iams3b in forum AWT / Java Swing
    Replies: 0
    Last Post: February 6th, 2011, 12:48 AM
  5. Changing how a Window is drawn.
    By javapenguin in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 8th, 2011, 08:16 PM