1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
void roam_about()
{
if (up == true)
{
down = false,left = false, right = false;
apply_surface(start_pos_x,start_pos_y = start_pos_y-1,bunnysheet,screen,&clips[upclips]);
upclips++;
roamtime++;
if(upclips >= 3){upclips = 0;}
if(roamtime == 5){up = false; roamtime = 0; new_direction();}
}
if (down == true)
{
up = false, left = false, right = false;
apply_surface(start_pos_x,start_pos_y = start_pos_y+1,bunnysheet,screen,&clips[downclips]);
downclips++;
roamtime++;
if(downclips >= 6){downclips = 3;}
if(roamtime == 5){down = false; roamtime = 0; new_direction();}
}
if (left == true)
{
up = false, down = false, right = false;
apply_surface(start_pos_x = start_pos_x-1,start_pos_y = start_pos_y,bunnysheet,screen,&clips[leftclips]);
leftclips++;
roamtime++;
if(leftclips >= 9){leftclips = 6;}
if(roamtime == 5){left = false; roamtime = 0; new_direction();}
}
if (right == true)
{
up = false, down = false, left = false;
apply_surface(start_pos_x = start_pos_x -1,start_pos_y = start_pos_y,bunnysheet,screen,&clips[rightclips]);
rightclips++;
roamtime++;
if(rightclips >= 12){rightclips = 9;}
if(roamtime == 5){right = false; roamtime = 0; new_direction();}
}
else
new_direction();
}
};
|