Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actualwarnexus

Posted 12 April 2013 - 01:05 PM

You should be able to treat the Rectangle object like a data member(C++)/instance variable(Java) of the Wall class.

 

In Java, it would look like this:

 

public class Wall{

 

private Rectangle rectangle;

 

}

 

In your case, it would look similar to this:

 

public class Tiles{

 

private Rectangle rectangle;

}

 

 

The idea I have is that you can test for collision when the character is close to object it is not suppose to be able to over-lap. That would make the code less expensive.


#2warnexus

Posted 12 April 2013 - 01:02 PM

You should be able to treat the Rectangle object like a data member(C++)/instance variable(Java) of the Wall class.

 

In Java, it would look like this:

 

public class Wall{

 

private Rectangle rectangle;

 

}

 

The idea I have is that you can test for collision when the character is close to object it is not suppose to be able to over-lap. That would make the code less expensive.


#1warnexus

Posted 12 April 2013 - 01:00 PM

You should be able to treat the Rectangle object like a data member(C++)/instance variable(Java) of the Wall class.

 

In Java, it would look like this:

 

public class Wall{

 

private Rectangle rectangle;

 

}


PARTNERS