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
|
#include "launch_effect.h"
#include "effect.h"
#include "draw.h"
#include "gameoflife.h"
#include <math.h>
void draw_line(int Xa, int Ya, int Za,
int Xb, int Yb, int Zb);
void draw_linef(float Xa, float Ya, float Za,
float Xb, float Yb, float Zb);
void launch_effect (int effect)
{
/*
for (x = 0; x < 7; ++x) {
fill(0);
draw_line(x, 0, 4, 7-x, 7, 4);
delay_ms(1000);
}
for (y = 0; y < 7; ++y) {
fill(0);
draw_line(0, 7-y, 4, 7, y, 4);
delay_ms(1000);
}
for (x = 0; x < 7; ++x) {
fill(0);
draw_line(7-x, 7, 4, x, 0, 4);
delay_ms(1000);
}
for (y = 0; y < 7; ++y) {
fill(0);
draw_line(7, y, 4, 0, 7-y, 4);
delay_ms(1000);
}
*/
/*
float d;
for (d = 0; d < 6.3; d += 0.1) {
fill(0);
float c = cosf(d)*10, s = sinf(d)*10;
draw_linef(c + 3.5, s + 3.5, 4, -c + 3.5, -s + 3.5, 4);
delay_ms(1000);
}
*/
int i;
float x = 0, y = 1;
for (i = 0; i < 28; ++i) {
fill(0);
x = 1.06 * (x - 3.5) + 3.5;
y = 1.06 * (y - 3.5) + 3.5;
draw_line(x, y, 4, -x, -y, 4);
delay_ms(1000);
}
}
|