This commit is contained in:
yanshaoting 2024-04-12 22:48:03 +08:00
parent 452adedecd
commit 49388d4102
9 changed files with 35 additions and 40 deletions

View File

@ -3,8 +3,8 @@
"playground_size_w":400, "playground_size_w":400,
"playground_size_h":400, "playground_size_h":400,
"score_to_pass": 10, "score_to_pass": 10,
"food_1": 5, "food_1": 4,
"food_1_max": 5, "food_1_max": 4,
"food_2": 0, "food_2": 0,
"food_2_max": 0, "food_2_max": 0,
"food_3": 0, "food_3": 0,

View File

@ -1,8 +1,8 @@
{ {
"time_to_play": 350, "time_to_play": 400,
"playground_size_w":400, "playground_size_w":400,
"playground_size_h":400, "playground_size_h":400,
"score_to_pass": 20, "score_to_pass": 30,
"food_1": 5, "food_1": 5,
"food_1_max": 5, "food_1_max": 5,
"food_2": 1, "food_2": 1,

View File

@ -1,11 +1,11 @@
{ {
"time_to_play": 500, "time_to_play": 600,
"playground_size_w":400, "playground_size_w":400,
"playground_size_h":400, "playground_size_h":400,
"score_to_pass": 30, "score_to_pass": 50,
"food_1": 4, "food_1": 4,
"food_1_max": 4, "food_1_max": 5,
"food_2": 2, "food_2": 1,
"food_2_max": 2, "food_2_max": 2,
"food_3": 0, "food_3": 0,
"food_3_max": 0, "food_3_max": 0,

View File

@ -2,17 +2,17 @@
"time_to_play": 600, "time_to_play": 600,
"playground_size_w":400, "playground_size_w":400,
"playground_size_h":400, "playground_size_h":400,
"score_to_pass": 40, "score_to_pass": 80,
"food_1": 8, "food_1": 4,
"food_1_max": 8, "food_1_max": 8,
"food_2": 2, "food_2": 1,
"food_2_max": 2, "food_2_max": 3,
"food_3": 0, "food_3": 0,
"food_3_max": 0, "food_3_max": 0,
"garbage_1": 4, "garbage_1": 2,
"garbage_1_max": 4, "garbage_1_max": 4,
"garbage_2": 0, "garbage_2": 1,
"garbage_2_max": 0, "garbage_2_max": 1,
"garbage_3": 0, "garbage_3": 0,
"garbage_3_max": 0 "garbage_3_max": 0
} }

View File

@ -2,17 +2,17 @@
"time_to_play": 800, "time_to_play": 800,
"playground_size_w":400, "playground_size_w":400,
"playground_size_h":400, "playground_size_h":400,
"score_to_pass": 50, "score_to_pass": 80,
"food_1": 8, "food_1": 3,
"food_1_max": 8, "food_1_max": 6,
"food_2": 4, "food_2": 2,
"food_2_max": 4, "food_2_max": 4,
"food_3": 0, "food_3": 0,
"food_3_max": 0, "food_3_max": 0,
"garbage_1": 3, "garbage_1": 3,
"garbage_1_max": 3, "garbage_1_max": 5,
"garbage_2": 1, "garbage_2": 1,
"garbage_2_max": 1, "garbage_2_max": 2,
"garbage_3": 0, "garbage_3": 0,
"garbage_3_max": 0 "garbage_3_max": 0
} }

View File

@ -2,17 +2,17 @@
"time_to_play": 1000, "time_to_play": 1000,
"playground_size_w":400, "playground_size_w":400,
"playground_size_h":400, "playground_size_h":400,
"score_to_pass": 60, "score_to_pass": 80,
"food_1": 8, "food_1": 4,
"food_1_max": 8, "food_1_max": 8,
"food_2": 4, "food_2": 2,
"food_2_max": 4, "food_2_max": 4,
"food_3": 0, "food_3": 0,
"food_3_max": 0, "food_3_max": 0,
"garbage_1": 5, "garbage_1": 4,
"garbage_1_max": 5, "garbage_1_max": 6,
"garbage_2": 2, "garbage_2": 2,
"garbage_2_max": 2, "garbage_2_max": 3,
"garbage_3": 0, "garbage_3": 0,
"garbage_3_max": 0 "garbage_3_max": 0
} }

