Too lazy to do local setup? You can give it a spin using Gitpod or Replit, the only downfall will be lack of audio.
Global keyboard shortcuts:
↑: Move player North
→: Move player East
↓: Move player South
←: Move player West
q: Quit
e: Toggle edit mode
Edit mode shortcuts:
l: Toggle map library
Mouse button 1 (left click): Place tile
Mouse button 2 (right click): Select tile
Why do this?
Why not just use Godot/Unity/et cetera? Basque has a very different priority list than these engines. It is not a generic engine. There isn't much here, but it is a good starting point if you are looking to roll your own engine, here is what it does:
Compiles cross platform (Linux/Mac/Windows/WebAssembly, see Esoteric ports for other platforms).
Visual map editing (with an easy to understand plain text format).
Spritesheet animation.
Background music.
Scrolling.
Collision detection.
Rudimentary frame rate limiting.
Accepts command line arguments (currently only for enabling fullscreen mode).
Resolution detection (estimates window size to 80% of the screen or uses the full resolution for fullscreen mode, this can be switched off).
High DPI awareness. By default the game will not run in high DPI mode, but it will be aware of high DPI contexts. This prevents things from looking fuzzy with weird scaling settings.
Automated GitHub and GitLab packaging pipelines.
Scancode based movement (rather than event loop key states). This keeps the controls from being susceptible to operating system key repeat rates and delays.
Everything that is here should not be considered a final or optimal solution, but rather, a simple approach that can be morphed into a better solution. At this point the engine will become more specific to the game I am building, which is why I see this as the best time to open source it. Hopefully, it can be useful to others, either as a starting point, or as a reference of some things you can accomplish with SDL2.
While editing the map, you may use the visual map editor (available in DEBUG_MODE by pressing e) or edit the text files directly. Basque checks the timestamps of the files, and will reload them if they change, you do not need to recompile or relaunch Basque to do this. map_layout.txt also has suffixed versions created, with the intention of supporting future redo/undo functionality. The current number of versions that are kept is 100. This is of course, configurable.
map_attributes.txt follows the following format (all items are integers):
The visual map editor (available in DEBUG_MODE by pressing e) automatically writes the indices with even spacing. _ is a shortcut for a blank tile (the index for which is configurable under configuration.h).
map_library.txt is intended to be a resource for picking tiles (available in DEBUG_MODE -> EDIT_MODE by pressing l), while editing the world map (map_layout.txt). It has a few special properties. It will not show the player, and it always appears starting at the top left corner of the screen. It is also not editable by the map editor.
After compiling for your platform, you can launch with ./basque (or basque.exe on Windows). Passing -f or --fullscreen will launch the app in fullscreen, rather than the resolution specified in configuration.h.
请发表评论