面向对象程序设计(C++)大作业

void CGameDlg::OnDown() { }

void CGameDlg::OnLeft() { }

void CGameDlg::OnRight() { }

void CGameDlg::OnUp() { }

void CGameDlg::MoveOn(int n) {

// TODO: Add your message handler code here and/or call default CDC *pDC=GetDC(); ASSERT(pDC!=NULL);

DeleteGroup(object);int b_x=object.x,b_y=object.y; switch(n) {

- -

15

if(!Runing)

return;

MoveOn(3);

ObjectGroup(object); KillTimer(11);

SetTimer(11, 10, NULL);

if(!Runing)

return;

MoveOn(4);

if(!Runing)

return;

MoveOn(2);

if(!Runing)

return;

MoveOn(1);

}

void CGameDlg::ClearUp() {

CDC *pDC=GetDC(); ASSERT(pDC!=NULL);

COLORREF color=RGB(233,230,214); CPen pen;

- -

16

case 1:

ChangeShape(object); ObjectGroup(object); break;

case 2:

object.x = object.x < M-1 ? object.x+1 : M-1; if(check1())

object.x=b_x;

ObjectGroup(object); break;

case 3:

object.y=object.y

case 4:

object.x=object.x>1?object.x-1:0;

if(check1())object.x=b_x; ObjectGroup(object); break;

case 5: }

Show(object); ReleaseDC(pDC);

object.y=object.y>1?object.y-1:0; if(check2())object.y=b_y; ObjectGroup(object); break;

//清空预备显示 地方

}

CBrush brush;

pen.CreatePen(PS_SOLID,1,color); brush.CreateSolidBrush (color); pDC->SelectObject(pe

>>鐏炴洖绱戦崗銊︽瀮<<
12@gma联系客服:779662525#qq.com(#替换为@)