c#编的部分植物大战僵尸代码 下载本文

k.mWandou = k.a; }

k.wandou.Location = this.PointToClient(new Point(k.mWandou, k.nWandou));

if (listJiangshi4.Count > 0) {

if ((k.mWandou >= (listJiangshi4[0].mjiangshi - listJiangshi4[0].move)) && (k.mWandou <= (listJiangshi4[0].mjiangshi - listJiangshi4[0].move + 20))) {

k.mWandou = a;

listJiangshi4[0].life--;

this.label5.Text = listJiangshi4[0].life.ToString();

spattack4 = new SoundPlayer(Properties.Resources.被豌豆打击); spattack4.Play();

if (listJiangshi4[0].life <= 0) {

// listJiangshi[0]应该销毁picture对象 listJiangshi4.Remove(listJiangshi4[0]);

spattack4 = new SoundPlayer(Properties.Resources.僵尸死了); spattack4.Play(); } } }

if (listJiangshi4.Count == 0) {

timerWandou4.Enabled = false; } }

if (listJiangshi4.Count > 0) {

bool bo = (listJiangshi4[0].picJiangshi.Location.X < this.Location.X); if (bo) {

Program.isValidUser1 = true; timerWandou.Enabled = false; timerWandou1.Enabled = false; timerWandou2.Enabled = false; timerWandou3.Enabled = false; timerWandou4.Enabled = false; this.Close(); } } }

private void pictureBox1_Click(object sender, EventArgs e) {

this.Close(); }

private void timer1_Tick(object sender, EventArgs e) {

if ((!timerWandou.Enabled) && (!timerWandou1.Enabled) (!timerWandou2.Enabled) && (!timerWandou3.Enabled) && (!timerWandou4.Enabled)) &&

} } }

{

Program.isValidUser2 = true; timer1.Enabled = false; this.Close(); }