Skip to content
This repository was archived by the owner on Nov 12, 2020. It is now read-only.

Commit e9058e2

Browse files
committed
Updated :)
1 parent 33ff2cf commit e9058e2

File tree

6 files changed

+42
-43
lines changed

6 files changed

+42
-43
lines changed

Screens.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ void mainMenu()
2020
int order = 1;
2121
settextjustify(LEFT_TEXT, BOTTOM_TEXT);
2222
settextstyle(BOLD_FONT, HORIZ_DIR, 2);
23-
outtextxy(10,H-30, TEXT_COPYRIGHT);
24-
outtextxy(W-400,H-30, TEXT_MAJOR);
23+
outtextxy(10,H-13, TEXT_COPYRIGHT);
24+
outtextxy(W-400,H-13, TEXT_MAJOR);
2525
settextstyle(BOLD_FONT, HORIZ_DIR, 3);
2626
outtextxy(470,500, TEXT_PRESSKEY);
2727

Snake2.depend

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363

6464
1501556002 d:\github\snakever2\screens.h
6565

66-
1501810178 source:d:\github\snakever2\screens.cpp
66+
1502866795 source:d:\github\snakever2\screens.cpp
6767
<iostream>
6868
<stdio.h>
6969
"Declaration.h"
@@ -98,11 +98,11 @@
9898
1501764816 d:\github\snakever2\graphicapi.h
9999
<graphics.h>
100100

101-
1501764816 source:d:\github\snakever2\graphicapi.cpp
101+
1502380308 source:d:\github\snakever2\graphicapi.cpp
102102
"Declaration.h"
103103
"GraphicAPI.h"
104104

105-
1501811278 source:d:\github\snakever2\main.cpp
105+
1502380646 source:d:\github\snakever2\main.cpp
106106
"Screens.h"
107107
"Classes.h"
108108
"graphicAPI.h"
@@ -126,7 +126,7 @@
126126
"Declaration.h"
127127
<stdlib.h>
128128

129-
1501811142 source:d:\github\snakever2\snakegame.cpp
129+
1502381231 source:d:\github\snakever2\snakegame.cpp
130130
<fstream>
131131
<iostream>
132132
<windows.h>

