Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualEndurion

Posted 29 September 2012 - 10:53 PM

It looks like your current method brings some inprecision. Keep the precision intact.

Pseudocode:

while ( number_of_pixels_to_move > 0 )
{
if ( number_of_pixels_to_move >= pixels_left_to_move_on_one_tile )
{
// arrive at a tile
number_of_pixels_to_move -= pixels_left_to_move_on_one_tile;
move pixels_left_to_move_on_one_tile pixels in move direction
adjust direction according to tile below
}
else
{
// move object number_of_pixels_to_move pixels in move direction
number_of_pixels_to_move = 0;
}
}


Edit: The dumb editor keeps screwing up indentation

#4Endurion

Posted 29 September 2012 - 10:52 PM

It looks like your current method brings some inprecision. Keep the precision intact.

Pseudocode:

while ( number_of_pixels_to_move > 0 )
{
  if ( number_of_pixels_to_move >= pixels_left_to_move_on_one_tile )
  {
    // arrive at a tile
	number_of_pixels_to_move -= pixels_left_to_move_on_one_tile;
	move pixels_left_to_move_on_one_tile pixels in move direction
	adjust direction according to tile below
  }
  else
  {
	// move object number_of_pixels_to_move pixels in move direction
	number_of_pixels_to_move = 0;
  }
}

#3Endurion

Posted 29 September 2012 - 10:51 PM

It looks like your current method brings some inprecision. Keep the precision intact.

Pseudocode:

while ( number_of_pixels_to_move > 0 )
{
  if ( number_of_pixels_to_move >= pixels_left_to_move_on_one_tile )
  {
    // arrive at a tile
	number_of_pixels_to_move -= pixels_left_to_move_on_one_tile;
	// move pixels_left_to_move_on_one_tile pixels in move direction
	// adjust direction according to tile below
  }
  else
  {
    // move object number_of_pixels_to_move pixels in move direction
    number_of_pixels_to_move = 0;
  }
}

#2Endurion

Posted 29 September 2012 - 10:51 PM

It looks like your current method brings some inprecision. Keep the precision intact.

Pseudocode:

while ( number_of_pixels_to_move > 0 )
{
  if ( number_of_pixels_to_move >= pixels_left_to_move_on_one_tile )
  {
	// arrive at a tile
    number_of_pixels_to_move -= pixels_left_to_move_on_one_tile;
    // move pixels_left_to_move_on_one_tile pixels in move direction
    // adjust direction according to tile below
  }
  else
  {
	// move object number_of_pixels_to_move pixels in move direction
	number_of_pixels_to_move = 0;
  }
}

#1Endurion

Posted 29 September 2012 - 10:51 PM

It looks like your current method brings some inprecision. Keep the precision intact.

Pseudocode:

while ( number_of_pixels_to_move > 0 )
{
  if ( number_of_pixels_to_move >= pixels_left_to_move_on_one_tile )
  {
    // arrive at a tile
   number_of_pixels_to_move -= pixels_left_to_move_on_one_tile;
   // move pixels_left_to_move_on_one_tile pixels in move direction
   // adjust direction according to tile below
  }
  else
  {
    // move object number_of_pixels_to_move pixels in move direction
    number_of_pixels_to_move = 0;
  }
}

PARTNERS