Skip to content

dillanspencer/Quad-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();
}