Created
May 26, 2020 22:08
-
-
Save KramKroc/f89555f19b4481c701db186501ee5364 to your computer and use it in GitHub Desktop.
Random position when appearing from the left
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
WIDTH = 600 | |
HEIGHT = 400 | |
alien = Actor('alien', midbottom=(100,200)) | |
def draw(): | |
screen.clear() | |
alien.draw() | |
def update(): | |
alien.left += 5 | |
if alien.left > WIDTH: | |
alien.topright = 0, random.randint(25, 375) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment