Git Product home page Git Product logo

metro's People

Contributors

hauke96 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

thuunivercity

metro's Issues

List of trains

Create a list with all trains and their statistics/data.

Window or not window, that's the question ...

Method A: Create window where the list is in. This requires a list control
Method B: Create an own area at the right side of the window with the list. (s. #20)
Method C: Do both: Implement the option to "undock" the static list into a window and the other way round. (maybe later)

Ulilization view

Create a view where the player can see how busy parts of the train lines are (simple switch in the main view?)

InputFIeld for windows

Create an input field to type characters (a-z, ä, ö, ü, ß), numbers(0-9), and special characters (. , - ' * ; : _ ! " § $ % & / ( ) = ? [ ] { } ).

Technical Aspects

Create a new class named InputField and let it implement the ControlElement Interface. It should also be possible to get the text via .getText() or something like that, so set text (not only in the constructor) with .setText(String text).

Focus functions in the METRO class

To be able to differ between a shortcut and a character the user wants to write, there should be a focus-function using a single boolean value ( boolean __inputFocused ) like:

  1. User clicked on a textField
  2. Set METRO.__inputFocused to true
  3. In all classes with shortcuts/hotkeys will it be neccesarry to check if METRO.__inputFocusedis true
  4. User clicks on a point where no textField is
  5. Set METRO.__inputFocused to false

Notification area/log

It'd be cool to have a kind of notification area/list in one of the corners. It should log failures (e.g. not enough money to buy something) and other activities.

Removing entries from list control

When you remove an entry from a list, the length of the scroll bar isn't adjusted as well as the entries. You can even scroll below the remaining entries.

The TrainLine-class(es)

These are some ideas for the TrainLine-class. There should also be a kind of TrainLineOverseer class (like the RailwayNodeOverseer class), to store the lines and manage all actions with lines (adding, changing, getting, etc.).

For the Overseer class:

  • Hold all lines in an ArrayList<TrainLine> in the Overseer class
  • Edit methods for a TrainLine
    • Add-method addRailwayNodeTo(RailwayNode, RailwayNode, TrainLine) -> instead created other method: addLine(TrainLine line)
    • Remove-method removeRailwayNode(RailwayNode, TrainLine) removed this.
    • Remove method for whole lines like removeLine(TrainLine line but also think of other parameters (e.g. user changed a lot then line might not exist anymore)

For TrainLine class:

  • Store Color as static Color
    • Write getter getColor(RailwayConnection)
  • Save all RailwayNodes in ArrayList<RailwayNode>
  • Write add and remove method (as mentioned for the overseer) when something changed, a whole new line will be created

Other modifications/creations:

  • Write RailwayConnection RailwayNode.getConnection(RailwayNode) in the RailwayNode-class to get this RailwayConnection for the color between these two nodes just create new RailwayConnection on the fly
  • Create RailwayConnection class (s. #14)

Time

Make time possible so that there can be things like monthly costs etc.

Windows has no cursor

If you execute METRO in Windows, you won't see a cursor.

Happens in Windows 7 32/64 Bit with Java 8u4*.

Circle dependency between TrainOverseer and TrainLineOverseer

There's a circle dependency between TrainOverseer and TrainLineOverseer. Solve this via a

  1. super-class (like Overseer) that's a kind of combined wrapper class for both problem-classes and offers all operations.
  2. combination of both, because they are pretty similar.

Selecting bought trains

When the player selects a train in the list of bought trains, it would be nice to have some information and statistics about this train. There are some ways in doing this:

  1. Select also the model in the buy-train-list and show their information
  2. Hide the lower section of the train dialog and show information and statistics of this train
  3. Do the first idea and open a window with statistics
  4. Do the first idea and show a pop-up over the train (same idea but looks probably prettier)
  5. Do a mixture of the first and third/fourth idea: Look if the window height is high enough to show information between the main and buy view. If there's not enough space available open a window/pop-up

Color train lines (RailwayNode connection)

Idea on how to color a train line:

  • Get color of node by Line-class TrainLineOverseer
    • Getter like public static Color[] getColor(RailwayNode, RailwayNode) public static ArrayList<Color> getColor(RailwayConnection connection)
  • Draw different lines in colors (given by array)

RailwayConnection class

This class implements the connection between two RailwayNodes ba using their coordinates:

  • Use constructor with RailwayConnection(RailwayNode, RailwayNode)
  • Save coordinates of these nodes
  • Equal if all coordinated are equal

Create train-line

Trains can only drive on static lines (like the normal train lines). Therefor a window to manage all the lines is needed.

Content of window

  • List of all lines
  • "New line"-Button
    • Hide window temporary
    • Select RailwayNode this line should drive over (s. comments)
    • Highlite new train-line
    • Show other lines in their color (a bit pale?)
    • Give line a name
  • Edit-line"-Button
    • Add nodes to line
    • Remove nodes from line (with second click)
  • "Remove-line"-Button
    • Choose new line for trains (comes when trains were implemented)

Low FPS in CityView

Because circles are very hungry, there are ~15fps in the city view, when user is active (draggin, moving the mouse).

Funny things

Add some funny things to metro. Here's a list:

  • It can happen that passengers puke into the train. This train has to wait and become cleaned. This takes abwhile and costs a bit.
  • It can happen that people brick up a door so that passengers can't enter the train. This also costs a bit to repair the train.

Everything shouls be a window

Currently a game screen has to remove his controls manually (e.g. the "play" button in the main menu). That's not nice.
Modify the window class so that "invisible windows" are possible (windows with no background and no border). The window ensures the removing of all control elements.
Furthermore every control has to be protected instead of public to be sure that only the Window class can access these (and not a game screen or other non-window-system classes).

Train manage dialog

A dialog to create, edit and remove trains like the train line dialog (#8).

  • List of all trains
    • Show the ratio earnings - costs for one year (to far thought for 0.1.3 due to missing money-system)
  • Buttons
    • Buy button
    • Edit Move button
    • Remove Sell button
  • List of all lines
  • Poss.: Input field for the name of a train

Trains and lines

Here some ideas on how to realise the line - train stuff:

  • Let the lines know all trains, so no train knows any line
  • A train has a relative position on the line (e.g. 0.8754)
  • Trains also know the end-node of their journey. This allows the line to draw/move the train in the right direction

The last point my enable the possibility to have multiple end nodes or nodes that are in the middle of the line, etc.

Observer pattern for ControlElements

Create the observer pattern for all ControlElements (especially buttons and lists).

  • Create Observer interface
  • Create Observable class
  • Create Manager for all controls to nicely manage the input events
  • Create pattern for all buttons
  • Create pattern for all lists

Simplify METRO class

Simplify the METRO class by putting several field into the game state (e.g. the __baseNetSpacing field). Also implement the singleton-patern for the settings class and forward the instance to the classes that needs settings.

Crossings in line

A train line allows crossings. This isn't a real bug but it makes it impossible to calculate a unique path through the line. It'd be better to only allow straight lines.

Amount of circle-segments in config dialog

In LibGDX there's the opportunity to choose an amount of segments for a circle (default is 32?). Make a field for a user defines value.
Have in mind: less segments -> faster -> less "circly"

Custom cursors for controls

It would be nice to have custom cursors for different controls.
E.g. InputField should have this vertical line. A color bar should have no cursor but a marking of the selected color, etc. etc.

Idea:
METRO.setCursorImage(TextureRegion newTexture) when setting it to null then use the default value.

Debug mode

Create a debug mode which prints useful (does not mean: Print the number of controls every time you enter the renderInit() method) information into the console or on the screen.

Can start the app: java.lang.ArrayIndexOutOfBoundsException: 0

I'm getting this in Ubuntu:

$ java -jar METRO_0.1.3_alpha.jar 
Exception in thread "LWJGL Application" java.lang.ExceptionInInitializerError
    at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.setVSync(LwjglGraphics.java:446)
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:118)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
    at org.lwjgl.opengl.XRandR.findPrimary(XRandR.java:326)
    at org.lwjgl.opengl.XRandR.ScreentoDisplayMode(XRandR.java:315)
    at org.lwjgl.opengl.LinuxDisplay$3.run(LinuxDisplay.java:746)
    at org.lwjgl.opengl.LinuxDisplay$3.run(LinuxDisplay.java:743)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:743)
    at org.lwjgl.opengl.Display.<clinit>(Display.java:138)
    ... 2 more
AL lib: (EE) alc_cleanup: 1 device not closed

Edit lines: Invalid train lines

When you create a train line, close the train view, open it again and edit a line it'll say "Line is invalid!":

  1. Create train line
  2. Close the line view (e.g. switch into train view)
  3. Reopen the line view
  4. Try to edit a line

First there'll appear a color-error (no duplicate colors) and then there'll be the invalid-error. Sometimes he saves the settings anyway.

Mouse position wrong on windows

On windows 7 x64 (and probably on every newer windows) with METRO 0.1.3r3 is the mouse position a bit to high (=the cursor is displayed a bit to low). Maybe a problem with the missing window head-bar?

Invalid train line indication ugly

When you build a line and you missed a node to click on, the line becomes red (which is totally fine) but you are not able to see which node you missed.

The idea: Do not allow adding/removing nodes while the line is invalid. Or in other words: When the clicked node will make the line invalid, do not allow the action.

config window

Create a window for configuration stuff.
Put following settings into that window:

  • Graphics stuff
    • Amount of samples (0,1,2,4,8,16)
    • Resolution
    • Fullscreen on/off

Forgetting name of line will build two lines

  1. Create a new line
  2. Choose a color but no name
  3. Click on "save"
  4. Type in the name
  5. Again click on save

This will construct two identical lines but only one can be edited, the other one is visible but does not appear in any list.

Merge stations

It'd be cool to merge to stations that are direct neighbours (station B is in the von neumann neighbourhood of station A), meaning that it's possible to build one large station over two (or more?) crosses. This will enable the possibility to build multi-track railways.

ID of Node not working for negative numbers

The formular
_NodeID = (int)(((Math.pow(position.x + position.y, 2) + position.x + position.y) / 2.0) + position.x);
does'nt work for negative numbers.

Create new function or new ID system for Nodes.

Wrong image on train-button-toolbar

The tool bar with all the train buttons has a missing/wring image.

  • The "+"-train symbol can be removed
  • The list-icon should really used for train-lists
  • Create new icon for line-list (git-icon-like net)

Mouse on invisible controls

When controls are not visible they'll nevertheless cause issues on hover-checks, because when the cursor is over an invisible control, the system "thinks" that the cursor hovers this control (like it would to on a visible control).

Just insert a check for invisibility (maybe directly in the ActionManager? Otherwise in the controls itself).

Click on build-tools cause direkt usage

When the player clicks on "build track" or "build station", this will instantly use the tool. That means, that the player will buy a station or start to build tracks by clicking the button.

Train tamplates

Currently (implemented in 5f916df) a train template (stored in the game state as LinkedHashMap<String, Train> _availableTrains is just a normal train. These templates can be changed and are not useful when you are able to change them. It'd be better to have a TrainTemplate class that stores just the templates. Of course the second Train constructor has to be changed.

InputField issue

Cant write something after deleting given text.
(uncomfirmed issue)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.