Hello,
could you explain me why in my code it does not work when I put the ball with the mouse inside red road path.
http://pasteboard.co/BtiWYXE.png
I think it 'thinks' that the space inside red is not empty and pushes the ball out. What could I do?
http://images.thumbshots.com/image.aspx?cid=1162&v=1&w=300&url=http://www.html5canvastutorials.com/labs/html5-canvas-physics-engine-with-curve-detection/
I was making this from example:
http://www.html5canvastutorials.com/labs/html5-canvas-physics-engine-with-curve-detection/
You can copy the code from here to run the example:
and shorter version:
var curve = new Kinetic.Line({ //578*400 (x * y)
points: [153, 200, 340, 250, //down
340, 270, //short to bottom
153, 290, //back to left
153, 320, //short to bottom
390, 290, //to the right long
390, 220, //up short
153, 140, //long to the left
153, 200 //short to bottom
],
stroke: "red",
strokeWidth: 5,
lineCap: "round",
lineJoin: "round"
});
So this ball has to ride inside the red area. How do I make this?