Backup/Windowsbullet/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.Windows.Forms;
using Windowsbullet.BLL;
namespace Windowsbullet
{
public partial class Form1 : Form
{
Graphics g = null;
SolidBrush sb = new SolidBrush(Color.Red);
List<Bullet> bullets = new List<Bullet>();//子弹集合
int n = 30;
public Random rand;
Image image = null;
Hero hero = null;
int timer = 0;
//Student student = null;//测试三层使用
public Form1()
{
InitializeComponent();
this.DoubleBuffered = true;
}
private void Form1_Load(object sender, EventArgs e)
{
timer2.Start();
//student = new Student();
//this.Text=student.GetName(3);//测试三层使用
rand = new Random();
for (int i = 0; i < n; i++)
{
Bullet bullet = new Bullet(this.ClientSize.Width, this.ClientSize.Height, rand);
bullets.Add(bullet);
}
this.hero = new Hero();
image = Image.FromFile("hero.gif");
timer1.Start();
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
g = e.Graphics;
foreach (Bullet bullet in bullets)
{
g.FillEllipse(sb, bullet.x, bullet.y, bullet.width, bullet.height);
}
//画个飞机
g.DrawImage(image,
new Rectangle(hero.x, hero.y, hero.width, hero.height),
new Rectangle(0, 0, 300, 300),
GraphicsUnit.Pixel);
}
后面还有 92 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。