Commit a6be157c authored by Matthew Trey's avatar Matthew Trey

simplified cascade.xml and laser.xml for now

removed a for loop in practice.c that was causing laser game instructions to hang
included cascade.xml and laser.xml back into the build
made scripting background image scale properly when in fullscreen
turned instructions back on in titlescreen.c 
(there actually isn't a button for laser instructions right now, but I imagine
that the menu shouldn't be messed with until the GSoC branch is merged?)


git-svn-id: svn://svn.debian.org/svn/tux4kids/tuxtype/trunk@1467 47d30e19-490b-0410-9d18-e851f4e465b3
parent 05348a0b
......@@ -4,8 +4,7 @@
scriptsdir = $(pkgdatadir)/scripts
dist_scripts_DATA = projectInfo.xml \
Lesson_1.xml
Lesson_1.xml \
cascade.xml \
laser.xml
## NOTE put these back in if we write them into a usable state
## cascade.xml \
## laser.xml
\ No newline at end of file
<script title="Fish Cascade Instructions">
<page>
<img src="lessons_bkg.png" x="0" y="0">
<img src="main_bkg.png" x="0" y="0">
<img src="tux/stand-.png" x="100" y="330">
<text color="#FFFFFF" align="center" size="32">Help Tux Eat Fish!</text>
<text color="#FFFFFF" align="center">Tux is very hungry! Eating</text>
<text color="#FFFFFF" align="center">fish with letters gives him</text>
<text color="#FFFFFF" align="center">a tummy ache. Help Tux</text>
<text color="#FFFFFF" align="center">eat fish by pressing the</text>
<text color="#FFFFFF" align="center">letters on the fish making</text>
<text color="#FFFFFF" align="center">them go away so he can</text>
<text color="#FFFFFF" align="center">eat them all!</text>
<text></text>
<text color="#ffffff" align="center" size="22">Press Space to Continue!</text>
</page>
<waitforinput/>
</page></lesson>
<script title="Comet Zap Instructions" background="main_bkg.jpg">
<page>
<img src="main_bkg.png" x="0" y="0">
<text align="center" size="28">Save The Cities From Falling Comets!</text>
<text align="center"t>Help Tux aim his laser beam by typing</text>
<text align="center">the letters on the comets. Type quickly,</text>
<text align="center">because if Tux can't destroy the comets</text>
<text align="center"t>before they hit the ground, the cities'</text>
<text align="center"t>shield will be destroyed. If they get hit</text>
<text align="center">again, the cities themselves will be</text>
<text align="center">destroyed! Lose all of your cities</text>
<text align="center">and the game is over.</text>
<text></text>
<text align="center" color="#ffffff" size="22">Press Space to Continue!</text>
</page>
<waitforinput/>
</page>
</lesson>
\ No newline at end of file
......@@ -65,7 +65,6 @@ void InstructCascade(void)
void InstructLaser(void)
{
char fn[FNLEN];
int i;
/* Try theme script first: */
if (!settings.use_english)
......@@ -73,11 +72,7 @@ void InstructLaser(void)
if (load_script( fn ) == 0) /* meaning successful load */
{
for (i = 0; i < 20; i++)
{
run_script();
SDL_Delay(500);
}
run_script();
return;
}
......@@ -87,14 +82,9 @@ void InstructLaser(void)
if (load_script( fn ) != 0)
return; // bail if any errors occur
for (i = 0; i < 20; i++)
{
run_script();
SDL_Delay(500);
}
run_script();
}
void ProjectInfo(void)
{
char fn[FNLEN];
......@@ -192,10 +182,14 @@ int TestLesson(void)
if (strlen(script_file->d_name) < 5)
continue;
/* Don't show project info file: */
if (strcmp(script_file->d_name, "projectInfo.xml") == 0)
/* Don't show project info file or instructions files */
if (strcmp(script_file->d_name, "projectInfo.xml") == 0 ||
strcmp(script_file->d_name, "laser.xml") == 0 ||
strcmp(script_file->d_name, "cascade.xml") == 0)
continue;
if (strcmp(&script_file->d_name[strlen(script_file->d_name) - 4],".xml"))
continue;
......@@ -965,13 +959,39 @@ static void run_script(void)
if (curPage->background)
{
SDL_Surface* img = LoadImage(curPage->background, IMG_ALPHA|IMG_NOT_REQUIRED);
SDL_BlitSurface(img, NULL, screen, NULL);
/* hack: since this is the background it needs to scale when in fullscreen
* but shouldn't every image scale when in fullscreen? assuming svg is for that... -MDT */
if (settings.fullscreen)
{
SDL_Surface* fsimg = zoom(img, fs_res_x, fs_res_y);
SDL_BlitSurface(fsimg, NULL, screen, NULL);
SDL_FreeSurface(fsimg);
}
else
{
SDL_BlitSurface(img, NULL, screen, NULL);
}
SDL_FreeSurface(img);
}
else if (curScript->background)
{
SDL_Surface* img = LoadImage(curScript->background, IMG_ALPHA|IMG_NOT_REQUIRED);
SDL_BlitSurface(img, NULL, screen, NULL);
/* hack: since this is the background it needs to scale when in fullscreen -MDT */
if (settings.fullscreen)
{
SDL_Surface* fsimg = zoom(img, fs_res_x, fs_res_y);
SDL_BlitSurface(fsimg, NULL, screen, NULL);
SDL_FreeSurface(fsimg);
}
else
{
SDL_BlitSurface(img, NULL, screen, NULL);
}
SDL_FreeSurface(img);
}
......
......@@ -624,19 +624,19 @@ void TitleScreen(void)
if (menu_opt == INSTRUCT)
{
// unload_media();
not_implemented();
// not_implemented();
unload_media();
// switch (sub_menu)
// {
// case CASCADE: InstructCascade(); break;
// case LASER: InstructLaser(); break;
// }
switch (sub_menu)
{
case CASCADE: InstructCascade(); break;
case LASER: InstructLaser(); break;
}
// load_media();
load_media();
// if (settings.menu_music)
// MusicLoad( "tuxi.ogg", -1 );
if (settings.menu_music)
MusicLoad( "tuxi.ogg", -1 );
redraw = 1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment