Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Puyover

Member Since 10 Mar 2007
Offline Last Active Dec 14 2014 10:46 AM

Topics I've Started

Design patterns and game development

02 March 2013 - 03:22 PM

Hi there,

 

I'm currently returning to game development from my traditional software development, but years ago when I started with C and SDL I didn't care about design patterns at all, so now I found myself surrounded with their chaos and can't simply code without standing with one of them.

 

I don't understand which one fits better into game dev (MVC? Components? ... ), and indeed, I don't know many of them however.

 

So my question is, where to start in design patterns? I'm studying the library SFML with C++ right now, which is a language I had forgotten (And I hated) but industry right now almost force you to know C++, and I was very lazy with Java, so I need that change.

 

Thanks in advance.


Tile based map and collision; getting stuck

02 July 2011 - 07:13 PM

Hello!

I'm trying to make my character move around a tile map with collisions. Everything works fine except for one thing. I show you a picture with the problem:

Posted Image

That is, when I reach a tile above then I can not move anywhere. If you come from the left, I can not move either up or down. If you reach the bottom, I can move to the left but not right. And when you reach the right I can move in any direction.

Honestly I have no idea what may be failing. I think it has to do with if (...), because if I change the order, the addresses where I can move change :/

Here I leave some code:

boolean collision = false;

if(Keyboard.isKeyDown(Keyboard.KEY_UP)) {
	for(int i = 0; i < map.GetNumLayers(); i++) {
		if(UpTile(map, i) > 128) {
			collision = true;
		}
	}
	
	if(!collision) AddPos(0.0f, -vel);
}
if(Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
	for(int i = 0; i < map.GetNumLayers(); i++) {
		if(LeftTile(map, i) > 128) {
			collision = true;
		}
	}
	
	if(!collision) AddPos(-vel, 0.0f);
}
if(Keyboard.isKeyDown(Keyboard.KEY_DOWN)) {
	for(int i = 0; i < map.GetNumLayers(); i++) {
		if(DownTile(map, i) > 128) {
			collision = true;
		}
	}
	
	if(!collision) AddPos(0.0f, vel);
}
if(Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
	for(int i = 0; i < map.GetNumLayers(); i++) {
		if(RightTile(map, i) > 128) {
			collision = true;
		}
	}
	
	if(!collision) AddPos(vel, 0.0f);
}

Thanks!

Custom Effects or Shaders

10 February 2011 - 05:07 AM

Hi,

I would like to know if we need to understand how to create custom effects right now, as explained in the tutorials 2-4, because I don't understand it very well, and I see that in the book are treated much later.

Thanks.

[web] Starting a webpage

03 February 2011 - 09:13 AM

Hi,

I have contracted a host with a friend to upload our projects and write some tutorials about game development. The problem is, we don't have any idea about website design... well, we know something of PHP and MySQL, but not enough to create a complete website. So, we have been thinking about using a CMS but I don't know which of them use... Any help?

Thanks.

Checking performance?

30 January 2011 - 01:41 PM

Hi,

In Chapter 4 Sams talks about things like "Objects Moved by Compactor" and others. I would like to know how to find these data debugging from Windows, because from the Visual Studio and by Starting Performance Analysis I only get cpu usage, but I would like to know how memory usage varies and what are the causes.

Thanks.

PARTNERS