Flappy.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using FlappyBird.Code;

namespace FlappyBird
{
    public partial class Flappy : Form
    {
        public Flappy()
        {
            InitializeComponent();
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.
            SetStyle(ControlStyles.DoubleBuffer, true); // 双缓冲
            UpdateStyles();
        }
        Game game = new Game();
        private void Flappy_Paint(object sender, PaintEventArgs e)
        {
            game.Draw(e.Graphics);
        }
        // 下载于www.51aspx.com
        private void timer1_Tick(object sender, EventArgs e)
        {
            this.Refresh();
        }

        private void Flappy_Click(object sender, EventArgs e)
        {
            game.Touch();
        }

        private void Flappy_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Space)
            {
                game.Touch();
            }
        }
        // 下载于www.51aspx.com
        private void Flappy_FormClosed(object sender, FormClosedEventArgs e)
        {
            Environment.Exit(0);
        }



    }
}

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

AI 解读 AI

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

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