Age | Commit message (Collapse) | Author |
|
This adds a delta time that ensures that everything moves at the same
speed regardless of framerate or system.
|
|
The trains were being destructed after leaving the scope of the
addVehicle function. This change makes sure the trains stay allocated
for the entire lifetime of the level.
Fixes #2
|
|
This fixes a misuse of std::find_if and vector iterators. Previously,
the first vehicle in the currently drawing tile would be drawn, and then
every other vehicle would be drawn regardless of position.
|
|
|
|
|
|
This algorithm draws the level in two passes; the ground and rail tiles
are drawn first, then the train cars and walls. This method isn't
perfect, but it'll do for now.
|
|
|
|
|
|
|
|
The current level format uses bytes to store the width and height, so
levels that are larger than that are not allowed to be saved.
I don't think that the game will need levels larger than 255x255, but
if it does then the level format can be updated.
|
|
This prevents some issues with loading levels that are larger than the
current one.
|
|
For now, it just reads and writes the width, height, and tile data to
'level.non'
|
|
|
|
Track tiles now have their direction information stored in the high 4
bits of the tile byte, creating a clearer separation between the type of
tile and other persistent data.
This will make the code more managable for adding new tile types and with
the new macros and enums the code is much easier to read and understand.
|
|
Newly created vehicles are now to be added to the Level, which
automatically updates and renders them. This infrastructure will
be needed for depth sorting and eventually level saving.
|
|
|
|
|
|
|
|
* refactor: adjust the project infra.
This patch adds cmake build system to the project, and adjust infrastructure
stuff.
Signed-off-by: Jun Zhang <jun@junz.org>
* fix: remove compiler flags that only exist in GCC.
Signed-off-by: Jun Zhang <jun@junz.org>
|