Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Alejandro

Member Since 30 Jan 2011
Offline Last Active Nov 28 2013 08:49 PM

Posts I've Made

In Topic: Collision Detection

09 June 2013 - 03:10 PM

struct Rect
{
	float x, y;
	float w, h;

	// true means there's a collision
	bool checkCollision(Ball & ball)
	{
		return ball.x > x && ball.x < x + w &&  ball.y > y && ball < y + w
	}
};

struct Ball
{
	float x, y;
	float w, h;
	float dir_x, dir_y;
};

Rect paddle;
Ball ball;

void display(void)
{
	if(paddle.checkCollision(ball))
	{
		ball.dir_x *= -ball.dir_x;
	}
}

This may work :)


In Topic: Looking for an AI book about crowd behaviour

09 June 2013 - 02:52 PM

Movement behaviour is a common topic on any AI for games  book, you can check this oune out: http://books.google.com.mx/books/about/Artificial_intelligence_for_games.html?id=1OJ8EhvuPXAC&redir_esc=y


In Topic: Game Architecture/Design Pattern?

30 March 2013 - 01:08 PM

As i see, there's no best pattern... though I like to use managers since it's easier to me to read the code like this.


In Topic: Game Architecture/Design Pattern?

21 February 2013 - 12:32 AM

Thank you very mucho for all your comments, I liked the idea on Performance vs Maintainability, also because a lot of the code I do is also read by other team members so it's important to have maintanable code

 

I'll take a look at the Game Engine book

 

Until know there's no clear best one, it appears as everyone has different approaches, that's what I am searching, how people create the architecture of the code.

 

Does anyone has an example on how MVC pattern will work in a videogame? particulary on Unity blink.png


In Topic: Switching from 2D to 3D for drawing object

30 December 2011 - 02:08 PM

You could try using fbo's, here's a good tutorial with a working example

PARTNERS