Avoider Game — Part 10

6 comments

{ 6 comments… read them below or add one }

MichaelJWilliams March 10, 2009 at 11:37 pm

So as you can see, decent balancing of the game’s difficulty is extremely important and an area to which I have paid absolutely no attention :(

PoisonSky March 11, 2009 at 5:02 pm

Man! You can’t move your player diagonally!

MichaelJWilliams March 11, 2009 at 10:41 pm

Yeah, that’s from Part 7.

It’s not hard to alter though (I did leave it as a challenge :P ). The simplest way of doing so is by changing this:

if ( downKeyIsBeingPressed )
{
    avatar.moveABit( 0, 1 );
}
else if ( upKeyIsBeingPressed )
{
    avatar.moveABit( 0, -1 );
}
else if ( leftKeyIsBeingPressed )
{
    avatar.moveABit( -1, 0 );
}
else if ( rightKeyIsBeingPressed )
{
    avatar.moveABit( 1, 0 );
}

to this:

if ( downKeyIsBeingPressed )
{
    avatar.moveABit( 0, 1 );
}
else if ( upKeyIsBeingPressed )
{
    avatar.moveABit( 0, -1 );
}
if ( leftKeyIsBeingPressed )
{
    avatar.moveABit( -1, 0 );
}
else if ( rightKeyIsBeingPressed )
{
    avatar.moveABit( 1, 0 );
}

(Check the ifs/else-ifs carefully if you can’t see a change.) There’s more discussion in the comments of Part 7 itself.

John March 14, 2009 at 7:31 pm

You hero can hide from the incoming smileys, if he keeps pressing right. I have over 10k points and I’m not doing anything.

MichaelJWilliams March 14, 2009 at 7:36 pm

Yeah, I’ve found that pretty useful for testing though. It’s not hard to fix — check Part 7 for a hint.

us01 May 1, 2011 at 1:42 am

Just test your game up to this version… And fak, i got uber dejavu… I cant stand going through this time machine crap…

Leave a Comment

Writing code? Write <pre> at the start and </pre> at the end to keep it looking neat.

Anti-Spam Protection by WP-SpamFree