Tuesday, January 29, 2008

WATCH THE DUCK

I’ve started construction on my Flash game, re-designing some of the visuals and implementing the basic action of the ponds primary inhabitant… the DUCK!

To keep the duck moving with-in a boxed off area I have used the HitTest technique as discussed and illustrated in a previous post below.
(Thanks for the help of with this DD)

There is an issue, a small bug which has generated a game of its own… WATCH THE DUCK! It's a riveting game i promise you. The duck in the current version (below) sometimes escapes his invisible boxed off area and just fly’s away, right off the screen, cheeky bastard! Guess its natural for ducks to do that though… even in the virtual world so it would seem. Not a major issue though, nothing an extra wall or two wont fix.

Click the image below…

2 comments:

Adam said...

actually id be willing to bet he goes off when he hits the corner of the box - the hit test activates on both sides trying to send him in opposing directions so instead he just keeps his forward momentum off the screen :P

Gav Cooper said...

The duck always escapes through the top wall, so it looks like he takes to skies in a bid for freedom. It’s only if the duck hits a precise angle from the bottom wall, heading upwards… he always gets out.

So… I was thinking of setting up another invisible perimeter around the very edge of the 800x 600x game screen and if the duck breaks free he’ll hit this extra boxed-in area… then that event could trigger a game over screen or even just re-spawn the duck back in it’s pond.

That’s another possible solution…