Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Soft Shell Crab
Apr 12, 2006

Fellow goons.. I probably should be posting this to some specific processing/box2d forum because this is pretty specific problem but I rather try here first because why not.

I started programming game prototype to see if an idea I had sometime has any legs. I chose Processing because I haven't programmed anything in nearly ten years so I'm basically at the beginner level. I'm also using Fisica wrapper for box2d.

I'm moving a ball (or a circle) body with a rectangle body by using a mouse. Basically pong but you can move the rectangle around freely and the ball has big mass so you can really push it around. I need to be able to pass the rectangle through the circle while pressing a mouse button and I've done this by making the rectangle a sensor when mouse is pressed.

All of this works fine but the problem arises when I make the rectangle a sensor WHILE moving the ball. When the collision is happening. It seems that for some reason the now sensor rectangle doesn't pass through the ball until the collision is over. It just keeps pushing the ball even though isSensor() function is telling the rectangle is a sensor and I've given it different color also to tell it's a sensor. I don't know where the problem is or what can be done. Could this be a bug/feature in fisica or box2d? Maybe there is a better way to do this? Maybe I can destroy the body or something? This is is pretty critical function in the game so I have to come up with something.

Adbot
ADBOT LOVES YOU

  • Locked thread