Block.cs
上传用户:cljx11
上传日期:2022-08-09
资源大小:49k
文件大小:1k
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Drawing;
- namespace Snake_v2
- {
- class Block
- {
- public void SnakeBody(int x, int y, Graphics e)
- {
- e.FillRectangle(new SolidBrush(Color.Black), x * 10, y * 10+1, 9, 8);
- }
- public void Apple(int x, int y, Graphics e)
- {
- e.FillRectangle(new SolidBrush(Color.Black), x * 10 + 1, y * 10 + 1, 8, 8);
- e.FillRectangle(new SolidBrush(Color.White), x * 10 + 3, y * 10 + 3, 4, 4);
- }
- public void Stone(int x, int y, Graphics e)
- {
- e.FillRectangle(new SolidBrush(Color.Black), x * 10, y * 10, 10, 10);
- e.FillRectangle(new SolidBrush(Color.White), x * 10 + 1, y * 10 + 1, 8, 8);
- e.FillRectangle(new SolidBrush(Color.Black), x * 10 + 3, y * 10 + 3, 4, 4);
- }
- public void Clear(int x, int y, Graphics e)
- {
- e.FillRectangle(new SolidBrush(Color.LightSteelBlue), x * 10, y * 10, 10, 10);
- }
- }
- }