Snake2.layout

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,80 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
22
<CodeBlocks_layout_file>
33
<FileVersion major="1" minor="0" />
4-
<ActiveTarget name="Debug" />
5-
<File name="Snake.cpp" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
4+
<ActiveTarget name="Release" />
5+
<File name="Highscore.cpp" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
66
<Cursor>
7-
<Cursor1 position="960" topLine="0" />
7+
<Cursor1 position="279" topLine="3" />
88
</Cursor>
99
</File>
10-
<File name="Classes.h" open="1" top="1" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
10+
<File name="Screens.cpp" open="1" top="1" tabpos="4" split="0" active="1" splitpos="0" zoom_1="2" zoom_2="0">
1111
<Cursor>
12-
<Cursor1 position="919" topLine="40" />
12+
<Cursor1 position="789" topLine="12" />
1313
</Cursor>
1414
</File>
15-
<File name="Screens.cpp" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="2" zoom_2="0">
15+
<File name="Classes.h" open="1" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
1616
<Cursor>
17-
<Cursor1 position="1294" topLine="30" />
17+
<Cursor1 position="1260" topLine="0" />
1818
</Cursor>
1919
</File>
20-
<File name="graphicAPI.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
20+
<File name="Develop.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="1" zoom_2="0">
2121
<Cursor>
22-
<Cursor1 position="579" topLine="0" />
22+
<Cursor1 position="1124" topLine="0" />
2323
</Cursor>
2424
</File>
25-
<File name="graphicAPI.h" open="1" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="2" zoom_2="0">
25+
<File name="SnakeGame.cpp" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="1" zoom_2="0">
2626
<Cursor>
27-
<Cursor1 position="411" topLine="0" />
27+
<Cursor1 position="188" topLine="0" />
2828
</Cursor>
2929
</File>
30-
<File name="Screens.h" open="1" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
30+
<File name="Declaration.h" open="1" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
3131
<Cursor>
32-
<Cursor1 position="96" topLine="0" />
32+
<Cursor1 position="475" topLine="0" />
3333
</Cursor>
3434
</File>
35-
<File name="Develop.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="1" zoom_2="0">
35+
<File name="Develop.h" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
3636
<Cursor>
37-
<Cursor1 position="1124" topLine="0" />
37+
<Cursor1 position="84" topLine="0" />
3838
</Cursor>
3939
</File>
40-
<File name="SnakeGame.cpp" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="1" zoom_2="0">
40+
<File name="Sound.h" open="1" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
4141
<Cursor>
42-
<Cursor1 position="5277" topLine="182" />
42+
<Cursor1 position="210" topLine="0" />
4343
</Cursor>
4444
</File>
45-
<File name="map.cpp" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
45+
<File name="Screens.h" open="1" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
4646
<Cursor>
47-
<Cursor1 position="281" topLine="0" />
47+
<Cursor1 position="93" topLine="0" />
4848
</Cursor>
4949
</File>
50-
<File name="Declaration.h" open="1" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
50+
<File name="graphicAPI.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
5151
<Cursor>
52-
<Cursor1 position="475" topLine="0" />
52+
<Cursor1 position="309" topLine="0" />
5353
</Cursor>
5454
</File>
55-
<File name="Highscore.cpp" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
55+
<File name="map.cpp" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
5656
<Cursor>
57-
<Cursor1 position="279" topLine="3" />
57+
<Cursor1 position="281" topLine="0" />
5858
</Cursor>
5959
</File>
6060
<File name="Sound.cpp" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
6161
<Cursor>
6262
<Cursor1 position="300" topLine="0" />
6363
</Cursor>
6464
</File>
65-
<File name="Develop.h" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
65+
<File name="Snake.cpp" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
6666
<Cursor>
67-
<Cursor1 position="84" topLine="0" />
67+
<Cursor1 position="960" topLine="0" />
6868
</Cursor>
6969
</File>
7070
<File name="main.cpp" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
7171
<Cursor>
72-
<Cursor1 position="349" topLine="12" />
72+
<Cursor1 position="355" topLine="9" />
7373
</Cursor>
7474
</File>
75-
<File name="Sound.h" open="1" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
75+
<File name="graphicAPI.h" open="1" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="2" zoom_2="0">
7676
<Cursor>
77-
<Cursor1 position="210" topLine="0" />
77+
<Cursor1 position="411" topLine="0" />
7878
</Cursor>
7979
</File>
8080
</CodeBlocks_layout_file>

SnakeGame.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,16 +250,11 @@ void SnakeGame::gameThread(){
250250
{
251251
this->getKey2ChangeDirection();
252252
point oldPos = this->snake->getPosition();
253-
254253
this->snake->move(); // move head to other position
255-
256254
this->logic();
257-
258255
this->saveTail(oldPos);
259256
this->setZone(this->snake->getPosition(), ZONE_HEAD); // make new head in Zone
260-
261257
this->makeTail();
262-
263258
delay(this->getGameSpeed()); // delay each of game frame
264259
}
265260
}

graphicAPI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ void initGraphic()
99
void drawBlock(int x, int y, fill_styles pattern, int color)
1010
{
1111
setfillstyle(pattern, color);
12-
bar((x + scrX -1) * unitLength + 1 ,
13-
(y + scrY -1) * unitLength + 1 ,
12+
bar((x + scrX -1) * unitLength + 0 ,
13+
(y + scrY -1) * unitLength + 0 ,
1414
(x + scrX -1) * unitLength + unitLength ,
1515
(y + scrY -1) * unitLength + unitLength);
1616
}

main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
#include <iostream>
88
#include <time.h>
99

10+
#define release false
1011

1112
int main()
1213
{
13-
//ShowWindow(FindWindowA("ConsoleWindowClass", NULL), false); // Dont open the console --> Just remove the comment when build the program
14+
if (release)
15+
ShowWindow(FindWindowA("ConsoleWindowClass", NULL), false); // Dont open the console --> Just remove the comment when build the program
1416

1517
initGraphic();
1618
while (1)
@@ -54,6 +56,8 @@ int main()
5456
cleardevice();
5557
}
5658
closegraph();
57-
//FreeConsole(); // The same with ShowWindow
59+
60+
if (release)
61+
FreeConsole(); // The same with ShowWindow
5862
return 0;
5963
}

0 commit comments

Comments
 (0)