⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yzmf.h

📁 模仿益智游戏
💻 H
字号:
void dealKey(HWND hWnd, HDC hDC, HGLRC hRC, int wParam)
{
  switch (wParam)
  {
  case 27:                 //ESC
    exitGame(hWnd,hDC,hRC);
    break;
  case 113:               //q :注意区分大小写,下同
    if (rotateOK==1)
        return;
    rotateType=1;
    rotateOK=1;
    rotate=0.0f;
    break;
  case 119: //w
    if (rotateOK==1)
        return;
    rotateType=2;
    rotateOK=1;
    rotate=0.0f;
    break;
  case 101: //e
    if (rotateOK==1)
        return;
    rotateType=3;
    rotateOK=1;
    rotate=0.0f;
    break;
  case 114: //r
    if (rotateOK==1)
        return;
    rotateType=4;
    rotateOK=1;
    rotate=0.0f;
    break;
  case 116: //t
    if (rotateOK==1)
        return;
    rotateType=5;
    rotateOK=1;
    rotate=0.0f;
    break;
  case 121: //y
    if (rotateOK==1)
        return;
    rotateType=6;
    rotateOK=1;
    rotate=0.0f;
    break;
  case 97: //a
    if (rotateOK==1)
        return;
    rotateType=7;
    rotateOK=1;
    rotate=0.0f;
    break;
  case 115: //s
    if (rotateOK==1)
        return;
    rotateType=8;
    rotateOK=1;
    rotate=0.0f;
    break;
  case 100: //d
    if (rotateOK==1)
        return;
    rotateType=9;
    rotateOK=1;
    rotate=0.0f;
    break;
  case 102: //f
    if (rotateOK==1)
        return;
    rotateType=10;
    rotateOK=1;
    rotate=0.0f;
    break;
  case 103: //g
    if (rotateOK==1)
        return;
    rotateType=11;
    rotateOK=1;
    rotate=0.0f;
    break;
  case 104: //h
    if (rotateOK==1)
        return;
    rotateType=12;
    rotateOK=1;
    rotate=0.0f;
    break;
  case VK_UP:           //向上
    xRot-= 5.0f;
    break;
  case VK_DOWN:             //向下
    xRot += 5.0f;
    break;
  case VK_LEFT:             //向左
    yRot -= 5.0f;
    break;
  case VK_RIGHT:             //向右
    yRot += 5.0f;
    break;
  }
  if(xRot > 356.0f)
    xRot = 0.0f;

  if(xRot < -1.0f)
    xRot = 355.0f;

  if(yRot > 356.0f)
    yRot = 0.0f;

  if(yRot < -1.0f)
    yRot = 355.0f;
} 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -