Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

io.github.joafalves:pixel-math

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

io.github.joafalves:pixel-math

Modular Java/Kotlin 2D Game Framework.

  • 0.10.0
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

Pixel - Java Game Framework

Pixel Framework

What is this repository for?

This repository contains the Pixel Java Framework and associated modules/dependencies.

Description

The Pixel Framework aims to provide a high performance and lightweight OpenGL 2D game development workflow. It is influenced by the popular XNA framework and is built on top of the LWJGL and GLFW projects.

:book: For practical details on how to use this framework, please check the wiki page.

Pixel is designed to be modular and easy to extend. Check here for more details on how to use the available extensions (or how to create your own).

Examples

Check the :file_folder: demos folder for examples.

Basic example (Drawing a Sprite)
public class SingleSpriteDemo extends PixelWindow {

    private Camera2D gameCamera;
    private ContentManager content;
    private SpriteBatch spriteBatch;

    private Texture spriteTex;

    public SingleSpriteDemo(GameSettings settings) {
        super(settings);
    }

    @Override
    public void load() {
        // load up of resources and game managers/utilities
        gameCamera = new Camera2D(this);
        content = new ContentManager();
        spriteBatch = new SpriteBatch();

        // example of loading a texture into memory:
        spriteTex = content.load("<texture_path>", Texture.class);
    }

    @Override
    public void update(DeltaTime delta) {
        // game update logic goes here
    }

    @Override
    public void draw(DeltaTime delta) {
        // begin the spritebatch phase:
        spriteBatch.begin(gameCamera.getViewMatrix(), BlendMode.NORMAL_BLEND);

        // sprite draw/put for this drawing phase:
        spriteBatch.draw(spriteTex, Vector2.ZERO, Color.WHITE);

        // end and draw all sprites stored:
        spriteBatch.end();
    }

    @Override
    public void dispose() {
        content.dispose();
        spriteBatch.dispose();
        super.dispose();
    }
}

Looking for ECS support? Check this built-in extension!

Project structure

The framework functionality is divided into multiple modules which can be imported individually as required.

Root directory structure
.build/                         # Bundle .jar files (run 'bundle' gradle task)
.demos/                         # Feature showroom and learning examples
.extensions/                    # Extensions for the framework (optional)
    ├── ext-ecs                 # Entity component system extension
    ├── ext-ecs-extra           # ECS utility components
    ├── ext-gui                 # GUI extension *WIP*
    ├── ext-ldtk                # LDTK extension
    ├── ext-log4j2              # Log4j2 extension
    ├── ext-physics             # Physics extension *WIP*
    ├── ext-tiled               # TileD extension
    └── ext-tween               # Tween extension
.modules/                       # The principal modules of the framework
    ├── commons                 # Common utility classes
    ├── core                    # Main module, contains principal classes
    ├── input                   # Input module (Keyboard, Gamepad, Mouse)
    ├── math                    # Math module (Vector, Matrix, etc)
    └── pipeline                # Pipeline processing module
.resources/
    └── images                  # Project resource images
.build.gradle                   # Gradle build file
.settings.gradle                # Gradle settings file
Inner module structure
.modules/
    └── *module*                 # Presented file structure similar in all modules
        ├── build                # Module build directory
        │   ├── docs             # Generated documentation files (run 'javadoc' gradle task)
        │   └── libs             # Generated .jar files (run 'jar' gradle task)
        ├── src                  # Module Source folder
        │   ├── main             # Module Main Source classes
        │   └── test             # Module Test Source classes
        └── build.gradle         # Module Gradle build file (contains inner dependency definitions)

Development requirements

  • Java 11+
  • Gradle 7.x+

Runtime OS compatibility

Pretty much the same as the LWJGL dependency, which includes:

  • Windows (x86, x64, arm64)
  • MacOS (x64, arm64)
  • Linux (x86, x64, arm64, arm32)

Requires OpenGL 3.3+ support.

FAQ

  1. I'm unable to run Pixel on MacOS due to system error
    • Add -XstartOnFirstThread as a java VM Option before running your project.
  2. Is Pixel compatible with Kotlin?
    • Yes, Pixel is fully compatible with Kotlin. Check this demo for an example.
  3. Is Pixel available as a Maven dependency?
    • Yes, Pixel is available as a public Maven dependency. Click here for more details on how to import using Maven or Gradle.
  4. Is Pixel free?
    • Yes, Pixel is completely free to use and distribute as an application dependency.

Who do I talk to?

FAQs

Package last updated on 09 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc