random stationary points

edited January 31 in Python Mode

Hi guys! I need to draw many stationary (so without using random) points, and the code should be written after #Stars. Can you help me??

h = hour()
def setup():
  size(1000, 700)
  frameRate(27)

def draw():

  translate(width/2, height/2)

  if 0<=h<=11:
    background(192, 192, 192)
  else:
    background(0, 0, 0)

    #Stars

Answers

  • Which part of this is giving you trouble? What are you confused about?

    Break your problem down into smaller steps and take those steps on one at a time. Can you draw a single star? Can you draw two stars? Work your way forward in small steps like that, and post a MCVE along with a more specific question. Good luck.

    Hint: You could use random() to create the positions in setup(), that way they're random and stationary...

  • Thank you Kevin, I managed to make that using createGraphics() in the setup.

Sign In or Register to comment.