Computer Science Department |
CSCI 135 |
Console output. Your StayingAlive.py program should output the intial game state to the console (command) window:stars.jpg dont_panic_40.png 0.5 0.5 0.035 100 6 asteroid_small.png 0.1 0.1 0.018 -0.002 -0.003 asteroid_medium.png 0.2 0.2 0.030 0.002 -0.003 asteroid_large.png 0.3 0.3 0.065 -0.002 0.003 asteroid_small.png 0.4 0.4 0.018 -0.001 -0.004 asteroid_medium.png 0.6 0.6 0.030 0.002 -0.003 asteroid_large.png 0.7 0.7 0.065 -0.0035 0.0025 # Hitchhikers Guide to the Galaxy: Avoid a bunch of asteroids # <background image> # <player image> <player x-position> <player y-position> <player radius> <player speed factor> # <number enemies> # <enemy0 image> <enemy0 x-position> <enemy0 y-position> <enemy0 radius> <enemy0 x-velocity> <enemy0 y-velocity> # <enemy1 image> <enemy1 x-position> <enemy1 y-position> <enemy1 radius> <enemy1 x-velocity> <enemy1 y-velocity> # ...
Canvas size and coordinates. In this assignment, we'll leave the canvas size at the default size of 512 x 512 pixels. We will also use the default coordinate system which has the lower-left corner being (0.0, 0.0) and the upper-right corner being (1.0, 1.0). Thus in this assignment you do NOT need to call methods such as StdDraw.setCanvasSize(), StdDraw.setXscale(), or StdDraw.setYscale().% python StayingAlive.py hitchhiker.txt PLAYER: (0.5, 0.5) r=0.035 speed=100 ENEMY 0: (0.1, 0.1) vel (-0.0020, -0.0030) r=0.018 ENEMY 1: (0.2, 0.2) vel (0.0020, -0.0030) r=0.03 ENEMY 2: (0.3, 0.3) vel (-0.0020, 0.0030) r=0.065 ENEMY 3: (0.4, 0.4) vel (-0.0010, -0.0040) r=0.018 ENEMY 4: (0.6, 0.6) vel (0.0020, -0.0030) r=0.03 ENEMY 5: (0.7, 0.7) vel (-0.0035, 0.0025) r=0.065
Grade Item | Staying Alive | Points Earned |
---|---|---|
Header Comment | 2 |
|
Program Compiles and Runs | 4 |
|
File Read In Correctly | 4 |
|
Background Draws | 2 |
|
Player Methods Implemented | 4 |
|
Player Drawn Correctly | 2 |
|
Enemy Methods Implemented | 4 |
|
Correct Enemies Drawn | 2 |
|
Mouse Move Player Correctly | 2 |
|
Enemies Move Correctly | 2 |
|
Score Display | 2 |
Page last updated: August 16, 2021