def drawGamePlayLevel1():
global life, time, score, stageNum
image(palace, 0, 0, width, height)
if (millis()-startTime)/1000 == 2:
alive[0] = True
if (millis()-startTime)/1000 == 4:
alive[1] = True
if (millis()-startTime)/1000 == 6:
alive[2] = True
if (millis()-startTime)/1000 == 8:
alive[3] = True
if (millis()-startTime)/1000 == 10:
alive[4] = True
if (millis()-startTime)/1000 == 12:
alive[5] = True
if (millis()-startTime)/1000 == 14:
alive[2] = True
if (millis()-startTime)/1000 == 16:
alive[3] = True
if (millis()-startTime)/1000 == 18:
alive[4] = True
if (millis()-startTime)/1000 == 20:
alive[1] = True
for i in range(totalNum):
if (alive[i] == True):
y[i] = y[i] + 2
for i in range (3, 6, 1):
aLeft = x[i]
aRight = x[i] + w[i]
aTop = y[i]
aBottom = y[i] + h[i]
bLeft = mouseX - princeW/2
bRight = mouseX + princeW/2
bTop = mouseY - princeH/2
bBottom = mouseY + princeH/2
if (alive[i] == True and aTop < bBottom and bTop < bBottom and aLeft < bRight and bLeft < aRight):
life = life - 1
alive[i] = False
for i in range (0, 3, 1):
aLeft = x[i]
aRight = x[i] + w[i]
aTop = y[i]
aBottom = y[i] + h[i]
bLeft = mouseX - princeW/2
bRight = mouseX + princeW/2
bTop = mouseY - princeH/2
bBottom = mouseY + princeH/2
if (alive[i] == True and aTop < bBottom and bTop < bBottom and aLeft < bRight and bLeft < aRight):
score = score + 1
alive[i] = False
Dear all, this is part of my code. I initial all as false at first, and set it to true when certain time is reached. But when time is reached, nothing is shown in the screen except the mouse… I want the images fall down from the top one by one every 2 seconds, and want it to be disappear when it collides with the mouse… Thank you so much!!!