Warning: Declaration of thesis_comment::start_lvl(&$output, $depth, $args) should be compatible with Walker::start_lvl(&$output, $depth = 0, $args = Array) in /nfs/c03/h01/mnt/50298/domains/gamedev.michaeljameswilliams.com/html/wp-content/themes/thesis_18/lib/classes/comments.php on line 0

Warning: Declaration of thesis_comment::end_lvl(&$output, $depth, $args) should be compatible with Walker::end_lvl(&$output, $depth = 0, $args = Array) in /nfs/c03/h01/mnt/50298/domains/gamedev.michaeljameswilliams.com/html/wp-content/themes/thesis_18/lib/classes/comments.php on line 0

Warning: Declaration of thesis_comment::start_el(&$output, $comment, $depth, $args) should be compatible with Walker::start_el(&$output, $object, $depth = 0, $args = Array, $current_object_id = 0) in /nfs/c03/h01/mnt/50298/domains/gamedev.michaeljameswilliams.com/html/wp-content/themes/thesis_18/lib/classes/comments.php on line 0

Warning: Declaration of thesis_comment::end_el(&$output, $comment, $depth, $args) should be compatible with Walker::end_el(&$output, $object, $depth = 0, $args = Array) in /nfs/c03/h01/mnt/50298/domains/gamedev.michaeljameswilliams.com/html/wp-content/themes/thesis_18/lib/classes/comments.php on line 0
Avoider Game — Part 10 — Michael James Williams

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.