打蜜蜂(c语言)(Hit the bee (C language))
打蜜蜂(c语言)(Hit the bee (C language))
打蜜蜂 (c语言)
# includes "stdio.h"
# includes graphics.h > <
int tanke _ size = 30, star _ size = 30;
int guan _ ka = 1; / * 1: 2: 3: blue green red light blue 4: 5: fen red 6: 7: 8: zong white light white * /
int tanke _ current _ x, tanke _ current _ y;
int tanke _ left = 20, tanke _ right = 620, tanke _ top = 20, tanke _ bottom = 450.
int fist _ star _ x, fist _ star _ y;
int zidan _ current _ x = - 1, zidan _ current _ y = - 1, zidan _ color = 4;
int mifeng _ x [6] [18], mifeng _ y [6] [18].
int mifeng _ count = 0;
void main ()
{
int i, j, k;
int first _ star _ x = 50;
int first _ star _ y = 50;
chushihuagraphics ();
rectangle (tanke _ left 1, tanke _ top 1, tanke _ right + 1, tanke _ bottom);
tanke _ current _ x = 290; tanke _ current _ y = 410.
createtanke (tanke _ current _ x, tanke _ current _ y);
/ * createstar (100100); * /
for (i = 0; i < 6; i + +)
{
for (j = 0, j < 18; j + +)
{
createstar (first _ star _ x, first _ star _ y, - 1);
mifeng _ x [i] [j] = first _ star _ x;
mifeng _ y [i] [j] = first _ star _ y; / * printf ("(% d% d)", mifeng _ x [i] [j], mifeng _ y [i] [j]); * /
first _ star _ x + = star _ size;
mifeng _ count + +;
}
first _ star _ x = 50;
first _ star _ y + = star _ size;
} / * printf ("% d", mifeng _ count); * /
startgame ();
getchar ();
}
createstar (int x, int y, int color)
{
int to _ x = x + 1, _ y = y;
int b _ x = x + 2, b _ y = y + 10.
int c _ x = x + 7, c _ y = y + 30.
int d _ x = x + 22 d _ y = y + 30.
int and _ x = x + 28, and _ y = y + 10.
int temp _ color;
time _ color = getcolor ();
if (a = = - 1)
{
setcolor (x% 8 = = 0? x + 1, x% (8);
}
else
{
setcolor (color);
}
line (_ x, _ y, c _ x, c _ y);
line (_ x, _ y, d _ x, d _ y);
line (b _ x, b _ y, d _ x, d _ y);
line (b _ x, b _ y, and _ x, and _ y);
line (c _ x, c _ y, and _ x, and _ y);
setcolor (temp _ color);
}
createtanke (int x, int y)
{
int twidth = 4, tem _ color;
tem _ color = getcolor ();
if (getcolor (). = getbkcolor ())
{
setcolor (2);
}
r