fork download
  1. # ==========================================
  2. # DAMMAKU CATCH GAME - MAIN SYSTEM CODE
  3. # ==========================================
  4.  
  5. background_x = 0
  6. sprite1_x = 0
  7. sprite1_y = -100
  8. current_costume = "costume1"
  9. is_draggable_all = False
  10.  
  11. def setup():
  12. global background_x, sprite1_x, sprite1_y, is_draggable_all
  13. sprite1_x = 0
  14. sprite1_y = -100
  15. background_x = 0
  16. is_draggable_all = True
  17. show_ui()
  18. move_ui_to_back()
  19.  
  20. def update_game_loop():
  21. global background_x
  22. sprite2_x = background_x
  23. if check_collision_with_sprite1():
  24. on_receive_move_right()
  25. elif check_collision_with_sprite3():
  26. on_receive_move_left()
  27.  
  28. def on_receive_move_right():
  29. global sprite1_x, background_x, current_costume
  30. current_costume = "costume1"
  31. if sprite1_x < 0:
  32. sprite1_x += 7
  33. else:
  34. if background_x == -385:
  35. if sprite1_x < 240:
  36. sprite1_x += 7
  37. else:
  38. background_x -= 7
  39.  
  40. def on_receive_move_left():
  41. global sprite1_x, background_x, current_costume
  42. current_costume = "costume2"
  43. if background_x == 385:
  44. if sprite1_x > 0:
  45. sprite1_x -= 7
  46. else:
  47. background_x += 7
  48.  
  49. def show_ui(): pass
  50. def move_ui_to_back(): pass
  51. def check_collision_with_sprite1(): return False
  52. def check_collision_with_sprite3(): return False
  53.  
  54.  
Success #stdin #stdout 0.05s 63164KB
stdin
Standard input is empty
stdout
Standard output is empty