View File

@ -2,17 +2,17 @@
"time_to_play": 1200, "time_to_play": 1200,
"playground_size_w":500, "playground_size_w":500,
"playground_size_h":500, "playground_size_h":500,
"score_to_pass": 70, "score_to_pass": 90,
"food_1": 8, "food_1": 3,
"food_1_max": 8, "food_1_max": 8,
"food_2": 4, "food_2": 1,
"food_2_max": 4, "food_2_max": 4,
"food_3": 2, "food_3": 1,
"food_3_max": 2, "food_3_max": 2,
"garbage_1": 4, "garbage_1": 4,
"garbage_1_max": 4, "garbage_1_max": 6,
"garbage_2": 2, "garbage_2": 2,
"garbage_2_max": 2, "garbage_2_max": 3,
"garbage_3": 0, "garbage_3": 0,
"garbage_3_max": 0 "garbage_3_max": 0
} }

View File

@ -2,7 +2,7 @@
"time_to_play": 1400, "time_to_play": 1400,
"playground_size_w":650, "playground_size_w":650,
"playground_size_h":600, "playground_size_h":600,
"score_to_pass": 80, "score_to_pass": 100,
"food_1": 6, "food_1": 6,
"food_1_max": 10, "food_1_max": 10,
"food_2": 4, "food_2": 4,

View File

@ -55,6 +55,7 @@ class SwimmingSquid(PaiaGame):
self._winner = [] self._winner = []
self._foods_num = [] self._foods_num = []
self._foods_max_num = [] self._foods_max_num = []
self._add_score = {"1P":0, "2P":0}
self._init_game() self._init_game()
@ -156,7 +157,6 @@ class SwimmingSquid(PaiaGame):
hits = pygame.sprite.spritecollide(self.squid1, self.foods, True) hits = pygame.sprite.spritecollide(self.squid1, self.foods, True)
if hits: if hits:
for food in hits: for food in hits:
# self.ball.score += food.score
# growth play special sound # growth play special sound
self.squid1.eat_food_and_change_level_and_play_sound(food, self.sound_controller) self.squid1.eat_food_and_change_level_and_play_sound(food, self.sound_controller)
self._create_foods(food.__class__, 1) self._create_foods(food.__class__, 1)
@ -167,7 +167,6 @@ class SwimmingSquid(PaiaGame):
hits = pygame.sprite.spritecollide(self.squid2, self.foods, True) hits = pygame.sprite.spritecollide(self.squid2, self.foods, True)
if hits: if hits:
for food in hits: for food in hits:
# self.ball.score += food.score
# growth play special sound # growth play special sound
self.squid2.eat_food_and_change_level_and_play_sound(food, self.sound_controller) self.squid2.eat_food_and_change_level_and_play_sound(food, self.sound_controller)
self._create_foods(food.__class__, 1) self._create_foods(food.__class__, 1)
@ -383,10 +382,6 @@ class SwimmingSquid(PaiaGame):
] ]
game_obj_list.extend(foods_data) game_obj_list.extend(foods_data)
backgrounds = [ backgrounds = [
# create_image_view_data("background", 0, 0, WIDTH, HEIGHT),
# create_rect_view_data(
# "playground", self.playground.x, self.playground.y,
# self.playground.w, self.playground.h, PG_COLOR)
create_image_view_data( create_image_view_data(
'bg', self.playground.x, self.playground.y, 'bg', self.playground.x, self.playground.y,
self.playground.w, self.playground.h) self.playground.w, self.playground.h)