I am new to this and thought I would try my hand at pinball to help develop my knowledge but I can not get the flipper to move. (its been a steep cleaning curve but fun and frustrating at times)
I have set up a revolute joint in init function:
leftflip = new Box2D.Dynamics.Joints.b2RevoluteJointDef();
leftflip.Initialize(lflip, lflipball, lflipball.GetWorldCenter());
leftflip.upperAngle = 0.6;
leftflip.lowerAngle = -0.6;
leftflip.enableLimit = true;
leftflip.maxMotorTorque = 700.0;
leftflip.motorSpeed = 0;
leftflip.enableMotor = true;
leftflipper = physics.world.CreateJoint(leftflip);
I have tested the joint and it does move when things bounce off of it but I can not make it move when I want it to move using:
leftflipper.SetMotorSpeed = flipl; (located in the gameloop function)
flipl is a variable that would contain a value to rotate the paddle up or down depending on the keypress, the key press is being sense but the flipper does not move.
Can someone help me be a happy camper again and advice on what I am doing wrong....
I have set up a revolute joint in init function:
leftflip = new Box2D.Dynamics.Joints.b2RevoluteJointDef();
leftflip.Initialize(lflip, lflipball, lflipball.GetWorldCenter());
leftflip.upperAngle = 0.6;
leftflip.lowerAngle = -0.6;
leftflip.enableLimit = true;
leftflip.maxMotorTorque = 700.0;
leftflip.motorSpeed = 0;
leftflip.enableMotor = true;
leftflipper = physics.world.CreateJoint(leftflip);
I have tested the joint and it does move when things bounce off of it but I can not make it move when I want it to move using:
leftflipper.SetMotorSpeed = flipl; (located in the gameloop function)
flipl is a variable that would contain a value to rotate the paddle up or down depending on the keypress, the key press is being sense but the flipper does not move.
Can someone help me be a happy camper again and advice on what I am doing wrong....