Final Project - Anika & Jordan

1. Click Run To Read the Directions and Play The Game 2. You only get 3 lives! Use them sparingly! By: Anika and Jordan

a = 0 directions = codesters.Text('''Welcome to Our Game Try to get as many points as you can by collecting candy and rescuing purple guys Don't get hit by slimeballs and enemies, slimeballs take away a life, and enemies END the game! Good Luck!''',0,200) stage.wait(15) directions.set_opacity(0) stage.set_background("silo") stage.set_gravity(10) stage.set_bounce(.2) stage.disable_right_wall() stage.disable_left_wall() astro = codesters.Sprite("astronaut2", -200, 0) astro.set_size(.8) score = 0 score_board = codesters.Display(score) lives = 3 lives_board = codesters.Display(lives, 200, 200) def up_key(): astro.jump(15) astro.say(" ") stage.event_key("up", up_key) def collision(sprite, hit_sprite): global score global lives name = hit_sprite.get_image_name() if name == "purpleguy": stage.remove_sprite(hit_sprite) score += 2 score_board.update(score) if name == "enemy": stage.remove_sprite(hit_sprite) sprite.say("ouch!") lives -= 3 lives_board.update(lives) if name == "candycorn": stage.remove_sprite(hit_sprite) score += 1 score_board.update(score) if name == "slimeballs": stage.remove_sprite(hit_sprite) sprite.say("ouch!") lives -= 1 lives_board.update(lives) if lives < 1: text = codesters.Text("Game Over", 0, 150, "red") astro.hide() astro.event_collision(collision) enemy_list = [] purple_list= [] candycorn_list = [] slime_list = [] x = 100 y = 300 z = 500 b = 700 while a == 0: candycorn = codesters.Sprite("candycorn", x, -100) candycorn.set_size(.7) candycorn.set_x_speed(-3) candycorn_list.append(candycorn) x += 100 enemy = codesters.Sprite("enemy", y, -160) enemy.set_size(.6) enemy.flip_right_left() enemy.set_x_speed(-3) enemy_list.append(enemy) y += 500 slime = codesters.Sprite("slimeball", z, -50) slime.set_size(.6) slime.set_x_speed(-3) slime_list.append(slime) z += 300 purple = codesters.Sprite("purpleguy", b, -200) purple.set_size(.8) purple.set_x_speed(-3) purple_list.append(purple) b += 400
Support