daily pastebin goal
42%
SHARE
TWEET

Untitled

a guest Jul 19th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. stage.set_background("spring")
  2.  
  3. cat = codesters.Sprite("blackcat")
  4. cat.set_gravity_off()
  5.  
  6. cat.set_physics_off()
  7.  
  8.  
  9.  
  10.  
  11. # sprite = codesters.Text("text")
  12. sprite = codesters.Text("use the space bar to shot at zombies and r to reload ")
  13.  
  14.  
  15.  
  16. wait_Time = 9
  17. #my_display = codesters.Display(my_var, x, y)
  18. my_display = codesters.Display(wait_Time, -200, 150)
  19. for counter in range(9 ):
  20.     # add code here
  21.     wait_Time -= 1
  22.     my_display.update(wait_Time)
  23.     stage.wait(1)
  24.  
  25. cat.go_to(-203, -164)
  26.  
  27.  
  28. fun = 0
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.    
  47.  
  48. # sprite = codesters.Rectangle(x, y, width, height, "color")
  49. b1 = codesters.Rectangle(0, 0, 100, 10, "black")
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57. zom = codesters.Sprite("zombie1")
  58. zom.go_to(199, -125)
  59.      
  60.  
  61. score = 1
  62. def collision(b1, hit_sprite):
  63.     my_var = hit_sprite.get_image_name()
  64.     if my_var == "zombie1":
  65.         #ed
  66.         score = 0
  67.  
  68.  
  69.  
  70.  
  71.  
  72.        
  73.        
  74.  
  75.  
  76.        
  77.        
  78.  
  79.  
  80.        
  81.        
  82.        
  83.        
  84.  
  85.        
  86.        
  87.        
  88.  
  89.  
  90.        
  91.        
  92.  
  93. b1.event_collision(collision)
  94.  
  95.      # add any other actions...
  96.      
  97.  
  98. def up_key():
  99.     cat.move_up(20)
  100.     # add other actions...
  101.    
  102. stage.event_key("up", up_key)
  103.  
  104.  
  105. def down_key():
  106.     cat.move_down(20)
  107.     # add other actions...
  108.    
  109. stage.event_key("down", down_key)
  110.  
  111.  
  112.  
  113. b1.go_to(-203, -164)    
  114.  
  115. def space_bar():
  116.     b1 = codesters.Rectangle(0, 0, 100, 10, "black")
  117.     x_position = b1.get_x()
  118.     y_position = b1.get_y()
  119.     print(x_position)
  120.     sprite.move_left(999)
  121.  
  122.    
  123.     # add other actions...
  124.    
  125. stage.event_key("space", space_bar)
  126.  
  127.  
  128. def a_key():
  129.     # add other actions...
  130.     b1.go_to(-203, -164)
  131.    
  132. stage.event_key("r", a_key)
  133.  
  134.  
  135.  
  136.  
  137. for counter in range(999):
  138.     print(counter)
  139.     z = codesters.Sprite("zombie1")
  140.     z.go_to(199, -125)
  141.     z.move_left(500)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top