Results 1 to 8 of 8
  1. #1
    rtm09 is offline Member
    Join Date
    Apr 2009
    Location
    England
    Posts
    5
    Rep Power
    0

    Default Need Help with Java 2d - moving train

    am new to java and need help on how to create such a program

    A program in Java which depicts a 2-D animation of a railway engine (aka a locomotive) moving around a circular track.

    You should provide the following controls for the railway engine:
    1. an accelerator
    2. a brake
    You should not however be concerned with transmission system or clutches.

    The locomotive should initially be stationary with its engine started; consequently, “pressing” the accelerator should cause it to accelerate up to its maximum speed for that setting of the accelerator. Applying the brake should, of course, cause the locomotive to decelerate. If both the accelerator and the brake are applied, what should happen is for you to determine; you might decide that the only way for the railway engine to come to a halt is for the brakes to be applied, but not the accelerator. You might decide to use vertical sliders for both controls.

    The locomotive itself can be drawn as a simple model in plan view but should have 4 wheels, a body and a driver’s cabin at the very least. The track might be drawn as 2 simple circles depicting the rails; there is no need to draw anything very elaborate. There should however be an area inside the track as well as an area outside the track.

    Once the railway engine is moving, your program will need to constantly refresh the drawing. At the same time, your program will need to respond to the controls. This means that you will need to use separate threads.

  2. #2
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Posts
    742
    Rep Power
    6

    Default

    am new to java and need help on how to create such a program
    ok, so how well do you know java. have you learn about java 2d yet? how much help do you need depends on how well you know java.
    USE CODE TAGS--> [CODE]...[/CODE]
    Get NotePad++ (free)

  3. #3
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    6

    Default

    what have you done so far? what do you know how to do? what have you learned in java so far? "new" is a relative term. your progress is determined by your experience and knowledge, really.

  4. #4
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    6

    Default

    i hate when i reply too slowly...

  5. #5
    rtm09 is offline Member
    Join Date
    Apr 2009
    Location
    England
    Posts
    5
    Rep Power
    0

    Default

    Am a begginner, just began reading about java as part of a computer graphics module. need help please, please.

  6. #6
    rtm09 is offline Member
    Join Date
    Apr 2009
    Location
    England
    Posts
    5
    Rep Power
    0

    Default

    i have been experimenting with the basic progs such as bessenham's line and circle algorithm. thats all i kno. i hve used c# before.

  7. #7
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Regardless of how little you know, your still far better off trying to implement as much of this as you can on your own and then coming back with specific question on your code. This is for two reasons:
    1) Pushing your brain to its limits will help stimulate you to learn, and
    2) From my experience here, our track record at answering specific questions is much better than vague general "totally lost" type questions.

    Good luck.

  8. #8
    rtm09 is offline Member
    Join Date
    Apr 2009
    Location
    England
    Posts
    5
    Rep Power
    0

    Default

    Was hopping I could get a starting point i.e code to establish the interface (circle for the track and the drawing the object).

Similar Threads

  1. randomly moving shapes
    By marlon in forum New To Java
    Replies: 3
    Last Post: 10-05-2012, 09:37 AM
  2. Moving textboxes
    By GabWit in forum New To Java
    Replies: 2
    Last Post: 01-26-2009, 04:07 PM
  3. i want problems to train on it in java
    By sheckoo in forum New To Java
    Replies: 5
    Last Post: 10-31-2008, 12:01 PM
  4. moving image - PROBLEM
    By Triss in forum New To Java
    Replies: 3
    Last Post: 01-17-2008, 06:52 PM
  5. moving a file
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-10-2007, 07:52 PM

Posting Permissions

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