Skip to content

Instantly share code, notes, and snippets.

@MarianoGnu
Created April 6, 2014 21:05
Show Gist options
  • Select an option

  • Save MarianoGnu/10011463 to your computer and use it in GitHub Desktop.

Select an option

Save MarianoGnu/10011463 to your computer and use it in GitHub Desktop.
while (!jump_end_found)
{
//CODE
const RPG::MoveCommand& move_command = active_route->move_commands[active_route_index];
switch (move_command.command_id) {
case RPG::MoveCommand::Code::move_up:
dest_y--;
break;
case RPG::MoveCommand::Code::move_right:
dest_x++;
break;
case RPG::MoveCommand::Code::move_down:
dest_y++;
break;
case RPG::MoveCommand::Code::move_left:
dest_x--;
break;
case RPG::MoveCommand::Code::move_upright:
dest_x++;
dest_y--;
break;
case RPG::MoveCommand::Code::move_downright:
dest_x++;
dest_y++;
break;
case RPG::MoveCommand::Code::move_downleft:
dest_x--;
dest_y++;
break;
case RPG::MoveCommand::Code::move_upleft:
dest_x--;
dest_y--;
break;
case RPG::MoveCommand::Code::move_random:
switch (rand() % 5)
{
case 0:
dest_x++;
break;
case 1:
dest_x--;
break;
case 2:
dest_y++;
break;
case 3:
dest_y--;
break;
/*default: dont move*/
}
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment