How to control Objects in conditions?

I am making an interactive stuff, and has met a problem. How the candy falls down to the bottom of the screen, when ''s1State==Arduino.HIGH''. And how "candies" can be like building a house, rather than being overlapped, when ''s1State==Arduino.HIGH" happens?

import ddf.minim.*;//declare 
AudioPlayer player;//upload Music
Minim minim;////upload 5 Music based on sensor1-5

[code]PShape scandies; // upload SVG image
PShape scandy1; // upload SVG image getchild
PShape scandy2;
PShape scandy3;
PShape scandy4;
PShape scandy5; // upload SVG image getchild


import org.firmata.*;//library connecting Arduino
import cc.arduino.*;
import processing.serial.*;
Arduino arduino;



int s1 = 7;//(r)(247,142,142) //sensor1
int s2 = 8;//(y)(239,255,75) //sensor2
int s3 = 9;//(b)(77,201,224) //sensor3
int s4 = 10;//(g)(105,227,87)//sensor4
int s5 = 11;//(b)(0,0,100)//sensor5
float x = 0;
float y = 0;
int time;

void setup() {
// minim=new Minim(this);//
// player=minim.loadFile(".mp3");//locate file
// player.play();

scandies = loadShape("scandies.svg");//svg
scandy1 = scandies.getChild("scandy1");//getChild from scandies
//scandy2 = scandies.getChild("scandy2");
scandy3 = scandies.getChild("scandy3");
//scandy4 = scandies.getChild("scandy4");
//scandy5 = scandies.getChild("scandy5"); //getChild from scandies


  size(1028, 720);
  background(255);
  println(Arduino.list());

  arduino = new Arduino(this, Arduino.list()[4], 57600); 

  arduino.pinMode(s1, Arduino.INPUT);
  arduino.pinMode(s2, Arduino.INPUT);
  arduino.pinMode(s3, Arduino.INPUT);
  arduino.pinMode(s4, Arduino.INPUT);
  arduino.pinMode(s5, Arduino.INPUT);

  time = 0;
}


[b]void draw() {
  background(255);
  int s1State = arduino.digitalRead(s1);
  if (s1State==Arduino.HIGH) {
    ellipse(width/2, height/2, 230, 230);
  }

  switch (time) {

   ___**case 4:      //sensor1 //1in the fourth second, a circle (sensor1 color) will appaer(), etc..
 //2 Do something(one (sensor1(red one))of the candies will fall down, etc, if sensor1 is activated, it will be down to the bottom, vise versa. )
 //3 Do something (Output music1 when sensor1 is activated, etc..
 stroke(247,142,142);
strokeWeight(30);
ellipse(width/2,height/2, 500, 500);
 if (s1State==Arduino.HIGH) {

  //ellipse(width/2, height/2, 500, 230);
    shape(scandy1,x,y);
    y+=20;

  }
 break;
case 6:       //sensor3
stroke(77,201,224);
strokeWeight(30);
ellipse(width/2,height/2, 500, 500);
shape(scandy3,x,y);
y+=20;

if (s1State==Arduino.HIGH) {
    //ellipse(width/2, height/2, 500, 230);
    shape(scandy3,x,y);

  }

break;[/b]

case 8:       //sensor2
// Do something

 break;


case 9:       //sensor5
// Do something

break;


case 11:       //sensor3
//Do something

// break;



  }

  //Increment time
  if (frameCount % 60 == 0) {
    time++;
  }
}

Your problem has nothing to do with the Arduino, and everything to do with general Java programming using Processing. This is not a Java forum or a Processing forum.