hauke96 / metro Goto Github PK
View Code? Open in Web Editor NEWA simple and minimalistic rapid transit simulator.
Home Page: https://metro-sim.de/
License: GNU General Public License v2.0
A simple and minimalistic rapid transit simulator.
Home Page: https://metro-sim.de/
License: GNU General Public License v2.0
Create a list with all trains and their statistics/data.
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)
When you remove a train line, the trains on this line are still driving.
Create a view where the player can see how busy parts of the train lines are (simple switch in the main view?)
Create an input field to type characters (a-z, ä, ö, ü, ß), numbers(0-9), and special characters (. , - ' * ; : _ ! " § $ % & / ( ) = ? [ ] { } ).
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)
.
METRO
classTo 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:
textField
METRO.__inputFocused
to true
METRO.__inputFocused
is trueMETRO.__inputFocused
to false
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.
It's possible to add one node multiple times to a train line.
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.
Make a field for a user defined value for the amount of samples (avalaible values: 0, 2, 4, 8,1 6).
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.).
ArrayList<TrainLine>
in the Overseer classaddRailwayNodeTo(RailwayNode, RailwayNode, TrainLine)
addLine(TrainLine line)
removeRailwayNode(RailwayNode, TrainLine)
removeLine(TrainLine line
but also think of other parameters (e.g. user changed a lot then line
might not exist anymore)static Color
getColor(RailwayConnection)
ArrayList<RailwayNode>
RailwayConnection RailwayNode.getConnection(RailwayNode)
in the RailwayNode
-class to get this RailwayConnection for the color between these two nodesRailwayConnection
on the flyMake time possible so that there can be things like monthly costs etc.
When the mouse is over some game screen (e.g. TrainBuyView) the city circles will be highlighted even if they're below the UI.
If you execute METRO in Windows, you won't see a cursor.
Happens in Windows 7 32/64 Bit with Java 8u4*.
There's a circle dependency between TrainOverseer and TrainLineOverseer. Solve this via a
Overseer
) that's a kind of combined wrapper class for both problem-classes and offers all operations.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:
Idea on how to color a train line:
public static Color[] getColor(RailwayNode, RailwayNode)
public static ArrayList<Color> getColor(RailwayConnection connection)
This class implements the connection between two RailwayNodes ba using their coordinates:
RailwayConnection(RailwayNode, RailwayNode)
Trains can only drive on static lines (like the normal train lines). Therefor a window to manage all the lines is needed.
RailwayNode
this line should drive over (s. comments)Because circles are very hungry, there are ~15fps in the city view, when user is active (draggin, moving the mouse).
Add some funny things to metro. Here's a list:
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).
A dialog to create, edit and remove trains like the train line dialog (#8).
Here some ideas on how to realise the line - train stuff:
0.8754
)The last point my enable the possibility to have multiple end nodes or nodes that are in the middle of the line, etc.
Create the observer pattern for all ControlElements (especially buttons and lists).
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.
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.
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"
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.
Drawing lines with samples > 0 blurres straight (horizontal and vertical) lines.
Asked community already: http://stackoverflow.com/questions/29267764/libgdx-change-applicationconfiguration-sampling-at-runtime
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.
The train lines are drawn over the line view if you move the map
A short and simple list of all trains and lines at the side (right or left) would be very nice.
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
When you create a train line, close the train view, open it again and edit a line it'll say "Line is invalid!":
First there'll appear a color-error (no duplicate colors) and then there'll be the invalid-error. Sometimes he saves the settings anyway.
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?
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.
Create a window for configuration stuff.
Put following settings into that window:
This will construct two identical lines but only one can be edited, the other one is visible but does not appear in any list.
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.
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.
The tool bar with all the train buttons has a missing/wring image.
Create a simple checkbox-control to the windows 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).
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.
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.
Cant write something after deleting given text.
(uncomfirmed issue)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.