Game.cs
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Media;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Demogo
{/// <summary>
/// 游戏类
/// </summary>
class Game
{
private Point mapLeft;
//定义一个单元
private static int unit = 15;
//定义游戏大小
private readonly int length = 25 * unit;
private readonly int width = 25 * unit;
//定义分数
public int score = 0;
//调用蛇
public readonly Snake snake;
public delegate void GameChanged();
public Snake Snake
{
get
{
return snake;
}
}
//添加食物
Food food;
//布尔值“吃”
private bool eat;
//添加障碍物
private List<obstacle> obstacles { get; set; }
//障碍物坐标
private Point[] obstaclePoints =
{
new Point(0,15),
new Point(0,45),
new Point(0,75),
new Point(0,105),
new Point(0,135),
new Point(0,165),
new Point(0,195),
new Point(0,225),
new Point(0,255),
new Point(0,285),
new Point(0,315),
new Point(0,345),
new Point(0,375),
new Point(0,405),
后面还有 201 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。