Giter Site home page Giter Site logo

dillanspencer / quad-engine Goto Github PK

View Code? Open in Web Editor NEW
11.0 1.0 0.0 180 KB

A high-level cross-platform 2D game development API

License: MIT License

Java 100.00%
java 2d-game-engine 2d-graphics game-development java-programming java-game-development java-2d-game game-engine

quad-engine's Introduction

Quad Engine

2D Platformer Game Engine

The Quad Engine was developed to make 2D game programming easy for everyone. The engine is made to be implemented into your project before you start developing.

Using Java 8 internal libraries, it is specifically designed for 2D games (no support for 3D at the moment), and proposes a set of functions for 2D resources management (images, sprites, animations, tiles...). Inputs and outputs are also available, with an easy keys retrieval, mouse movement... Management of music file are also available (Wav, Midi). Windowed and full-screen are fully supported, with a complete frame rate control.

In the Quad Engine's current version, it greatly simplifies the development of Platformer, and Top Down games.

General Features

  • GameContainer

  • Simple initialization, with title control, and screen configuration
  • Extrapolation control (machine speed independent)
  • Sequence control (intro, menu, game, credits...)
  • Easy resource management (relative to resource directory)
  • Advanced image usage (sprite, animation, tile, font, parallax)
  • Renderer

  • 2D dynamic lighting
  • 2D shadow rendering using ShadowTypes (Full, Half, Total, None)
  • Renders images (sprites, animations, objects, shapes)
  • Components

  • GameObject class handles objects in the game (player, enemies, items)
  • Easy object managing
  • Object physics, handles collisions between TileMap and other objects
  • FX

  • Resource managment (_sprites, images)
  • Font for rendering text
  • Audio handling (support for Wav)
  • Light handling (size, color)
  • TileMap

  • 2D parallax background support
  • Tile based implementation from single image
  • Smooth tile movement using Tween Engine

Installation

Steps to include the Quad Engine in your project:

  1. Install at least the Java JDK 8
  2. Choose your favourite IDE (Eclipse, Netbeans...)
  3. Download the latest [Quad Engine]
  4. Include all Quad Engine classes you need for your project:
    • Quad Engine (minimum requirement)
      • GameContainer (main game loop)
      • Abstract Game (base for game development)
      • Renderer (support for rendering)
      • GameObject (base for creating objects)
      • Background (parralax background support)
      • TileMap (support for creating dynamic map)
  5. You are now ready to use the Quad Engine in your project

Getting Started

Once you installed the Quad Engine in your project, you can quickly start creating a project using the following code:

Main class

public class GameManager {
    public static void main(String[] args) {
         GameContainer gc = new GameContainer(new AbstractGame());
         gc.setWidth(Settings.WIDTH);
         gc.setHeight(Settings.HEIGHT);
         gc.setScale(Settings.SCALE);
         gc.setTitle("Quad Engine 1.01");
         gc.setClearScreen(true);
         gc.start();
    }
}

Minimal State

public class StateTest extends State{

	@Override
	public void init(GameContainer gc) {
		// Initiate state
		
	}

	@Override
	public void update(GameContainer gc, float dt) {
		// Update state
		
	}

	@Override
	public void render(GameContainer gc, Renderer r) {
		// Render state
		
	}

	@Override
	public void dipose() {
		// Dispose state
		
	}

}

AbstractGame (Add this code)

private void loadState(int state) {
	// implement this into your code. TestState() is your state and VALUE is its index.
	if(state == VALUE) states[currentState] = new TestState();
}

quad-engine's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.