lib/joybox/box2d/body.rb in joybox-0.0.3 vs lib/joybox/box2d/body.rb in joybox-0.0.4
- old
+ new
@@ -81,10 +81,13 @@
def apply_force(options = {})
options = options.nil? ? apply_force_defaults : apply_force_defaults.merge!(options)
- applyForce(options[:force],
+ # This line is needed to ensure that the force is a CGPoint
+ force = CGPointMake(options[:force][0], options[:force][1])
+
+ applyForce(force.to_pixel_coordinates,
atLocation: options[:location],
asImpulse: options[:as_impulse])
end
\ No newline at end of file