C sharp - La culebrita en Visual studio 2012

 
Vista:
sin imagen de perfil

La culebrita en Visual studio 2012

Publicado por Jesus (3 intervenciones) el 14/10/2014 07:31:08
Buenas un cordial saludo solicito sugerencia sobre mi proyecto en Visual Studio 2012 C sharp.

La culebrita o Snake Game.

¿Como hacer que la serpiente crezca?
¿Como hacer que al crecer la serpiente siga a la cabeza (el primer label1 antes de comer)?

La serpiente es el label1("Q") y la fruta es el label2("O").
¿Como podría hacer para que cuando label1 pase por el label2 se le agregue otra "Q" y que el label1 crezca?

Al comer una fruta el jugador gana 100 puntos
¿Como hacer que se vallan sumando los puntos en el listbox.1 ya creado?

Este es mi código de lo que llevo realizado:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
 
 
namespace SnakeGame
{
    public partial class Form1 : Form
    {
 
 
        public Form1()
        {
            InitializeComponent();
            listBox2.Visible = false;
            button7.Visible = false;
 
        }
 
        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            timer2.Enabled = false;
            timer3.Enabled = false;
            timer4.Enabled = false;
 
        }
 
        private void timer1_Tick(object sender, EventArgs e)
        {
            label1.Location = new Point(label1.Location.X - 5, label1.Location.Y);
            if (label1.Location.X <= -3)
            {
                timer1.Enabled = false;
            }
 
 
        }
 
        private void button2_Click(object sender, EventArgs e)
        {
            timer1.Enabled = false;
            timer2.Enabled = true;
            timer3.Enabled = false;
            timer4.Enabled = false;
        }
 
        private void timer2_Tick(object sender, EventArgs e)
        {
            label1.Location = new Point(label1.Location.X, label1.Location.Y - 5);
            if (label1.Location.Y <= -3)
            {
                timer2.Enabled = false;
            }
 
        }
 
        private void button3_Click(object sender, EventArgs e)
        {
            timer1.Enabled = false;
            timer2.Enabled = false;
            timer3.Enabled = true;
            timer4.Enabled = false;
        }
 
        private void timer3_Tick(object sender, EventArgs e)
        {
            label1.Location = new Point(label1.Location.X + 5, label1.Location.Y);
            if (label1.Location.X >= 787)
            {
                timer3.Enabled = false;
            }
        }
 
        private void button4_Click(object sender, EventArgs e)
        {
            timer1.Enabled = false;
            timer2.Enabled = false;
            timer3.Enabled = false;
            timer4.Enabled = true;
        }
 
        private void timer4_Tick(object sender, EventArgs e)
        {
            label1.Location = new Point(label1.Location.X, label1.Location.Y + 5);
            if (label1.Location.Y >=315)
            {
                timer4.Enabled = false;
            }
        }
 
        private void button5_Click(object sender, EventArgs e)
        {
            StreamWriter esc = new StreamWriter(@"C:\Users\Salazar\Desktop\Puntuaciones.txt");
            esc.WriteLine(textBox1.Text, listBox1.Text);
            esc.Close();
        }
 
        private void button6_Click(object sender, EventArgs e)
        {
            listBox2.Visible = true;
            button7.Visible = true;
            int counter = 0;
            string line;
            System.IO.StreamReader file = new System.IO.StreamReader(@"C:\Users\Salazar\Desktop\Puntuaciones.txt");
            while ((line = file.ReadLine()) != null)
            {
                listBox2.Items.Add(line);
                counter++;
            }
            file.Close();
 
        }
 
        private void button7_Click(object sender, EventArgs e)
        {
            listBox2.Visible = false;
            button7.Visible = false;
        }
 
        private void button8_Click(object sender, EventArgs e)
        {
            timer1.Enabled = false;
            timer2.Enabled = false;
            timer3.Enabled = false;
            timer4.Enabled = false;
        }
 
    }
}

Agradezco cualquier ayuda, sugerencia o critica respecto a mi proyecto.
Example
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder