- moved tux completly to sprites
[supertux.git] / src / intro.cpp
1 //  $Id$
2 //
3 //  SuperTux -  A Jump'n Run
4 //  Copyright (C) 2000 Bill Kendrick <bill@newbreedsoftware.com>
5 //
6 //  This program is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU General Public License
8 //  as published by the Free Software Foundation; either version 2
9 //  of the License, or (at your option) any later version.
10 //
11 //  This program is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 //  GNU General Public License for more details.
15 //
16 //  You should have received a copy of the GNU General Public License
17 //  along with this program; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19
20 #include <iostream>
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <string.h>
24 #include <errno.h>
25 #include <unistd.h>
26 #include <SDL.h>
27 #include <SDL_image.h>
28
29 #include <sys/types.h>
30 #include <ctype.h>
31
32 #include "defines.h"
33 #include "globals.h"
34 #include "intro.h"
35 #include "screen.h"
36 #include "text.h"
37 #include "texture.h"
38 #include "timer.h"
39
40 char * intro_text[] = {
41                         "Tux and Gown were having a nice picnic..",
42                         "when suddenly...",
43                         "Gown is beamed away!!!",
44                         "This looks like a job for ---"
45                       };
46
47
48 void draw_intro()
49 {
50   bool done = false;
51
52   while (!done)
53     {
54       SDL_Event event;
55       drawgradient(Color(155, 200, 255), Color(255, 255, 255));
56
57       gold_text->draw_align("Gwen gets captured!", screen->w/2, 15, A_HMIDDLE, A_TOP);
58
59       white_text->draw
60         ("\n"                                   //
61          "Tux and Gwen were out having a nice\n"
62          "picnic on the ice fields of Antarctica.\n"
63          "Suddenly, a creature jumped from\n"
64          "behind an ice bush, there was a flash,\n"
65          "and Tux fell asleep!\n"
66          "\n"                                   //
67          "When Tux wakes up, he finds that Gwen\n"
68          "is missing. Where she lay before now\n"
69          "lies a letter. \"Tux, my arch enemy!\"\n"
70          "says the letter. \"I have captured\n"
71          "your beautiful Gwen and have taken her\n"
72          "to my fortress. The path to my fortress\n"
73          "is littered with my minions. Give up on the\n"
74          "thought of trying to reclaim her, you\n"
75          "haven't a chance! -Nolok\"\n"
76          "\n"
77          "Tux looks and see Nolok's fortress in\n"
78          "the distance. Determined to save his\n"
79          "beloved Gwen, he begins his journey.",
80          -5, 30);
81
82       white_small_text->draw_align("Press any button to continue!", 
83                                    screen->w/2, screen->h - 20, A_HMIDDLE, A_TOP);
84
85       flipscreen();
86       SDL_Delay(100);
87
88       done = wait_for_event(event,0);
89     }
90 }
91