summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-04-01Add a game timerHEADmastercflip
This adds a delta time that ensures that everything moves at the same speed regardless of framerate or system.
2022-03-30Store train objects in a unique_ptrcflip
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
2022-03-29Fix sprite sorting when rendering the levelcflip
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.
2022-03-29Return a reference instead of a pointer in addVehicle()cflip
2022-03-28Checkout with submodules on CIcflip
This ensures that stb_image.h can be included.
2022-03-28Merge pull request #3 from junaire/cicflip
Add GitHub Actions
2022-03-28Add Github Actions.Jun Zhang
Signed-off-by: Jun Zhang <jun@junz.org>
2022-03-26Update build instructionscflip
2022-03-26Fix SDL include path in window.cppcflip
2022-03-26Include stb_image as a submodule instead of a file in the repositorycflip
Instead of storing a copy of stb_image.h in the repository directly, we can just include it as a submodule.
2022-03-26Add missing #includes for find_if and ceilcflip
2022-03-26Implement sprite depth sortingcflip
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.
2022-03-24Add a header to the level file formatcflip
2022-03-24Create new trains on right click instead of moving the existing traincflip
2022-03-24Don't create a copy of the train graphics per vehiclecflip
2022-03-24Add acceleration/deceleration to the traincflip
2022-03-24Add camera panning with arrow keyscflip
2022-03-23Automatically copy resources to build directorycflip
2022-03-23Simplify track sprite lookupcflip
2022-03-23Prevent oversized levels from savingcflip
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.
2022-03-23Reallocate tilemap on level loadcflip
This prevents some issues with loading levels that are larger than the current one.
2022-03-22Update link to cflip.net's Nonortho pagecflip
2022-03-21Implement simple level saving and loadingcflip
For now, it just reads and writes the width, height, and tile data to 'level.non'
2022-03-21Add support for keyboard events in the Windowcflip
2022-03-21Minor improvements in Window classcflip
* Ensure event callbacks are not null before calling them * Mark shouldClose() as const * Use nullptr instead of NULL
2022-03-21Add a basic wall tilecflip
2022-03-06Create new tile byte formatcflip
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.
2022-03-03Keep list of all vehicles in Level classcflip
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.
2022-03-03Remove unnecessary method parameter in Train classcflip
2022-02-28Quick and simple multi-car train implementationcflip
2022-02-27Fix typo in window.cppcflip
2022-02-27Remove unnecessary <cmath> include in util.hcflip
2022-02-27Remove Starliner.mp3cflip
2022-02-27Add sprite for east-west moving train carcflip
2022-02-27Add build instructions to READMEcflip
2022-02-27Add highlight on hovered tilescflip
2022-02-27Automatically set train direction on right-clickcflip
2022-02-27Miscellaneous code cleanupcflip
2022-02-27Add ClangFormat configurationcflip
2022-02-27Rename TrainCar to Traincflip
Although the name isn't entirely accurate, it looks nicer.
2022-02-27Make train movement smoothercflip
2022-01-29Initialize member variablescflip
2022-01-29Close program on image read failurecflip
2022-01-29Add CMake build output to gitignorecflip
2022-01-29refactor: adjust the project infra. (#1)Jun Zhang
* 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>
2022-01-25Remove unused codecflip
2022-01-25Convert Starliner to mp3cflip
2022-01-25Resolve merge conflictcflip
2022-01-25No need to specify tile ids above 1cflip
2022-01-25Implement simple train carcflip
For now, the car just exists at a certain tile and has a 'progress' timer until it moves to the next track tile.