Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Form1_Load(object sender, EventArgs e)
- {
- shootP = new PictureBox();
- shootP.Image = Properties.Resources.shoot_1;
- shootP.SizeMode = PictureBoxSizeMode.Zoom;
- shootP.Size = new Size(10, 72);
- ListShoot = new List<PictureBox>();
- int i = -1;
- }
- private void Form1_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Space)
- {
- control = false;
- shootP = new PictureBox();
- shootP.Image = Properties.Resources.shoot_1;
- shootP.SizeMode = PictureBoxSizeMode.Zoom;
- shootP.Size = new Size(10, 72);
- ListShoot.Add(shootP);
- timeShoot.Start();
- }
- }
- private void timeShoot_Tick(object sender, EventArgs e)
- {
- if (control == false)
- {
- foreach PictureBox shot in ListShot
- {
- shot.Location = new Point(spacecraft._imageBox.Location.X + 50, spacecraft._imageBox.Location.Y - 55); // align the shoot with spacecraft
- shot.Top -= 40;
- }
- control = true;
- }
- }
- foreach PictureBox shot in ListShoot
- {
- draw(shot);
- }
- shootP = new PictureBox();
- shootP.Image = Properties.Resources.shoot_1;
- shootP.SizeMode = PictureBoxSizeMode.Zoom;
- shootP.Size = new Size(10, 72);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement