Box2D Forums

It is currently Sat May 25, 2013 6:28 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sat Feb 11, 2012 7:11 am 
Offline

Joined: Mon Jan 23, 2012 2:58 pm
Posts: 4
Hi

I have a weird problem, I'm building a platformer and I have been doing fine, I'm using a modified scroller class but the modifications I've made have just been so that the scroller doesn't follow him up until he's up to a certain height and such.

Now the problem is that I've built an Enemy class which are just guys that walk around doing nothing at the moment. I wanted to make a sensor like box which would be in the same position as the Enemy but longer. And when the sensor touches the player it reports a contact and the Enemy will then stop walking and run towards the player, pick him up and throw him away.

Anyway, so the problem is that when I add this shapes.Box to the stage the scroller stops scrolling, I don't know what is messing things up. I have alot of other shapes.Box around and they don't mess with the scroller at all. I have tried changing the type, I made it as a sensor etc. etc. this is the code for NPC_sensor as it is:

Code:
public class NPC_sensor extends Box
   {
      
      public function NPC_sensor()
      {
         type = "Static";
         isSensor = true;
         isGuideShape = true;
      }
      
   }


very basic, I don't understand why it is affecting the scroller? Does anybody have any ideas why this is happening or a better way to make a sensor which acts like the "view" of an NPC?


Top
 Profile  
 
PostPosted: Sun Feb 12, 2012 12:41 pm 
Offline

Joined: Mon Jan 23, 2012 2:58 pm
Posts: 4
are these forums dead?


Top
 Profile  
 
PostPosted: Mon Feb 13, 2012 2:27 pm 
Offline

Joined: Fri Dec 14, 2007 8:07 pm
Posts: 913
I think I would have to see the modifications you've made or some more of your other code to really figure out what's going on. There's no reason just adding a certain shape would break the scrolling functionality. Maybe check the "focus" property of the World to see if it's still pointing to the player?

I usually check the forums every couple of days & respond.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group