Could someone please help by explaining why does the sprite leave the screen in 11a, instead of going around in a loop. Thank you!
Good question! I set up some watchers (see image below) and after the first loop, you will notice that alien.x and alien.y are both less than 50. The velocityY therefore is always set to -3 based on your code because alien.x stays < 50.
I’ll bet with a little tweaking, you can figure out how to fix that!
I don’t see why it’s working for the other three conditionals, but not for the last one. I’ve tried everything I could think off…
It’s probably the order of the code. Since it’s the last one run, it’s the last condition checked and it takes precedence over the other codes that are run.
You may look at adding multiple conditions… (if alien.y < 50 and alien.x < 50)… The last one would be (if alien.y >350 and alien.x <50)…
Does this help?