Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » Applications created with U++ » CastleBuilder - simply 2D platform game with editor
CastleBuilder - simply 2D platform game with editor [message #44363] Sun, 01 March 2015 14:48 Go to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

I would like to show my last year project for my studies. It was implemented on "Programing games in C++" course (2013/2014 - summer). This is simply 2D platform game with level editor.

Features:
- level is represented by special xml file (save/load feature is implemented).
- level debugging feature.
- whole written in Upp.
- game is rendering using "Painter".
- game scrolling. (Level can be bigger than screen resolution)
- layers support.
- around 2,5K lines of code.

index.php?t=getfile&id=4742&private=0

Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Sun, 01 March 2015 16:01]

Report message to a moderator

Re: CastleBuilder - simply 2D platform game with editor [message #44375 is a reply to message #44363] Mon, 02 March 2015 10:00 Go to previous messageGo to next message
deep is currently offline  deep
Messages: 263
Registered: July 2011
Location: Bangalore
Experienced Member
Hi Klugier,

Do you plan to make source available on this forum.

This can be good example for programming.


Warm Regards

Deepak
Re: CastleBuilder - simply 2D platform game with editor [message #44395 is a reply to message #44375] Thu, 05 March 2015 14:46 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Deep,

At the moment there are no plans to open this project, but maybe in the future I will decide to do this.

The code is overcomplicated to be good example.

Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Thu, 05 March 2015 19:28]

Report message to a moderator

Re: CastleBuilder - simply 2D platform game with editor [message #44402 is a reply to message #44395] Fri, 06 March 2015 05:03 Go to previous messageGo to next message
deep is currently offline  deep
Messages: 263
Registered: July 2011
Location: Bangalore
Experienced Member
Hello Klugier,

Thanks for response.

My particular interest is about drawing on different layers. Enable / Disable layers.

Looking for some examples for using Layers.


Warm Regards

Deepak
Re: CastleBuilder - simply 2D platform game with editor [message #44408 is a reply to message #44402] Fri, 06 March 2015 18:28 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hello Klugier,

2.5k lines of code, doesn't seem to much for this app : maybe your code isn't that bad Rolling Eyes

[Updated on: Fri, 06 March 2015 18:28]

Report message to a moderator

Re: CastleBuilder - simply 2D platform game with editor [message #44554 is a reply to message #44408] Fri, 27 March 2015 21:26 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Deep,

In layer code there is really no magic. Unless you want to play with transparency (My simply engine doesn't allow that).

Here is part of draw level method:
	for (int layer = level.getLayers() - 1; layer >= 0; layer--) {
		for (int row = 0; row < level.getRows(); row++) {
			for (int col = 0;  col < level.getCols(); col++) {
				int x0 = col * c - view.x;
				int y0 = row * c - view.y;
				
				// Don't paint invisible ellements
				if (x0 + c > 0 && y0 + c > 0 && x0 - c < sz.cx && y0 - c < sz.cy) {
					drawElement(bp, layer, row, col, x0, y0, c, complete || gameOver);
				}
			}
		}

                // ... draw player, draw enemies etc. ...
	}


P.S.
I will consider making this code open source. But, firstly I will need to do some code cleaning's...

Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Fri, 27 March 2015 21:26]

Report message to a moderator

Re: CastleBuilder - simply 2D platform game with editor [message #44555 is a reply to message #44554] Fri, 27 March 2015 21:39 Go to previous message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

Screen shot presenting another level:

index.php?t=getfile&id=4762&private=0

Sincerely,
Klugier
Previous Topic: Sauklaue resp. SWord
Next Topic: TheArduIDE - Ide for Arduino development
Goto Forum:
  


Current Time: Thu Mar 28 17:14:22 CET 2024

Total time taken to generate the page: 0.01204 seconds