3 Replies - 1154 Views - Last Post: 05 August 2012 - 06:33 PM

#1 yothsoggoth  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 19
  • View blog
  • Posts: 49
  • Joined: 19-June 12

PurpleEngine: A very simple library for 2D games!

Posted 04 August 2012 - 04:50 PM

Greetings fellow programmers :).

PurpleEngine is a simple, small, little C++ library to use for making games. It is created with the aim of being easy to get into, and so to help newbies get to grips with some of the very basics of making games.

It uses SDL (and SDL_ttf, SDL_image, SDL_mixer) and Lua, and is made in C++.

There are some built versions available to download, for Linux, on the GitHub repo, but they're fairly outdated, so it's recommended to build from source.

The GitHub repository can be found here: http://github.com/ro...in/PurpleEngine (development branch recommended)
For more information, have a read of my blog post about it here: http://www.robotgobl...ngine-released/

There's also a small example, which can be downloaded here: http://www.robotgobl...hExample.tar.gz
It was also used for this university project: http://www.robotgobl....uk/knighttime/ (although I think the version on that website may be a little buggy)


PurpleEngine is developed on Linux, but has occasionally been tested on Windows (7 and Vista, both with MS Visual Studio 2010). Unfortunately, though, I haven't had an opportunity to build the library for Windows, so if anybody on here could do that, I'd be happy to put a link on the GitHub page.

Is This A Good Question/Topic? 2
  • +

Replies To: PurpleEngine: A very simple library for 2D games!

#2 yothsoggoth  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 19
  • View blog
  • Posts: 49
  • Joined: 19-June 12

Re: PurpleEngine: A very simple library for 2D games!

Posted 05 August 2012 - 07:56 AM

Update
I've created an example of a barebones skeleton window created using the engine, which could be used as a template for starting projects.
You can download the example with a Makefile http://www.robotgobl...nkwindow.tar.gz.

Or, here's the code:
/* PEBlankWindow
 * http://www.robotgoblin.co.uk/purpleengine/PEBlankwindow.tar.gz
 * PurpleEngine Blank Window example.
 * This short code sample shows how to create a blank window, with PurpleEngine.
 *
 * Created using PurpleEngine 0.0.64
 */
#include <PurpleEngine.h>
#include <iostream>

using namespace Purple;

// Screen width, height, and bits-per-pixel
const int SCREEN_WIDTH 	= 800;
const int SCREEN_HEIGHT = 600;
const char* WIN_TITLE	= "PurpleEngine Blank Window";


int main( int argc, char* argv[] )
{
	// Output version information
	std::cout << "Using PurpleEngine version: " << GetVersion() << std::endl;

	// Create a new instance of the 2D engine
	Engine2D* myEngine = new Engine2D( SCREEN_WIDTH, SCREEN_HEIGHT, WIN_TITLE );

	// Loop until the engine has been stopped
	while ( myEngine->IsAlive() )
	{
		myEngine->Update(); // Update the engine and refresh key input

		// Listen for the Escape key, and quit if pressed
		if ( myEngine->IsKeyHit( KEY_ESCAPE ) )
		{
			myEngine->Stop();
		}

	}

	// Delete the engine
	delete myEngine;

	return 0;
}


Was This Post Helpful? 0
  • +
  • -

#3 yothsoggoth  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 19
  • View blog
  • Posts: 49
  • Joined: 19-June 12

Re: PurpleEngine: A very simple library for 2D games!

Posted 05 August 2012 - 03:24 PM

The link in my previous post is broken, it should have an uppercase 'W' in PEBlankWindow, but for some reason it gets changed to lowercase when I post it as a link.

I reported the bug here: http://www.dreaminco...owercase-w-bug/
Was This Post Helpful? 0
  • +
  • -

#4 #define  Icon User is offline

  • Duke of Err
  • member icon

Reputation: 1396
  • View blog
  • Posts: 4,872
  • Joined: 19-February 09

Re: PurpleEngine: A very simple library for 2D games!

Posted 05 August 2012 - 06:33 PM

Think this will work :

You can download the example with a Makefile http://www.robotgobl...nkwindow.tar.gz.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1