我要编一个猎人捕捉猎物的程序!
一个9*9的方格,里面随机的有四个猎人,一个猎物,每个猎人(物)占一个格子.请问如何编一个界面啊??
怎么样实现一个9*9的方格,又怎么样实现猎物和猎人的移动???
急!!!!!
请教各位大虾!!!拜托了!!!!!

解决方案 »

  1.   

    http://www.vckbase.com/code/listcode.asp?mclsid=7&sclsid=721有几个简单游戏代码。参考参考
      

  2.   

    First, You can write a function to draw the grid, such as:/*
    pDC : the Device context of the window on which you want to draw the grids.nGridPerRow : the num of grids in one row.
    */
    void DrawGrid(CDC *pDC, int nGridPerRow)
    {
       //I think it's very easy to draw the grids, isnt it?
       ... ...
       ... ...
    }Second:
    Draw icons or bitmaps by resource editer for hunters and quarries.
    When you want to move a hunter from grid A to Grid B, just draw the hunter at the position of Grid B instead of Grid A.