/SparkGameToolkit

Easy to use 2D Game Library for Windows

Primary LanguagePascalBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Spark Game Toolkit Logo

Chat on Discord Twitter Follow

Spark Game Toolkit™ (SGT) is a comprehensive 2D game development library designed to provide developers with a powerful set of tools for creating engaging games and multimedia applications.

Table of Contents

Features

  • Win64: Develop games for Windows platforms with ease.
  • Modular architecture: Use only the components you need for your project.
  • High-performance rendering: Efficient 2D graphics rendering capabilities.
  • Audio support: Play music and sound effects with ease.
  • Input handling: Keyboard, mouse, and gamepad support.
  • Resource management: Efficient handling of textures, fonts, and other assets.
  • Physics and collision detection: Basic 2D physics and collision detection systems.
  • Entity management: Flexible entity-component system for game objects.
  • Configuration management: Easy-to-use configuration file system.
  • Utility functions: A wide range of helper functions for common game development tasks.
  • IO: Memory, File and ZipFile IO routines for data input/output.
  • And more. See SGT.pas for the complete feature set.

Getting Started

To get started with Spark Game Toolkit, you'll need to have a basic understanding of Pascal programming and game development concepts.

Prerequisites

  • A Win64 Compiler (e.g., Free Pascal, Delphi, Clang, Visual Studio). You need Delphi 12.1 or higher to compile the project.
  • GPU that supports OpenGL 2.1 or higher
  • Basic knowledge of 2D game development concepts

Installation

  1. Download the latest version of Spark Game Toolkit from the github repo.
  2. Extract the downloaded archive to your project directory.
  3. Include the SGT.pas unit in your project.
  4. Ensure that the SGT.dll file is in the same directory as your executable or in your system's PATH.
  5. Make sure to compile and run ZipFile01 example first to create the 'Data.zip' used by the examples.

Usage

Here's a basic example of how to use Spark Game Toolkit to create a simple window and draw a shape:

program SimpleExample;

{$IFDEF FPC}
  {$MODE DELPHIUNICODE}
{$ENDIF}

uses
  SysUtils, SGT;

var
  LWindow: TWindow;

begin
  if Lib_Init then
  begin
    LWindow := Window_Open('My First SGT Window', 800, 600);
    if Window_IsOpen(LWindow) then
    begin
      while not Window_ShouldClose(LWindow) do
      begin
        Window_StartFrame(LWindow);
        Window_Clear(LWindow, DARKSLATEBROWN);
        
        Window_StartDrawing(LWindow);
        Window_DrawFilledRect(LWindow, 100, 100, 200, 150, RED, 0);
        Window_EndDrawing(LWindow);
        
        Window_EndFrame(LWindow);
      end;
      Window_Close(LWindow);
    end;
    Lib_Quit;
  end;
end.

Modules

Spark Game Toolkit consists of several modules, each focusing on specific aspects of game development:

  • Window: Create and manage game windows.
  • Audio: Play music and sound effects.
  • Texture: Load and manipulate 2D images.
  • Font: Render text using TrueType fonts.
  • Video: Play video files within your game.
  • Camera: Implement 2D camera systems.
  • Polygon: Create and manipulate 2D polygons.
  • Starfield: Generate parallax starfield effects.
  • Sprite: Manage sprite sheets and animations.
  • Entity: Create and manage game objects.
  • ConfigFile: Handle game configuration files.

Examples

The Spark Game Toolkit comes with various example projects demonstrating different features of the library. You can find these examples in the examples directory of the SDK.

Contributing

We appreciate and encourage contributions to the Spark Game Toolkit. Your involvement helps improve the toolkit for the entire community. Here's how you can contribute:

  1. Fork the repository on GitHub.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes, ensuring they adhere to the project's coding standards.
  4. Commit your changes with clear, descriptive messages.
  5. Push your changes to your fork.
  6. Submit a pull request with a detailed description of your changes.

Pull requests are welcome and encouraged. They are an excellent way to propose new features, fix bugs, or improve documentation.

If you find the Spark Game Toolkit beneficial for your projects, please consider:

  • Starring the repository on GitHub to show your support.
  • Sharing your experience with others in the game development community.
  • Providing feedback or reporting issues to help improve the toolkit.

Your support and engagement play a crucial role in the growth and improvement of this open-source project.

License

Spark Game Toolkit is released under the BSD 3-Clause License:

BSD 3-Clause License

Copyright (c) 2024-present, tinyBigGAMES LLC
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
   contributors may be used to endorse or promote products derived from
   this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This license allows you to use, modify, and distribute the software, provided you include the copyright notice, conditions, and disclaimer. For more details, please refer to the LICENSE file included with the SDK.

Links

Contact

For support, feature requests, or general inquiries, please use the following resources:


Copyright © 2024-present tinyBigGAMES™ LLC. All Rights Reserved.