Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forums Making something go towards a certain point and then detect collision
https://www.eclipse.org/forums/index.php/mv/msg/1096388/1798959/#msg_1798959
randomvariable = randomvariable + 1
happens. How exactly would I do this? I like to look at code, and learn what the person did, so it would be nice if someone could write the code, since I am new. Sorry if my english is bad. https://www.eclipse.org/forums/index.php/r/frm_id/89/?]]>lee mr2018-11-28T01:44:35-00:00Re: Making something go towards a certain point and then detect collision
https://www.eclipse.org/forums/index.php/mv/msg/1096388/1799102/#msg_1799102
https://stackoverflow.com/questions/5801734/how-to-draw-lines-in-java
Then perhaps you can do something like this. Check for whether line A(x,y) and line B(w,z) have a situation where x,y == wz, and if so, go back a step, terminate line A and start line Aa going off on some other direction. Make it simple to start with, e.g., just rotate 45° and go along that new line, always checking each time you do a new x = x + 1, y = y +1.
Hoping for some beginner using Eclipse to make a program for you would probably result in that person's making the kind of thing that works for them but won't work for you in the long run because they have only fulfilled the stated part of your problem, and they haven't seen that the next step in your mind will make their approach a sort of dead end.
If you can use Eclipse, then make a project called, e.g., Bevis_1. Then make a class that will produce a GUI window to work on. Select "src" under Bevis_1,, then File/New/Other/Window Builder/Swing Designer/Application Window. Call it something like Drawer. Eclipse will open the "Source" view of Drawer.java for you. Switch to the Design tab, and you will see a screen with a window that you can start working with.
I would start by making two JTextField "text boxes," one called Starting point, and another called Ending point, and a button called "Draw line." Then try to incorporate the most basic thing you could do given the stuff linked to above. What you want is to fill in two numbers, hit the button, and have the line drawn.
When you get that going, then make a new button called "Draw to starting point +1," which is a little different from the first button because now you don't explicitly go from x to x', you just go from x to x + 1.
When I am setting things up for myself, that is about as far ahead as I let myself think, since once I get into implementing what I think I want I will probably see some complication that I hadn't imagined, prefigured in my mind or whatever you want to call that lack of perfect foresight. So. I will stop at this point.k
]]>Patrick Moran2018-11-29T17:37:27-00:00