image move in pygame (crashes pygame)
<p>i'm trying to make a game and when this loop runs, it crashes pygame</p>

<pre><code>while poterbar_hunt_pone == True and ptwo_shot == True:

            if poterbarx &lt; xone+carone_width:
                poterbar_dir = "right"
                poterbarx_c = 20
            else:
                poterbar_dir = "left"
                poterbarx_c = -20

            if poterbary+poterbarh &lt; yone:
                poterbary_c = 20
            else:
                poterbary_c = -20

            if poterbarx &lt;= xone+carone_width and poterbarx+poterbarw &gt;= xone:

                if poterbary+poterbarh &gt;= yone and poterbary &lt;= yone+carone_height:
                    xone_change = random.randrange (-20, 20)
                    yone_change = random.randrange (-20, 20)
                    poterbar_hunt_pone = False
                    ptwo_shot = False
                    poterbarx = -100
                    poterbary = -100
</code></pre>

<p>when both values are True pygame crashes and i think is in the movement of poterbar.
if anyone of you guys know about what causes pygame to crash please let me know</p>