# The pictures are not displaying

**URL:** https://discourse.processing.org/t/the-pictures-are-not-displaying/36190
**Category:** Processing.py
**Created:** [April 7, 2022, 12:35pm UTC](https://discourse.processing.org/t/the-pictures-are-not-displaying/36190 "2022-04-07T12:35:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![muffininwinter](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@muffininwinter](https://discourse.processing.org/u/muffininwinter)
#### Post date: [April 7, 2022, 12:35pm UTC](https://discourse.processing.org/t/the-pictures-are-not-displaying/36190/1 "2022-04-07T12:35:21Z")

</div>

```auto
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!!! 😭

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [April 7, 2022, 1:05pm UTC](https://discourse.processing.org/t/the-pictures-are-not-displaying/36190/2 "2022-04-07T13:05:47Z")

</div>

> [@muffininwinter](#):
>
> `startTime)/1000 ==`

won’t work

Try without /1000 and then check for \> 1000

---

<div class="post-metadata">

### Author: ![SomeOne](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/someone/32/8639_2.png) [@SomeOne](https://discourse.processing.org/u/SomeOne)
#### Post date: [April 7, 2022, 1:07pm UTC](https://discourse.processing.org/t/the-pictures-are-not-displaying/36190/3 "2022-04-07T13:07:32Z")

</div>

I think none of your conditions are ever true. You use exact timings `(millis()-startTime)/1000 == 2` but how likely it is that timer evens with 2000 when that part of code is run. Draw() cycle runs by default 60 times a second, but it’s not guarantied. So you cannot know that 120th frame would be at 2000 millis. It could be 2001 or 1999 and your test misses it. Besides comparing a float to an integer is doomed to fail. By nature of floats result of division 2000/1000 is not 2.0, but can be something very close to it like 2.0000001.  
So you should test `(millis()-startTime)/1000 >= 1.95 and (millis()-startTime)/1000 <= 2.05`. If it still doesn’t trigger your draw you need to widen the range a bit. You can probably narrow it a lot: (1.99 and 2.01) should work.
