howdy folks,
i really like using nape. digging in much further into it. but sensors are really bugging me in many ways to get going.
ive followed everything that i can think of, even going to interacts, but those spit out WAY to many messages for what i need, i just need a single message to say that something has been touched/collided/sensed. collision has worked perfect, got that down, but sensing is something WAY diferent
i have tried to follow everything i can on this forum & stuff online, but am either getting lost in how people are discribing things or the implimintation of things. i doesnt help being disclecsic ;)
so some things that are spoken about, im having a bit of trouble actually understanding
but this is what i currently have right now. help would be really... errr... helpful ;)
im using haxe by the by if you were wondering, not as3. ive checked as3 demos but am coming up dry for sensors
class Project {
var goal:Goal;
var space:Space;
var ball:Ball;
var listener:InteractionListener;
var goalSensorCollisionType:CbType = new CbType();
var ballCollisionType:CbType = new CbType();
public function new() {
space = new Space();
goal = new Goal(space, 300, 300);
ball = new Ball(space);
listener = new InteractionListener(CbEvent.BEGIN, InteractionType.SENSOR, goalSensorCollisionType, ballCollisionType, collideGoal);
ball.body.cbTypes.add(ballCollisionType);
goal.goalFloor.body.cbTypes.add(goalSensorCollisionType);
space.listeners.add(listener);
}
public function collideGoal(callback:InteractionCallback){
trace('BLAHHH');
}
}
& inside the goal i am using a goal sensor to call up which has this set inside it
shape = new Polygon(Polygon.box(width, height));
shape.sensorEnabled = true;
thanks if someone can point me in the right direction. as its just beginning to go round in circles now