コード例 #1
0
        public override void Init()
        {
            speed         = 180;
            CCommon.Score = 0;
            snake         = new CHero("snake", 2, 3);
            foodx         = 8;
            foody         = 8;
            food_b        = false;
            go            = new CGameOutput(35, 15);
            //设置图素
            go.SetPixel(" ◆¤●★○▼▲");
            //创建图片
            CBmp bmp1 = new CBmp();
            CBmp bmp2 = new CBmp();
            CBmp bmp3 = new CBmp();
            CBmp bmp4 = new CBmp();

            //设置图片数据
            bmp1.SetBmpData(1, 1, 2);
            bmp2.SetBmpData(1, 1, 3);
            bmp3.SetBmpData(1, 1, 4);
            bmp4.SetBmpData(1, 1, 5);
            //加载图片
            go.LoadBmp("头", bmp1);
            go.LoadBmp("身1", bmp2);
            go.LoadBmp("星", bmp3);
            go.LoadBmp("身2", bmp4);
            //游戏运行
            GameState = 2;
            Console.Clear();
        }
コード例 #2
0
        public override void Init()
        {
            m_icon    = 1;
            GameState = 1;
            go        = new CGameOutput(35, 15);
            //设置图素
            go.SetPixel(" ¤●○开始游戏皮排行");
            //创建图片
            CBmp bmp1 = new CBmp();
            CBmp bmp2 = new CBmp();
            CBmp bmp3 = new CBmp();
            CBmp bmp4 = new CBmp();

            //设置图片数据
            bmp1.SetBmpData(5, 1, 1, 2, 3, 2, 3);
            bmp2.SetBmpData(5, 1, 3, 2, 3, 2, 1);
            bmp3.SetBmpData(4, 1, 4, 5, 6, 7);
            bmp4.SetBmpData(4, 1, 8, 8, 9, 10);
            //加载图片
            go.LoadBmp("头左", bmp1);
            go.LoadBmp("头右", bmp2);
            go.LoadBmp("开始", bmp3);
            go.LoadBmp("排行", bmp4);
            m_x       = 2;
            m_y       = 7;
            m_dir     = 1;
            m_id      = "头右";
            GameState = 2;
        }