Jump to content

  • Log In with Google      Sign In   
  • Create Account

#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