Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


willpowered

Member Since 26 Dec 2011
Offline Last Active Feb 09 2015 10:54 AM

Topics I've Started

Scrolling Horror

04 May 2013 - 11:14 PM

public void scrollUp() {
	if (scroll_index <= 0) return;
	scroll_index--;

	refreshContentsPosition();
}

public void scrollDown() {
	if (scroll_index >= contents.Count() + (2 * 6) - 12) return; //todo: make sure this is the correct index, once you add more levels.
	scroll_index++;

	refreshContentsPosition();
}

 

The code speaks for itself. Obviously, upon review, it was not the correct index.

 

Dunno what came over me when I wrote that.


Layer/Depth management for game objects

03 November 2012 - 11:15 PM

I've been working on a game engine for about a year now, but I still feel like my solution to layer/depth management isn't elegant or robust enough.

Currently, I have the game set up a bunch of layers when it starts, which are essentially just strings representing the layer name- "sprites0", "sprites1", "bg0", "bg1", etc. These strings are mapped to lists of the objects that are on each layer.
When objects are added to the game world, you specify a layer for them to go on, and the object gets added to the corresponding layer's list of objects.

The advantages of this method are that I don't have to sort the objects (because I know the layer order), it's easy to keep different types of objects separate (e.g. players and enemies always go above the background, because the layer "actors" is above the layer "bg"), and it's easy to retrieve all objects on a layer (just get the list associated with the layer name).

The disadvantages are that adding objects is slightly slower (hashtable lookup for the layer name/list), changing an object's layer is difficult, and objects don't know what layer they're on.

Are there any other ways that anybody recommends to manage layers or object depth, or any recommended solutions to mitigate these disadvantages?

Porting plan

20 March 2012 - 07:51 PM

So I've been working on a game for a while with my team using XNA 4.0, and the time has come for us to start thinking about our planned iOS and Android ports.

How exactly do you go about this?
My current understanding is that the best option is to port using either...

A. MonoGame (http://monogame.codeplex.com/) - a free, open source implementation of XNA
B. Mono for Android and MonoTouch (http://xamarin.com/) - commercial implementations of XNA

Do I have my facts right in that if we go for either A or B, we'll have everything we need to port a standard XNA 4.0 game to other platforms?

And for my final question: Does anyone have any experience with using MonoGame and Mono for Android / MonoTouch? Which would you recommend, and why?

PARTNERS