主题:急急求解->坦克为什么移动不顺畅??????
[em52]在编坦克游戏时遇到了坦克移动不顺畅的问题,每次换移动方向时坦克总要顿一顿再移动感觉很不爽,不知何故,为什么呢?怎么解决呢?
// 坦克Dlg.cpp :
void CMy2Dlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
switch (nChar)
{
case 'W':
fangwei=1;
move_ud-=1;
break;
case 'S':
fangwei=2;
move_ud+=1;
break;
case 'A':
fangwei=3;
move_lr-=1;
break;
case 'D':
fangwei=4;
move_lr+=1;
break;
default:
break;
}
//贴图类函数调用
bt.MapPicture(mapp ,move_lr ,move_ud ); //地图
bt.CarPicture(carp,fangwei,move_lr, move_ud); //坦克
dc.StretchB(0,0,rect.right,rect.bottom,bt.cdc1,0,0,256,240,SRCCOPY); // 帖到屏幕
CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
}
// 坦克Dlg.cpp :
void CMy2Dlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
switch (nChar)
{
case 'W':
fangwei=1;
move_ud-=1;
break;
case 'S':
fangwei=2;
move_ud+=1;
break;
case 'A':
fangwei=3;
move_lr-=1;
break;
case 'D':
fangwei=4;
move_lr+=1;
break;
default:
break;
}
//贴图类函数调用
bt.MapPicture(mapp ,move_lr ,move_ud ); //地图
bt.CarPicture(carp,fangwei,move_lr, move_ud); //坦克
dc.StretchB(0,0,rect.right,rect.bottom,bt.cdc1,0,0,256,240,SRCCOPY); // 帖到屏幕
CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
}