Back to index

freedink-data  1.08.20080920
SFOOD.c
Go to the documentation of this file.
00001 //this script fills life up, from a small food
00002 
00003 void main( )
00004 {
00005         sp_touch_damage(&current_sprite, -1);
00006         sp_nohit(&current_sprite, 1);
00007 
00008 }
00009 
00010 void touch( void )
00011 {
00012 &life += 3;
00013 if (&life > &lifemax)
00014  {
00015  &life = &lifemax;
00016  }
00017 Playsound(10,22050,0,0,0);
00018 sp_brain_parm(&current_sprite, 10);
00019 say("Yum!",1);
00020 sp_brain(&current_sprite, 12);
00021 sp_touch_damage(&current_sprite, 0);
00022 sp_timing(&current_sprite, 0);
00023 
00024   int &hold = sp_editor_num(&current_sprite);
00025   if (&hold != 0)
00026     {
00027      //this was placed by the editor, lets make it not come back
00028      editor_type(&hold, 1); 
00029      //kill food forever
00030     }
00031 
00032 
00033 }
00034