项目作者: maciejgabrys

项目描述 :
Simple 2D game framework.
高级语言: C
项目地址: git://github.com/maciejgabrys/Lame2D.git
创建时间: 2018-08-24T18:16:56Z
项目社区:https://github.com/maciejgabrys/Lame2D

开源协议:MIT License

下载


Lame2D

Lame2D is a C game framework based on SDL2 with the use of SDL_ttf, SDL_image and SDL_mixer.

Functionality

Lame2D is directed towards pixel art game developers. It handles drawing on a small canvas which then gets upscaled to fit the window, keeping pixels sharp and square.

At the first glance, it may look like an another fantasy console—but it’s not the case. Although I don’t discourage anybody from utilizing it in such a way!

To be more precise, size of the canvas is not imposed in advance, so it is up to a programmer to specify it. The same goes to setting a frame rate and whether game should start in fullscreen. Not to mention there’s no limitation on a color palette size or a level of sophistication of music and sounds.

As for resources, Lame2D can handle:

  • TTF fonts,
  • PNG graphics,
  • MP3 music,
  • WAV sounds,
  • CSV maps.

The last being compatible with maps exported directly from Tiled.

Game structure

To start writing a game with Lame2D, you only need a few lines of code:

  1. #include "Lame2D.h"
  2. int main(int argc, char* argv[])
  3. {
  4. lmInit("Empty window", (lmSize) { 320, 240 }, 0xFF000000,
  5. (lmSize) { 64, 56 }, 20); //initialization
  6. //load your resources
  7. //play music
  8. while (lmWindow_IsOpen()) //game loop
  9. {
  10. lmScreen_Clear(0xFFFFFFFF);
  11. //draw scene
  12. //handle controls
  13. lmScreen_Refresh();
  14. }
  15. //destroy resources
  16. lmQuit(); //termination
  17. return EXIT_SUCCESS;
  18. }

An empty window.

Rest of the API isn’t much harder than that, you can find whole documentation on the wiki.

Made with Lame2D

Slime

A short game which makes use of almost every aspect of Lame2D. You can check it out here.

Title screen Third level

Installing

If you want to manually setup everything by yourself, the installation process is described on the installing page. However, you may just want to download a premade Visual Studio 2017 project with everything configured and ready to use!

Authors

Kotziauke—initial work.

License

This project is licensed under the MIT License—see LICENSE.md for details.