Skip to content

Instantly share code, notes, and snippets.

@KramKroc
Created May 26, 2020 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KramKroc/f89555f19b4481c701db186501ee5364 to your computer and use it in GitHub Desktop.
Save KramKroc/f89555f19b4481c701db186501ee5364 to your computer and use it in GitHub Desktop.
Random position when appearing from the left
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