title: How to draw multiple bitmaps on canvas?
body: <p>I want to develop a game that shoots bullets on every touch of the canvas. 
  It works but when I touch the canvas after shooting, he takes the bullet and restarts the shooting.
  I just want the bitmap to create new bullet at every touch. Here is my code:</p>
  
  <pre><code>public class MainActivity extends Activity implements OnTouchListener {
  
      DrawBall d;
      int x ;
      int y;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
           d = new DrawBall(this);
          d.setOnTouchListener(this);
          setContentView(d);
      }
  
      public class DrawBall extends View {
  
          Bitmap alien;
  
          public DrawBall(Context context) {
              super(context);
              alien = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
          }
  
          @Override
          protected void onDraw(Canvas canvas) {
              super.onDraw(canvas);
  
              startDraw(canvas);
          }
  
          public void startDraw(Canvas canvas){
              Rect ourRect = new Rect();
              ourRect.set(0,0, canvas.getWidth(), canvas.getHeight());
  
              Paint blue = new Paint();
              blue.setColor(Color.BLACK);
              blue.setStyle(Paint.Style.FILL);
  
              canvas.drawRect(ourRect, blue);
  
              if(y &lt; canvas.getHeight()){
                  y-=5;
              }
  
              canvas.drawBitmap(alien, x, y,new Paint());
  
              invalidate();
          }
      }
  
      public boolean onTouch(View v, MotionEvent event) {
  
          x = (int) event.getX();
          y = (int) event.getY();
  
          return false;
      }
  }
  </code></pre>