Форум программистов, компьютерный форум, киберфорум
Java SE (J2SE)
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.94/18: Рейтинг темы: голосов - 18, средняя оценка - 4.94
0 / 0 / 1
Регистрация: 09.11.2013
Сообщений: 26

MVC (Змейка)

09.11.2013, 14:18. Показов 3337. Ответов 2
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Здравствуйте, пытаюсь сделать змейку(Точнее просто змейку уже сделал) нужно переделать ее под MVC
Пытаюсь разнести все в модель и контролер и вьюху, но сразу же сталкиваюсь с большими проблемами, не понимаю как использовать не прорисовывая(к примеру в одном классе) и например не добавляется слушатель кнопок(((

Java
1
2
3
4
5
6
7
8
public class Main {
    
    
    public static void main(String[] args) {
        new Snake();
    }
 
}
Java
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
 
 
import java.util.*;
 
class Snake extends JFrame implements KeyListener, Runnable {
 
    private JPanel p1, p2;
    private JButton[] body = new JButton[200];
    private JButton bonusfood;
    private JTextArea sc;
 
    
   private  Point bfp = new Point();
 
    private int x = 500, y = 300, gu = 3, directionx = 0, directiony = 0, speed = 100, score = 0;
    private int[] bx = new int[300];
    private int[] by = new int[300];
    private  Point[] bodyp = new Point[300];
    //private Point bfp = new Point();
    private Thread myt;
    private boolean food = false, runl = false, runr = true, runu = true, rund = true;
    private  Random r = new Random();
    private JMenuBar mybar;
    private JMenu game, help;
 
    public void initializeValues() {
        gu = 3;
        by[0] = 100;
        bx[0] = 150;
        directionx = 10;
        directiony = 0;
       
        score = 0;
        food = false;
        runl = false;
        runr = true;
        runu = true;
        rund = true;
      
    }
 
    Snake() {
        super("Snake: PSU edition");
        setBounds(200, 200, 506, 380);
        creatbar();
        initializeValues();
        // GUI панельки 
        p1 = new JPanel();
        p2 = new JPanel();
        // Текстовое поле очков
        setResizable(false);
        sc = new JTextArea("Scores : " + score);
        sc.setEnabled(false);
        sc.setBounds(400, 400, 100, 100);
       sc.setBackground(Color.black);
        // Змея ест и ростет
        bonusfood = new JButton();
        bonusfood.setEnabled(false);
        // Создаем начальную 3-ех кнопочную змею
        createFirstSnake();
 
        p1.setLayout(null);
        p2.setLayout(new GridLayout(0, 1));
        p1.setBounds(0, 0, x, y);
        p1.setBackground(Color.blue);
        p2.setBounds(0, y, x, 30);
        p2.setBackground(Color.black);
 
        p2.add(sc); // will contain score board
        // end of UI design
        getContentPane().setLayout(null);
        getContentPane().add(p1);
        getContentPane().add(p2);
        show();
        setDefaultCloseOperation(EXIT_ON_CLOSE);
 
        addKeyListener(this);
       
        myt = new Thread(this);
        myt.start(); 
    }
//Создаем начальную змейку(из 3 кнопок)
    public void createFirstSnake() {
      
        for (int i = 0; i < 3; i++) {
            body[i] = new JButton(" " + i);
            body[i].setEnabled(false);
            p1.add(body[i]);
            body[i].setBounds(bx[i], by[i], 10, 10);
            bx[i + 1] = bx[i] - 10;
            by[i + 1] = by[i];
        }
    }
//Создаем меню бар
    public void creatbar() {
        mybar = new JMenuBar();
 
        game = new JMenu("Игра");
 
        JMenuItem newgame = new JMenuItem("Новая игра");
        JMenuItem exit = new JMenuItem("Выход");
        newgame.addActionListener(
                new ActionListener() {
 
                    public void actionPerformed(ActionEvent e) {
                        reset();
                    }
                });
 
        exit.addActionListener(new ActionListener() {
 
            public void actionPerformed(ActionEvent e) {
                System.exit(0);
            }
        });
 
        game.add(newgame);
        game.addSeparator();//Разделитель
        game.add(exit);
 
        mybar.add(game);
 
      
 
 
        help = new JMenu("Помощь");
 
        JMenuItem creator = new JMenuItem("Автор");
       
 
        creator.addActionListener(new ActionListener() {
 
            public void actionPerformed(ActionEvent e) {
                JOptionPane.showMessageDialog(p1, "ФИО: Кадильников Алесей");
               
            }
        });
 
        help.add(creator);
        mybar.add(help);
 
        setJMenuBar(mybar);
    }
//Начало новой игры
    void reset() {
        initializeValues();
        p1.removeAll();
 
        myt.stop();
 
        createFirstSnake();
        sc.setText("Scores: " + score);
 
        myt = new Thread(this);
        myt.start();
    }
//кушаем растем
    void growup() {
        body[gu] = new JButton(" " + gu);
        body[gu].setEnabled(false);
        p1.add(body[gu]);
       body[gu].setBounds(bodyp[gu-1].x, bodyp[gu-1].y, 10, 10);
        gu++;
    }
 
    /**
     * 
     */
    void moveForward() {
       for(int i = 0; i < gu; i++) {
           bodyp[i] = body[i].getLocation();
        }
 
        bx[0] += directionx;
        by[0] += directiony;
       body[0].setBounds(bx[0], by[0], 10, 10);
// Для эффекта летницы
        for (int i = 1; i < gu; i++) {
            body[i].setLocation(bodyp[i - 1]);
        }
 
        if (bx[0] == x) {
            myt.stop(); 
            
        } else if (bx[0] == 0) {
          
             myt.stop();
        } else if (by[0] == y) {
        
             myt.stop();
        } else if (by[0] == 0) {
          
             myt.stop();
        }
        
        
        
        if (food == false) {
            p1.add(bonusfood);
            bonusfood.setBounds((10 * r.nextInt(50)), (10 * r.nextInt(25)), 10, 10);
            bfp = bonusfood.getLocation();
            food = true;
        }
   
 
    if (food == true) {
        if (bfp.x == bx[0] && bfp.y == by[0]) {
            p1.remove(bonusfood);
            score += 1;
                       growup();
            sc.setText("Scores: " + score);
            food = false;
           
        }
    }
        p1.repaint();
       
    }
 
    public void keyPressed(KeyEvent e) {
        // sвлево
        if (runl == true && e.getKeyCode() == 37) {
            directionx = -10; 
            directiony = 0;
            runr = false;     
            runu = true;      
            rund = true;     
        }
        //вверх
        if (runu == true && e.getKeyCode() == 38) {
            directionx = 0;
            directiony = -10; 
            rund = false;   
            runr = true;     
            runl = true;      
        }
        // вправо
        if (runr == true && e.getKeyCode() == 39) {
            directionx = +10; 
            directiony = 0;
            runl = false;
            runu = true;
            rund = true;
        }
        // вниз
        if (rund == true && e.getKeyCode() == 40) {
            directionx = 0;
            directiony = +10; 
            runu = false;
            runr = true;
            runl = true;
        }
    }
 
    public void keyReleased(KeyEvent e) {
    }
 
    public void keyTyped(KeyEvent e) {
    }
 
    public void run() {
        while(true) {
 
            moveForward();
            try {
                Thread.sleep(speed);
            } catch (InterruptedException ie) {
            }
        }
    }
}

Может кто переделать это змейку(не полностью только саму змейку с движение в Model- View- Controller) или подсказать как(Но лучше сделать не большой пример) Спасибо!
0
IT_Exp
Эксперт
34794 / 4073 / 2104
Регистрация: 17.06.2006
Сообщений: 32,602
Блог
09.11.2013, 14:18
Ответы с готовыми решениями:

Как широко применяется MVC в программировании на Java? Стоит ли изучать MVC?
Здравствуйте. Начинающий java-программист. Буквально недавно только закончил изучать Core. Теперь готовлюсь к собеседованиям и своей первой...

Змейка на Java
Здравствуйте. Очень нужен готовый проект со всеми исходниками игры &quot;Змейка&quot; на Java (изучаю NetBeans).Кому не жалко, пришлите пожалуйста на...

Игра Змейка
Помогите дописать игру, в Java практическм ноль(((( Нужно, чтобы: 1) при окончании игры выскакивало окошко с количеством собранных...

2
 Аватар для name?
201 / 172 / 52
Регистрация: 01.06.2010
Сообщений: 371
10.11.2013, 07:28
на больше сил не хватило....
Demo
Кликните здесь для просмотра всего текста
Java
1
2
3
4
5
6
7
public class Demo {
 
    public static void main(String[] args) {
        new Controller();
    }
 
}


Controller
Кликните здесь для просмотра всего текста
Java
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
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.Timer;
import model.Snake;
 
public class Controller implements KeyListener, ActionListener{
    private Renderer renderer;
    private Timer mainTimer;
    private Snake snake;
    
    public Controller() {
        snake = new Snake();
        renderer = new Renderer(this);
        
        this.renderer.addKeyListener(this);
        this.mainTimer = new Timer(50, this);
        mainTimer.start();
    }
    
    public void stopGame(){
        mainTimer.stop();
    }
    
    public void startGame(){
        mainTimer.start();
    }
    
    public void keyPressed(KeyEvent e) {
        snake.onMove(e.getKeyCode());
    }
 
    public void keyReleased(KeyEvent e) {
    }
 
    public void keyTyped(KeyEvent e) {
    }
    @Override
    public void actionPerformed(ActionEvent arg0) {
        renderer.moveForward();
    }
    
    public Snake getSnake(){
        return snake;
    }
    
}


View
Кликните здесь для просмотра всего текста
Java
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Random;
 
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextArea;
 
import model.Fruit;
import model.Snake;
 
class Renderer extends JFrame {
    private final int WIDTH = 500;
    private final int HEIGHT = 300;
    private Snake snake;
    
    private Controller controller;
    public JPanel pamel1, panel2;
    public JButton[] ButtonBody = new JButton[200];
    public JButton bonusfood;
    public JTextArea textArea;
    public Fruit fruit;
    public int score;
    public Random random = new Random();
    public JMenuBar mybar;
    public JMenu game, help;
 
    public void initializeValues() {
        score = 0;
    }
 
    Renderer(Controller controller) {
        super("Snake: PSU edition");
        this.controller = controller;
        snake = controller.getSnake();
        
        fruit = new Fruit();
        setBounds(200, 200, 506, 380);
        creatbar();
        initializeValues();
        // GUI панельки
        pamel1 = new JPanel();
        panel2 = new JPanel();
        // Текстовое поле очков
        setResizable(false);
        textArea = new JTextArea("Scores : " + score);
        textArea.setEnabled(false);
        textArea.setBounds(400, 400, 100, 100);
        textArea.setBackground(Color.black);
        // Змея ест и ростет
        bonusfood = new JButton();
        bonusfood.setEnabled(false);
        // Создаем начальную 3-ех кнопочную змею
        createFirstSnake();
 
        pamel1.setLayout(null);
        panel2.setLayout(new GridLayout(0, 1));
        pamel1.setBounds(0, 0, WIDTH, HEIGHT);
        pamel1.setBackground(Color.blue);
        panel2.setBounds(0, HEIGHT, WIDTH, 30);
        panel2.setBackground(Color.black);
 
        panel2.add(textArea); // will contain score board
        // end of UI design
        getContentPane().setLayout(null);
        getContentPane().add(pamel1);
        getContentPane().add(panel2);
        show();
        setDefaultCloseOperation(EXIT_ON_CLOSE);
 
    }
 
    // Создаем начальную змейку(из 3 кнопок)
    public void createFirstSnake() {
 
        for (int i = 0; i < 3; i++) {
            ButtonBody[i] = new JButton(" " + i);
            ButtonBody[i].setEnabled(false);
            pamel1.add(ButtonBody[i]);
            ButtonBody[i].setBounds(snake.x[i], snake.y[i], 10, 10);
            snake.x[i + 1] = snake.x[i] - 10;
            snake.y[i + 1] = snake.y[i];
        }
    }
 
    // Создаем меню бар
    public void creatbar() {
        mybar = new JMenuBar();
 
        game = new JMenu("Игра");
 
        JMenuItem newgame = new JMenuItem("Новая игра");
        JMenuItem exit = new JMenuItem("Выход");
        newgame.addActionListener(new ActionListener() {
 
            public void actionPerformed(ActionEvent e) {
                reset();
            }
        });
 
        exit.addActionListener(new ActionListener() {
 
            public void actionPerformed(ActionEvent e) {
                System.exit(0);
            }
        });
 
        game.add(newgame);
        game.addSeparator();// Разделитель
        game.add(exit);
 
        mybar.add(game);
 
        help = new JMenu("Помощь");
 
        JMenuItem creator = new JMenuItem("Автор");
 
        creator.addActionListener(new ActionListener() {
 
            public void actionPerformed(ActionEvent e) {
                JOptionPane.showMessageDialog(pamel1, "Refactoring by name?");
 
            }
        });
 
        help.add(creator);
        mybar.add(help);
 
        setJMenuBar(mybar);
    }
 
    // Начало новой игры
    void reset() {
        initializeValues();
        pamel1.removeAll();
 
        controller.stopGame();
 
        createFirstSnake();
        textArea.setText("Scores: " + score);
 
        controller.startGame();
    }
 
    // кушаем растем
    void growup() {
        ButtonBody[snake.getLength()] = new JButton(" " + snake.getLength());
        ButtonBody[snake.getLength()].setEnabled(false);
        pamel1.add(ButtonBody[snake.getLength()]);
        ButtonBody[snake.getLength()].setBounds(snake.getPointBody()[snake.getLength() - 1].x, snake.getPointBody()[snake.getLength() - 1].y, 10, 10);
        snake.setLength(snake.getLength() + 1);
    }
 
    void moveForward() {
        for (int i = 0; i < snake.getLength(); i++) {
            snake.getPointBody()[i] = ButtonBody[i].getLocation();
        }
 
        snake.x[0] += snake.getDirectionX();
        snake.y[0] += snake.getDirectionY();
        ButtonBody[0].setBounds(snake.x[0], snake.y[0], 10, 10);
        // Для эффекта летницы
        for (int i = 1; i < snake.getLength(); i++) {
            ButtonBody[i].setLocation(snake.getPointBody()[i - 1]);
        }
 
        if (snake.x[0] == WIDTH) {
            controller.stopGame();
        } else if (snake.x[0] == 0) {
            controller.stopGame();
        } else if (snake.y[0] == HEIGHT) {
            controller.stopGame();
        } else if (snake.y[0] == 0) {
            controller.stopGame();
        }
 
        createFruit();
 
        collisionFruit();
        pamel1.repaint();
 
    }
 
    private void collisionFruit() {
        if (fruit.isFood()) {
            if (fruit.getPoint().x == snake.x[0] && fruit.getPoint().y == snake.y[0]) {
                pamel1.remove(bonusfood);
                score += 1;
                growup();
                textArea.setText("Scores: " + score);
                fruit.setFood(false);
 
            }
        }
    }
 
    private void createFruit() {
        if (!fruit.isFood()) {
            pamel1.add(bonusfood);
            bonusfood.setBounds((10 * random.nextInt(50)), (10 * random.nextInt(25)), 10,
                    10);
            fruit.setPoint(bonusfood.getLocation());
            fruit.setFood(true);
        }
    }
 
}

Model
Кликните здесь для просмотра всего текста
Java
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
package model;
 
import java.awt.Point;
 
public class Fruit {
    private Point point;
    private boolean food;
    public Fruit() {
        point = new Point();
    }
    
    public Point getPoint() {
        return point;
    }
    public void setPoint(Point point) {
        this.point = point;
    }
 
    public boolean isFood() {
        return food;
    }
 
    public void setFood(boolean food) {
        this.food = food;
    }
}
Java
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
package model;
 
import java.awt.Point;
import java.awt.event.KeyEvent;
 
public class Snake {
    private Point[] pointBody = new Point[300];
    private int length;
 
    private boolean isLeft;
    private boolean isRight;
    private boolean isUp;
    private boolean isDown;
    
    private int directionX;
    private int directionY;
    
    public int[] x = new int[300];
    public int[] y = new int[300];
 
    public Snake() {
        isLeft = false;
        isRight = true;
        isUp = true;
        isDown = true;
        setDirectionX(10);
        setDirectionY(0);
        length = 3;
        y[0] = 100;
        x[0] = 150;
    }
 
    public void onMove(int side) {
        switch (side) {
        case KeyEvent.VK_LEFT:
            if (isLeft) {
                setDirectionX(-10);
                setDirectionY(0);
                isRight = false;
                isUp = true;
                isDown = true;
            }
            break;
        case KeyEvent.VK_UP:
            if (isUp) {
                setDirectionX(0);
                setDirectionY(-10);
                isDown = false;
                isRight = true;
                isLeft = true;
            }
            break;
        case KeyEvent.VK_DOWN:
            if (isDown) {
                setDirectionX(0);
                setDirectionY(+10);
                isUp = false;
                isRight = true;
                isLeft = true;
            }
            break;
        case KeyEvent.VK_RIGHT:
            if (isRight) {
                setDirectionX(+10);
                setDirectionY(0);
                isLeft = false;
                isUp = true;
                isDown = true;
            }
            break;
 
        default:
            break;
        }
 
    }
 
    public int getLength() {
        return length;
    }
 
    public void setLength(int length) {
        this.length = length;
    }
 
    public Point[] getPointBody() {
        return pointBody;
    }
 
    public void setPointBody(Point[] pointBody) {
        this.pointBody = pointBody;
    }
 
    public int getDirectionX() {
        return directionX;
    }
 
    public void setDirectionX(int directionX) {
        this.directionX = directionX;
    }
 
    public int getDirectionY() {
        return directionY;
    }
 
    public void setDirectionY(int directionY) {
        this.directionY = directionY;
    }
 
}
2
0 / 0 / 1
Регистрация: 09.11.2013
Сообщений: 26
10.11.2013, 14:13  [ТС]
Цитата Сообщение от name? Посмотреть сообщение
на больше сил не хватило....
Demo
Кликните здесь для просмотра всего текста
Java
1
2
3
4
5
6
7
public class Demo {
 
    public static void main(String[] args) {
        new Controller();
    }
 
}


Controller
Кликните здесь для просмотра всего текста
Java
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
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.Timer;
import model.Snake;
 
public class Controller implements KeyListener, ActionListener{
    private Renderer renderer;
    private Timer mainTimer;
    private Snake snake;
    
    public Controller() {
        snake = new Snake();
        renderer = new Renderer(this);
        
        this.renderer.addKeyListener(this);
        this.mainTimer = new Timer(50, this);
        mainTimer.start();
    }
    
    public void stopGame(){
        mainTimer.stop();
    }
    
    public void startGame(){
        mainTimer.start();
    }
    
    public void keyPressed(KeyEvent e) {
        snake.onMove(e.getKeyCode());
    }
 
    public void keyReleased(KeyEvent e) {
    }
 
    public void keyTyped(KeyEvent e) {
    }
    @Override
    public void actionPerformed(ActionEvent arg0) {
        renderer.moveForward();
    }
    
    public Snake getSnake(){
        return snake;
    }
    
}


View
Кликните здесь для просмотра всего текста
Java
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Random;
 
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextArea;
 
import model.Fruit;
import model.Snake;
 
class Renderer extends JFrame {
    private final int WIDTH = 500;
    private final int HEIGHT = 300;
    private Snake snake;
    
    private Controller controller;
    public JPanel pamel1, panel2;
    public JButton[] ButtonBody = new JButton[200];
    public JButton bonusfood;
    public JTextArea textArea;
    public Fruit fruit;
    public int score;
    public Random random = new Random();
    public JMenuBar mybar;
    public JMenu game, help;
 
    public void initializeValues() {
        score = 0;
    }
 
    Renderer(Controller controller) {
        super("Snake: PSU edition");
        this.controller = controller;
        snake = controller.getSnake();
        
        fruit = new Fruit();
        setBounds(200, 200, 506, 380);
        creatbar();
        initializeValues();
        // GUI панельки
        pamel1 = new JPanel();
        panel2 = new JPanel();
        // Текстовое поле очков
        setResizable(false);
        textArea = new JTextArea("Scores : " + score);
        textArea.setEnabled(false);
        textArea.setBounds(400, 400, 100, 100);
        textArea.setBackground(Color.black);
        // Змея ест и ростет
        bonusfood = new JButton();
        bonusfood.setEnabled(false);
        // Создаем начальную 3-ех кнопочную змею
        createFirstSnake();
 
        pamel1.setLayout(null);
        panel2.setLayout(new GridLayout(0, 1));
        pamel1.setBounds(0, 0, WIDTH, HEIGHT);
        pamel1.setBackground(Color.blue);
        panel2.setBounds(0, HEIGHT, WIDTH, 30);
        panel2.setBackground(Color.black);
 
        panel2.add(textArea); // will contain score board
        // end of UI design
        getContentPane().setLayout(null);
        getContentPane().add(pamel1);
        getContentPane().add(panel2);
        show();
        setDefaultCloseOperation(EXIT_ON_CLOSE);
 
    }
 
    // Создаем начальную змейку(из 3 кнопок)
    public void createFirstSnake() {
 
        for (int i = 0; i < 3; i++) {
            ButtonBody[i] = new JButton(" " + i);
            ButtonBody[i].setEnabled(false);
            pamel1.add(ButtonBody[i]);
            ButtonBody[i].setBounds(snake.x[i], snake.y[i], 10, 10);
            snake.x[i + 1] = snake.x[i] - 10;
            snake.y[i + 1] = snake.y[i];
        }
    }
 
    // Создаем меню бар
    public void creatbar() {
        mybar = new JMenuBar();
 
        game = new JMenu("Игра");
 
        JMenuItem newgame = new JMenuItem("Новая игра");
        JMenuItem exit = new JMenuItem("Выход");
        newgame.addActionListener(new ActionListener() {
 
            public void actionPerformed(ActionEvent e) {
                reset();
            }
        });
 
        exit.addActionListener(new ActionListener() {
 
            public void actionPerformed(ActionEvent e) {
                System.exit(0);
            }
        });
 
        game.add(newgame);
        game.addSeparator();// Разделитель
        game.add(exit);
 
        mybar.add(game);
 
        help = new JMenu("Помощь");
 
        JMenuItem creator = new JMenuItem("Автор");
 
        creator.addActionListener(new ActionListener() {
 
            public void actionPerformed(ActionEvent e) {
                JOptionPane.showMessageDialog(pamel1, "Refactoring by name?");
 
            }
        });
 
        help.add(creator);
        mybar.add(help);
 
        setJMenuBar(mybar);
    }
 
    // Начало новой игры
    void reset() {
        initializeValues();
        pamel1.removeAll();
 
        controller.stopGame();
 
        createFirstSnake();
        textArea.setText("Scores: " + score);
 
        controller.startGame();
    }
 
    // кушаем растем
    void growup() {
        ButtonBody[snake.getLength()] = new JButton(" " + snake.getLength());
        ButtonBody[snake.getLength()].setEnabled(false);
        pamel1.add(ButtonBody[snake.getLength()]);
        ButtonBody[snake.getLength()].setBounds(snake.getPointBody()[snake.getLength() - 1].x, snake.getPointBody()[snake.getLength() - 1].y, 10, 10);
        snake.setLength(snake.getLength() + 1);
    }
 
    void moveForward() {
        for (int i = 0; i < snake.getLength(); i++) {
            snake.getPointBody()[i] = ButtonBody[i].getLocation();
        }
 
        snake.x[0] += snake.getDirectionX();
        snake.y[0] += snake.getDirectionY();
        ButtonBody[0].setBounds(snake.x[0], snake.y[0], 10, 10);
        // Для эффекта летницы
        for (int i = 1; i < snake.getLength(); i++) {
            ButtonBody[i].setLocation(snake.getPointBody()[i - 1]);
        }
 
        if (snake.x[0] == WIDTH) {
            controller.stopGame();
        } else if (snake.x[0] == 0) {
            controller.stopGame();
        } else if (snake.y[0] == HEIGHT) {
            controller.stopGame();
        } else if (snake.y[0] == 0) {
            controller.stopGame();
        }
 
        createFruit();
 
        collisionFruit();
        pamel1.repaint();
 
    }
 
    private void collisionFruit() {
        if (fruit.isFood()) {
            if (fruit.getPoint().x == snake.x[0] && fruit.getPoint().y == snake.y[0]) {
                pamel1.remove(bonusfood);
                score += 1;
                growup();
                textArea.setText("Scores: " + score);
                fruit.setFood(false);
 
            }
        }
    }
 
    private void createFruit() {
        if (!fruit.isFood()) {
            pamel1.add(bonusfood);
            bonusfood.setBounds((10 * random.nextInt(50)), (10 * random.nextInt(25)), 10,
                    10);
            fruit.setPoint(bonusfood.getLocation());
            fruit.setFood(true);
        }
    }
 
}

Model
Кликните здесь для просмотра всего текста
Java
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
package model;
 
import java.awt.Point;
 
public class Fruit {
    private Point point;
    private boolean food;
    public Fruit() {
        point = new Point();
    }
    
    public Point getPoint() {
        return point;
    }
    public void setPoint(Point point) {
        this.point = point;
    }
 
    public boolean isFood() {
        return food;
    }
 
    public void setFood(boolean food) {
        this.food = food;
    }
}
Java
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
package model;
 
import java.awt.Point;
import java.awt.event.KeyEvent;
 
public class Snake {
    private Point[] pointBody = new Point[300];
    private int length;
 
    private boolean isLeft;
    private boolean isRight;
    private boolean isUp;
    private boolean isDown;
    
    private int directionX;
    private int directionY;
    
    public int[] x = new int[300];
    public int[] y = new int[300];
 
    public Snake() {
        isLeft = false;
        isRight = true;
        isUp = true;
        isDown = true;
        setDirectionX(10);
        setDirectionY(0);
        length = 3;
        y[0] = 100;
        x[0] = 150;
    }
 
    public void onMove(int side) {
        switch (side) {
        case KeyEvent.VK_LEFT:
            if (isLeft) {
                setDirectionX(-10);
                setDirectionY(0);
                isRight = false;
                isUp = true;
                isDown = true;
            }
            break;
        case KeyEvent.VK_UP:
            if (isUp) {
                setDirectionX(0);
                setDirectionY(-10);
                isDown = false;
                isRight = true;
                isLeft = true;
            }
            break;
        case KeyEvent.VK_DOWN:
            if (isDown) {
                setDirectionX(0);
                setDirectionY(+10);
                isUp = false;
                isRight = true;
                isLeft = true;
            }
            break;
        case KeyEvent.VK_RIGHT:
            if (isRight) {
                setDirectionX(+10);
                setDirectionY(0);
                isLeft = false;
                isUp = true;
                isDown = true;
            }
            break;
 
        default:
            break;
        }
 
    }
 
    public int getLength() {
        return length;
    }
 
    public void setLength(int length) {
        this.length = length;
    }
 
    public Point[] getPointBody() {
        return pointBody;
    }
 
    public void setPointBody(Point[] pointBody) {
        this.pointBody = pointBody;
    }
 
    public int getDirectionX() {
        return directionX;
    }
 
    public void setDirectionX(int directionX) {
        this.directionX = directionX;
    }
 
    public int getDirectionY() {
        return directionY;
    }
 
    public void setDirectionY(int directionY) {
        this.directionY = directionY;
    }
 
}
Огромное спасибо, уже по тиху сам переделываю свою ваши наработки будут очень полезны..

P.S может и мое кому-то пригодится
Java
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.Point;
import java.awt.event.KeyListener;
import java.util.Random;
 
import javax.swing.JButton;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JPanel;
import javax.swing.JTextArea;
 
 
public class Model {
    
    private KeyListener e;
 
 
 
    public Model () {
        p1 = new JPanel();
        p2 = new JPanel();
        sc = new JTextArea("Scores : " + score);
        sc.setEnabled(false);
        sc.setBounds(400, 400, 100, 100);
       sc.setBackground(Color.black);
      
        
       
        p1.setLayout(null);
        p2.setLayout(new GridLayout(0, 1));
        p1.setBounds(0, 0, x, y);
        p1.setBackground(Color.blue);
        p2.setBounds(0, y, x, 30);
        p2.setBackground(Color.black);
 
        p2.add(sc); // will contain score board
        
       
        initializeValues();
        createFirstSnake();
    
    
    }
    private JPanel p1, p2;
    private JButton[] body = new JButton[200];
    private JButton bonusfood;
    private JTextArea sc;
 
    
   private  Point bfp = new Point();
 
    private int x = 500, y = 300, gu = 3, directionx = 0, directiony = 0, speed = 100, score = 0;
    private int[] bx = new int[300];
    private int[] by = new int[300];
    private  Point[] bodyp = new Point[300];
    //private Point bfp = new Point();
    private Thread myt;
    private boolean food = false, runl = false, runr = true, runu = true, rund = true;
    private  Random r = new Random();
    private JMenuBar mybar;
    private JMenu game, help;
 
 
 
    public void initializeValues() {
        gu = 3;
        by[0] = 100;
        bx[0] = 150;
        directionx = 10;
        directiony = 0;
       
        score = 0;
        food = false;
        runl = false;
        runr = true;
        runu = true;
        rund = true;
      
    }
    public void createFirstSnake() {
        
        for (int i = 0; i < 3; i++) {
            body[i] = new JButton(" " + i);
            body[i].setEnabled(false);
            p1.add(body[i]);
            body[i].setBounds(bx[i], by[i], 10, 10);
            bx[i + 1] = bx[i] - 10;
            by[i + 1] = by[i];
        }
    }
 
    void moveForward() {
        for(int i = 0; i < gu; i++) {
            bodyp[i] = body[i].getLocation();
         }
 
         bx[0] += directionx;
         by[0] += directiony;
        body[0].setBounds(bx[0], by[0], 10, 10);
 // Для эффекта летницы
         for (int i = 1; i < gu; i++) {
             body[i].setLocation(bodyp[i - 1]);
         }
 
         
         
         
    
    
 
    
         p1.repaint();
        
     }
    public JPanel getP1() {
        return p1;
    }
 
 
 
    public void setP1(JPanel p1) {
        this.p1 = p1;
    }
 
 
 
    public JPanel getP2() {
        return p2;
    }
 
 
 
    public void setP2(JPanel p2) {
        this.p2 = p2;
    }
 
 
 
    public JButton[] getBody() {
        return body;
    }
 
 
 
    public void setBody(JButton[] body) {
        this.body = body;
    }
 
 
 
    public JButton getBonusfood() {
        return bonusfood;
    }
 
 
 
    public void setBonusfood(JButton bonusfood) {
        this.bonusfood = bonusfood;
    }
 
 
 
    public JTextArea getSc() {
        return sc;
    }
 
 
 
    public void setSc(JTextArea sc) {
        this.sc = sc;
    }
 
 
 
    public Point getBfp() {
        return bfp;
    }
 
 
 
    public void setBfp(Point bfp) {
        this.bfp = bfp;
    }
 
 
 
    public int getX() {
        return x;
    }
 
 
 
    public void setX(int x) {
        this.x = x;
    }
 
 
 
    public int getY() {
        return y;
    }
 
 
 
    public void setY(int y) {
        this.y = y;
    }
 
 
 
    public int getGu() {
        return gu;
    }
 
 
 
    public void setGu(int gu) {
        this.gu = gu;
    }
 
 
 
    public int getDirectionx() {
        return directionx;
    }
 
 
 
    public void setDirectionx(int directionx) {
        this.directionx = directionx;
    }
 
 
 
    public int getDirectiony() {
        return directiony;
    }
 
 
 
    public void setDirectiony(int directiony) {
        this.directiony = directiony;
    }
 
 
 
    public int getSpeed() {
        return speed;
    }
 
 
 
    public void setSpeed(int speed) {
        this.speed = speed;
    }
 
 
 
    public int getScore() {
        return score;
    }
 
 
 
    public void setScore(int score) {
        this.score = score;
    }
 
 
 
    public int[] getBx() {
        return bx;
    }
 
 
 
    public void setBx(int[] bx) {
        this.bx = bx;
    }
 
 
 
    public int[] getBy() {
        return by;
    }
 
 
 
    public void setBy(int[] by) {
        this.by = by;
    }
 
 
 
    public Point[] getBodyp() {
        return bodyp;
    }
 
 
 
    public void setBodyp(Point[] bodyp) {
        this.bodyp = bodyp;
    }
 
 
 
    public Thread getMyt() {
        return myt;
    }
 
 
 
    public void setMyt(Thread myt) {
        this.myt = myt;
    }
 
 
 
    public boolean isFood() {
        return food;
    }
 
 
 
    public void setFood(boolean food) {
        this.food = food;
    }
 
 
 
    public boolean isRunl() {
        return runl;
    }
 
 
 
    public void setRunl(boolean runl) {
        this.runl = runl;
    }
 
 
 
    public boolean isRunr() {
        return runr;
    }
 
 
 
    public void setRunr(boolean runr) {
        this.runr = runr;
    }
 
 
 
    public boolean isRunu() {
        return runu;
    }
 
 
 
    public void setRunu(boolean runu) {
        this.runu = runu;
    }
 
 
 
    public boolean isRund() {
        return rund;
    }
 
 
 
    public void setRund(boolean rund) {
        this.rund = rund;
    }
 
 
 
    public Random getR() {
        return r;
    }
 
 
 
    public void setR(Random r) {
        this.r = r;
    }
 
 
 
    public JMenuBar getMybar() {
        return mybar;
    }
 
 
 
    public void setMybar(JMenuBar mybar) {
        this.mybar = mybar;
    }
 
 
 
    public JMenu getGame() {
        return game;
    }
 
 
 
    public void setGame(JMenu game) {
        this.game = game;
    }
 
 
 
    public JMenu getHelp() {
        return help;
    }
 
 
 
    public void setHelp(JMenu help) {
        this.help = help;
    }
    
    
    
}


Java
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
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
 
import javax.swing.JFrame;
 
public class View extends JFrame{
    
    
private Model model;
private KeyListener l;
 
 
public View(Model model) {
 
    super("Haha");
    this.model=model;
  setBounds(200, 200, 506, 380);
    
 getContentPane().setLayout(null);
     getContentPane().add(model.getP1());
    getContentPane().add(model.getP2());
   setFocusable(true);
   
    show();
 
}
 
 
 
 
 
 
 
 
 
 
}

Java
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
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
 
import javax.swing.JButton;
import javax.swing.JPanel;
 
 
public class Controller implements KeyListener, Runnable {
     private Model model;
       private View view;
        private JButton[] body = new JButton[200];
        private Thread myt;
        
        
 
    public Controller(Model model, View view){
       
        this.model=model;
        this.view=view;
        myt = new Thread(this);
        myt.start(); 
       
        
       }
 
 
 
    @Override
    public void keyPressed(KeyEvent e) {
        if (model.isRunl() == true && e.getKeyCode() == 37) {
            model.setDirectionx(-10);
            model.setDirectiony(0);
            model.setRunr(false);
            model.setRunu(true);
            model.setRund(true);
              System.out.println("123");
        }
        //вверх
        if (model.isRunu() == true && e.getKeyCode() == 38) {
            model.setDirectionx(0);
            model.setDirectiony(-10);
            model.setRund(false);
            model.setRunr(true);
            model.setRunl(true);
               
        }
        // вправо
        if (model.isRunr() == true && e.getKeyCode() == 39) {
            model.setDirectionx(10);
            model.setDirectiony(0);
            model.setRunl(false);
 
            model.setRunu(true);
            model.setRund(true);
 
            
        }
        // вниз
        if (model.isRund() == true && e.getKeyCode() == 40) {
            model.setDirectionx(0);
            model.setDirectiony(10);
            model.setRunu(false);
            model.setRunr(true);
            model.setRunl(true);
           
        }
        
    }
 
    @Override
    public void keyReleased(KeyEvent e) {
        // TODO Auto-generated method stub
        
    }
 
    @Override
    public void keyTyped(KeyEvent e) {
        // TODO Auto-generated method stub
        
    }
 
        
 
    @Override
    public void run() {
         while(true) {
 
               model.moveForward();
                try {
                    Thread.sleep(100);
                } catch (InterruptedException ie) {
                }
            }
        
    }
 
 
 
 
 
}
Добавлено через 11 минут
P.S.S Вообще отлично я у вас посмотрю как направить слушателя кнопок и пределаю полностью свою=) Еще раз огромное спасибо!
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
BasicMan
Эксперт
29316 / 5623 / 2384
Регистрация: 17.02.2009
Сообщений: 30,364
Блог
10.11.2013, 14:13
Помогаю со студенческими работами здесь

Сетевая змейка
Имеется изначальная змейка и сервер. Пытался соединить,но имеются проблемы со входными потоками...Нужна помощь в исправлении ошибки

Массив змейка
Vsem privet. ya nachenaushij programist po jave. i u menya takoi vopros. u menya est zadanie napisat metodu kotoraya proveryaet esli danij...

Snake. Змейка рассыпается на фрагменты
Здравствуйте, я, пока ещё(надеюсь пока), полный нуб в яве. Пожалуйста помогите мне с кодом. Пишу змейку. Всё вроде бы хорошо, но возникает...

Ограничение по скорости нажатия клавиш - Игра Змейка
Написал код для Змейки, но возникла небольшая проблема - если быстро нажать вниз/вверх + вправо/влево Змея резко развернется на 180...

Игра змейка. У кого нибудь есть исходник?
Игра змейка. У кого нибудь есть исходник? Интересует только JAVA. Заранее благодарен.


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
3
Ответ Создать тему
Новые блоги и статьи
SDL3 для Web (WebAssembly): Работа со звуком через SDL3_mixer
8Observer8 08.02.2026
Содержание блога Пошагово создадим проект для загрузки звукового файла и воспроизведения звука с помощью библиотеки SDL3_mixer. Звук будет воспроизводиться по клику мышки по холсту на Desktop и по. . .
SDL3 для Web (WebAssembly): Основы отладки веб-приложений на SDL3 по USB и Wi-Fi, запущенных в браузере мобильных устройств
8Observer8 07.02.2026
Содержание блога Браузер Chrome имеет средства для отладки мобильных веб-приложений по USB. В этой пошаговой инструкции ограничимся работой с консолью. Вывод в консоль - это часть процесса. . .
SDL3 для Web (WebAssembly): Обработчик клика мыши в браузере ПК и касания экрана в браузере на мобильном устройстве
8Observer8 02.02.2026
Содержание блога Для начала пошагово создадим рабочий пример для подготовки к экспериментам в браузере ПК и в браузере мобильного устройства. Потом напишем обработчик клика мыши и обработчик. . .
Философия технологии
iceja 01.02.2026
На мой взгляд у человека в технических проектах остается роль генерального директора. Все остальное нейронки делают уже лучше человека. Они не могут нести предпринимательские риски, не могут. . .
SDL3 для Web (WebAssembly): Вывод текста со шрифтом TTF с помощью SDL3_ttf
8Observer8 01.02.2026
Содержание блога В этой пошаговой инструкции создадим с нуля веб-приложение, которое выводит текст в окне браузера. Запустим на Android на локальном сервере. Загрузим Release на бесплатный. . .
SDL3 для Web (WebAssembly): Сборка C/C++ проекта из консоли
8Observer8 30.01.2026
Содержание блога Если вы откроете примеры для начинающих на официальном репозитории SDL3 в папке: examples, то вы увидите, что все примеры используют следующие четыре обязательные функции, а. . .
SDL3 для Web (WebAssembly): Установка Emscripten SDK (emsdk) и CMake для сборки C и C++ приложений в Wasm
8Observer8 30.01.2026
Содержание блога Для того чтобы скачать Emscripten SDK (emsdk) необходимо сначало скачать и уставить Git: Install for Windows. Следуйте стандартной процедуре установки Git через установщик. . . .
SDL3 для Android: Подключение Box2D v3, физика и отрисовка коллайдеров
8Observer8 29.01.2026
Содержание блога Box2D - это библиотека для 2D физики для анимаций и игр. С её помощью можно определять были ли коллизии между конкретными объектами. Версия v3 была полностью переписана на Си, в. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru