Back to index

freedink-data  1.08.20080920
FISH1.c
Go to the documentation of this file.
00001 //script for fish to jump out of water randomly, and be killed.
00002 
00003 void main( void )
00004   {
00005    //fish anim
00006    preload_seq(434);
00007    //splash anim
00008    preload_seq(433);
00009    sp_frame_delay(&current_sprite, 110);
00010    sp_hitpoints(&current_sprite, 25);
00011    //set to normal size
00012    sp_size(&current_sprite, 100);
00013    //give monster brain, but freeze
00014    sp_brain(&current_sprite, 9);
00015    freeze(&current_sprite);
00016   int &timer;
00017 
00018    int &splash;
00019 
00020   loop:
00021 
00022    //can't be hit or seen yet
00023    sp_nohit(&current_sprite, 1);
00024    sp_nodraw(&current_sprite, 1)
00025 
00026   //random wait
00027   &timer = random(6000,0);
00028   wait(&timer);
00029   playsound(35, 20000, 3000, &current_sprite, 0);
00030   //let's splash around
00031    sp_nohit(&current_sprite, 0);
00032    sp_nodraw(&current_sprite, 0)
00033    sp_seq(&current_sprite, 434);
00034    wait(700);
00035 
00036   //create splash sprite where fish is
00037 
00038   &save_x = sp_x(&current_sprite, -1);
00039   &save_y = sp_y(&current_sprite, -1);
00040   &save_y += 1;
00041   &save_x -= 30;
00042 
00043    &splash = create_sprite(&save_x, &save_y, 7, 0,0);
00044    sp_nohit(&splash, 1);
00045    sp_seq(&splash, 433);
00046    //playnoise
00047 
00048    goto loop;
00049 
00050   }
00051 
00052 
00053 void die( void )
00054 {
00055 
00056 
00057 //let's give 'em a random amount of exp, what fun!
00058 
00059  int &rand = random(100, 50);
00060  add_exp(&rand, &current_sprite);
00061 
00062  sp_brain(&current_sprite, 0);
00063 
00064   int &hold = sp_editor_num(&current_sprite);
00065   if (&hold != 0)
00066   editor_type(&hold, 6); 
00067 
00068 
00069  sp_active(&current_sprite, 0);
00070 
00071 
00072 }