TetrisEngine.cs

(开头部分) 15KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace ClassicGame
{
    /***************************************************************************
     * 
     *    copyright by Richard.Hu
     *    
     *    this class controls all the actions 
     *    
     *    [这个类控制整个系统运行的核心引擎]
     * 
     **************************************************************************/

    /**************************************************************************
     * 
     *    采用数据层加一个移动数据对象来实现整个俄罗斯方块的实现
     * 
     *    One layers of data and a mobile data objects are used to implement the whole tetris
     * 
     **************************************************************************/



    public class TetrisEngine : GameEngine
    {

        public override void Initialization(Size size)
        {
            base.Initialization(size);
            MoveTeries= new TetrisPoints(new Point[]
            {
                new Point(0,0),new Point(0,1),new Point(1,1),new Point(1,2)
            }, new Point(BoardSize.Width / 2 - 2, 20), BoardSize, OnMoveObjectSuccess);
        }
        public bool OnMoveObjectSuccess(Point[] points)
        {
            for (int i = 0; i < points.Length; i++)
            {
                if (points[i].X >= 0 && points[i].X < BoardSize.Width &&
                    points[i].Y >= 0 && points[i].Y < BoardSize.Height + 4)
                {
                    if (points[i].Y < BoardSize.Height)
                    {
                        if ((GameArrays[points[i].X, points[i].Y]).HasItem)
                        {
                            return false;
                        }
                    }
                }
                else
                {
                    return false;
后面还有 432 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。