well I have converted pseudocode into c# but it still does not work, I will have to tweak it a little bit. here is the converted code
bool collision = false;
bool drawflag = true;
int killtimer = 10;
public void Form1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawImage(ship, 350 + x, 530);
e.Graphics.DrawImage(bullet, 375 + x, 520 + y);
e.Graphics.DrawImage(bug_one, 120, 0);
e.Graphics.DrawImage(bug_one, 180, 0);
e.Graphics.DrawImage(bug_one, 240, 0);
// e.Graphics.DrawImage(bug_one, 300, 0);
// e.Graphics.DrawImage(bug_one, 360, 0);
e.Graphics.DrawImage(bug_one, 420, 0);
e.Graphics.DrawImage(bug_one, 480, 0);
e.Graphics.DrawImage(bug_one, 540, 0);
e.Graphics.DrawImage(bug_one, 600, 0);
if (y <= -510 && x >= -15 && x <= 15)
{
drawflag = false;
collision = true;
killtimer = 1;
}
if (y <= -510 && x >= -75 && x <= -45)
{
drawflag = false;
collision = true;
killtimer = 1;
}
if(collision==true)
{
e.Graphics.DrawImage(coll, 360, 0);
}
else if(drawflag==true)
{
e.Graphics.DrawImage(bug_one, 360, 0);
}
if (collision == true)
{
e.Graphics.DrawImage(coll, 300, 0);
}
else if (drawflag == true)
{
e.Graphics.DrawImage(bug_one, 300, 0);
}
}
public void timer1_Tick(object sender, EventArgs e)
{
y -= 5;
Invalidate();
}
public void timer2_Tick(object sender, EventArgs e)
{
if(killtimer>0)
{
killtimer--;
}
if(killtimer <=0)
{
collision = false;
}
Invalidate();
}