I may be doing this all wrong, so forgive me, but I'm trying to use this library to make a labyrinth. I found a maze engine adaptation
. This is also on WP8, as I managed to get PHZ to work. I'm adding lines programmatically using the maze engine. There's a draw line method that uses something that only works on WP7. Instead I'm doing using the UCBLock control and doing it the way
the advanced demo does. The maze engine just dictates how to position the block, (which ends up being thin like a line).
double thickness = 4.0;
double width = x2 - x1 + thickness;
if (width == 0.0) width = thickness;
double height = y2 - y1 + thickness;
if (height == 0.0) height = thickness;
ucBlock block = new ucBlock();
block.Width = width;
block.Height = height;
block.blockInnerRectangle.Height = height;
block.blockInnerRectangle.Width = width;
cnvGame.AddPhysicsUserControl(block, x1, y1, 0);
This works very well and renders a nice maze consisting of physics user controls that are static. Next, I add a ball by instantiating a user control ball. Here's the ball markup
<Canvas x:Name="LayoutRoot" Width="55" Height="55">
<ph:PhysicsSprite x:Name="ball" RestitutionCoefficient=".4" CollisionGroup="1"
Width="55" Height="55" ShapeType="Ellipse">
<Ellipse Width="55" Height="55" Fill="LightYellow"/>
Again, the maze engine dictates where the ball will go
Ball ball = new Ball();
ball.Name = "ball";
cnvGame.AddPhysicsUserControl(ball, ((cols / 2) + 0.5) * cellWidth, 0, 1);
I plugged in the Accelerometer and update the world when it changes. So far so good, everything works, with a couple exceptions. Then the game first starts, and the ball drops, sometimes it hits the "lines" and sticks. It doesn't bounce off or roll.
It seems if I keep turning the accelerometer and never allow the ball to stop being in motion, it doesn't stick. When it sticks, the initial contact fires the collision event, but after that there are none. The ball has a collision group of 1 and the blocks
0. I know this is pretty far out there but any help would be appreciated. Thanks!