Form1.cs
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ClassicGame
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
Tetris.OnBitmapShowEvent += Tetris_OnBitmapShowEvent;
TimerInitialization();
}
private void Form1_Shown(object sender, EventArgs e)
{
SetImageShow(Tetris.GetRenderBitmap());
TetrisMini.MoveTeries.LocationDefault = new Point(0, 0);
Point[] points = Tetris.GetNewItemPoints();
TetrisMini.MoveTeries.SetPoint(points.ToArray());
SetImageMiniShow(TetrisMini.GetRenderBitmap());
}
private void Tetris_OnBitmapShowEvent(object sender, GameEventArgs e)
{
SetImageShow(e.RenderBitmap);
}
//size is about 252*420
TetrisEngine Tetris = new TetrisEngine(new Size(12, 20));
TetrisEngine TetrisMini = new TetrisEngine(new Size(4, 4));
private bool IsGameAccelerate { get; set; } = false;
private void SetImageShow(Bitmap bimap)
{
pictureBox1.Image?.Dispose();
pictureBox1.Image = bimap;
}
private void SetImageMiniShow(Bitmap bimap)
{
pictureBox2.Image?.Dispose();
pictureBox2.Image = bimap;
}
private void button1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Left)
后面还有 110 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。