-
Notifications
You must be signed in to change notification settings - Fork 0
/
cube.cpp
37 lines (30 loc) · 991 Bytes
/
cube.cpp
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
#include "screen.h"
#include "drawing.h"
#include "math.h"
void square(G& screen, int position_x, int position_y, int size)
{
line(screen,tuple<int,int>(position_x,position_y),tuple<int,int>(position_x+size,position_y));
line(screen,tuple<int,int>(position_x,position_y+size),tuple<int,int>(position_x+size+1,position_y+size));
line(screen,tuple<int,int>(position_x,position_y),tuple<int,int>(position_x,position_y+size));
line(screen,tuple<int,int>(position_x+size,position_y),tuple<int,int>(position_x+size,position_y+size));
}
int main(int argc, char* argv[])
{
G screen;
for(int i = 100; i < 640; i+=90)
{
for(int k = 75; k < 480; k+=96)
{
for(int j = 80; j > 1; j-=10)
{
square(screen,i-(j/2),k-(j/2),j);
screen.update();
SDL_Delay(50);
screen.input();
}
}
}
SDL_Delay(1000);
screen.clearpixels();
return 0;
}