aboutsummaryrefslogtreecommitdiffstats
path: root/cube_pc_test1/launch_effect.c
diff options
context:
space:
mode:
authorvg <vgm+dev@devys.org>2020-07-07 16:24:01 +0200
committervg <vgm+dev@devys.org>2020-07-07 16:24:01 +0200
commit66dcf910bd4744d8ced56cb9586aa937a1a2d4c5 (patch)
treedf4dca1ae4af1e5df0be0d1f4f2cd0d54751f8e8 /cube_pc_test1/launch_effect.c
downloadhic-master.tar.gz
hic-master.tar.bz2
hic-master.zip
first commitHEADmaster
Diffstat (limited to 'cube_pc_test1/launch_effect.c')
-rw-r--r--cube_pc_test1/launch_effect.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/cube_pc_test1/launch_effect.c b/cube_pc_test1/launch_effect.c
new file mode 100644
index 0000000..26664eb
--- /dev/null
+++ b/cube_pc_test1/launch_effect.c
@@ -0,0 +1,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);
+ }
+}
+