Programming Challenges

Space Challenge

Timing: Weeks 7-12Weighting: 30%Goal: To complete as many successful missions as possible before launching the rocket to the Mars Outpost. Get ready to carry out successful missions and establish the Mars Outpost. BackgroundPeople have long been fascinated by Mars, the planet in our solar system that’s most like Earth. Uncrewed missions have sent orbiters, probes,

Space Challenge Read More »

8. Racey – Direction Vectors

Now we want to add a vector for movement. STEP ONE: MODIFYING THE INIT FUNCTION Inside our class initialisation function ( __init__) we can create a vector for movement add the following to the __init__ function # Create a random speed vector.movespeed = random.randint(1, 10)directionx = random.random()*movespeed * random.choice((-1, 1))directiony = random.random()*movespeed * random.choice((-1, 1))self.vector

8. Racey – Direction Vectors Read More »