From 7bc36c16b243d88301d973f271b47440b0c448a9 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Wed, 29 Feb 2012 14:49:12 +0100 Subject: [PATCH] Make the very first cutscene a little bit more interesting. Before, all the ships were moving at exactly the same speed, making them appear static on screen. Now, Chris is moving slowly to the right, but the WEAPCO fighters are changing velocity now and then, both horizontally and vertically, never quite reaching Chris but increasing their attempts. --- code/script.cpp | 13 +++++++++++++ data/cutscene0.dat | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/code/script.cpp b/code/script.cpp index 76f2f9e..1bb9bc9 100644 --- a/code/script.cpp +++ b/code/script.cpp @@ -262,7 +262,16 @@ void doCutscene(int scene) if (enemy[i].active) { addEngine(&enemy[i]); + if (scene == 0 && i > 0 && (timer % 15) == i) { + enemy[i].dx += (drand48() - 0.5) * 0.1; + enemy[i].dy += (drand48() - 0.5) * 0.1; + if (enemy[i].x > 500 - timer) + enemy[i].dx -= 0.2; + if (enemy[i].x < 0) + enemy[i].dx += 0.2; + } enemy[i].x += enemy[i].dx; + enemy[i].y += enemy[i].dy; enemy[i].x += engine.ssx; blit(enemy[i].image[0], (int)enemy[i].x, (int)enemy[i].y); if (enemy[i].x > 850) @@ -270,6 +279,10 @@ void doCutscene(int scene) enemy[i].x = -50; enemy[i].y = rand() % 560; } + if (enemy[i].y < -50) + enemy[i].y = 650; + if (enemy[i].y > 650) + enemy[i].y = -50; } } diff --git a/data/cutscene0.dat b/data/cutscene0.dat index a971418..e0d069c 100644 --- a/data/cutscene0.dat +++ b/data/cutscene0.dat @@ -1,7 +1,7 @@ gfx/spirit.jpg -3 0 -0 0 400 300 3 +0 0 480 300 3.1 1 2 -100 -550 3 2 2 -100 -550 3 3 2 -100 -550 3