okey, jetz wollte ich noch, dass das Raumschiff
nicht nur einmal schießt sondern öffters ...

-> ich hab das ganze jetzt in ein block namens shoot
gepackt

Code:
function space_ship()
...
  if (key_space)  
  {
   wait(25);
   shoot_1(i);
  }
  ...
  wait(1);
 }
}


function shoot_1(i)
{  
 snd_play(laser, 90, 0); 

 _shoot[i] = pan_create("bmap = shot.bmp;",1);
 _shoot[i].pos_x = _ship.pos_x+30;
 _shoot[i].pos_y = _ship.pos_y-20;  
 _shoot[i].flags = VISIBLE;
 
  
 while(_shoot[i] != NULL)
 {
 	_shoot[i].pos_y -= 0.5*time_step;
   if(_shoot[i].pos_y > 5)
   {
    _shoot[i].pos_y -= 0.5*time_step;	      
   }
   else
   {
    reset(_shoot[i],VISIBLE); 
    break;
   }   
  
   
  wait(1);
 }
 
 _shoot[i] = NULL;	
}



problem: das raumschiff lässt sich werend des schießen nicht mehr steuern
und wenn ich wait(25) entferne dann kommen zu viele glecihzeitig

problem 2: die schüsse bewegen sich solange weiter bis ich leertaste drücke
dannach nicht mehr, immer nur ein einzigster oder ich kann damit malen

tongue
ich glaube ein bild sagt alles ...


Last edited by ratz; 11/09/13 14:21.