-
Notifications
You must be signed in to change notification settings - Fork 0
/
game_attempt_1.pde
72 lines (69 loc) · 1.41 KB
/
game_attempt_1.pde
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
boolean game_start=false;
int ball_ammount=75;
Brick[][] wall;
int brickWidth;
int brickHeight;
int brickAmmountWidth;
int brickAmmountHeight;
Projectile bullet=new Projectile();
int padX;
int padY;
int padWidth, padHeight;
void setup()
{
size(800, 600);
//fullScreen();
strokeWeight(5);
initialize(ball_ammount, a);
brickAmmountWidth=(width/2)/100;
brickAmmountHeight=(height/4)/35;
wall=new Brick[brickAmmountHeight][brickAmmountWidth];
brickWidth=width/2/brickAmmountWidth;
brickHeight=height/4/brickAmmountHeight;
declareWall(wall);
initializeWall(wall);
initializeProjectile(bullet);
font=loadFont("Georgia-Italic-64.vlw");
padHeight=height/50;
padWidth=width/15;
padY=height-int(padHeight*1.5);
}
void draw()
{
background(200);
if (!game_start)
{
cursor();
menu_background();
Draw_Button_BG();
Draw_Play();
Draw_Quit();
} else
{
noCursor();
drawBrickBackground();
drawBricks(wall);
drawProjectile(bullet);
updateProjectile(bullet);
updatePad();
drawPad();
if (bullet.pozYProjectile<height/3&&bullet.projectileSpeedY<0)
for (int i=0; i<brickAmmountHeight; i++)
{
for (int j=0; j<brickAmmountWidth; j++)
{
updateWall(i, j);
}
}
}
}
void keyPressed()
{
if (keyCode==SHIFT)
{
game_start=false;
declareWall(wall);
initializeWall(wall);
initializeProjectile(bullet);
}
}