platformTypeWater = 5
platformTypeRaftcastle = 6
platformTypeFloating = platformTypeRaftcastle
- platformTypeBreaking = 7
- platformTypeTheEnd = 8
- platformTypeWonTheGame = 9
+ platformTypeLucky = 7
+ platformTypeBreaking = 8
+ platformTypeTheEnd = 9
+ platformTypeWonTheGame = 10
itemTypeAccelerator = 0
itemTypeBeanie = 1
scoreGrass = 2193
scoreAfterLucky = 2315
scoreCastle = 2825
+ scoreLucky = 2976
scoreRaftcastle = 3031
scoreWater = 3043
scoreTheEnd = 3089
pygame.image.load("assets/platformWater2f.png").convert_alpha() ]
self.imgPlatformAfterLucky = pygame.image.load("assets/platformAfterLucky.png").convert_alpha()
self.imgPlatformCastle = pygame.image.load("assets/platformCastle.png").convert_alpha()
+ self.imgPlatformLuckySleeping = pygame.image.load("assets/platformLuckySleeping.png").convert_alpha()
+ self.imgPlatformLuckyAttacking = pygame.image.load("assets/platformLuckyAttacking.png").convert_alpha()
self.imgPlatformRaftcastle = pygame.image.load("assets/platformRaftcastle.png").convert_alpha()
self.imgPlatformGrapevine = pygame.image.load("assets/platformGrapevine.png").convert_alpha()
self.imgPlatformBreaking = pygame.image.load("assets/platformBreaking.png").convert_alpha()
self.hadPrickly = False
self.hadAfterLucky = False
self.hadCastle = False
+ self.hadLucky = False
self.hadTheEnd = False
self.raftcastleHasFlag = False
self.platforms = [[self.playerx, self.playery + self.sy // 6, self.platformTypeSand, 0, 0]]
else:
self.jump = self.sy // 20
self.gravity = 0
- if (p[2] == self.platformTypeAfterLucky or p[2] == self.platformTypeCastle) and self.playerCarriesFlag and not p[-2]:
+ if p[2] == self.platformTypeLucky and not self.playerCarriesFlag and p[-2] <= 0:
+ self.xmovement = self.sx // 20
+ self.direction = 0
+ self.cameray -= self.sy // 12
+ p[-2] = -1
+ elif (p[2] == self.platformTypeAfterLucky or p[2] == self.platformTypeCastle or p[2] == self.platformTypeLucky) and self.playerCarriesFlag and not p[-2]:
self.playerCarriesFlag = False
p[-2] = True
self.sandcastles += 1
elif self.score > self.scoreCastle and not self.hadCastle:
self.hadCastle = True
return self.platformTypeCastle
+ elif self.score > self.scoreLucky and not self.hadLucky:
+ self.hadLucky = True
+ return self.platformTypeLucky
else:
return self.platformTypeGrass
else:
self.hadTheEnd = True
elif platformType == self.platformTypeWater or platformType == self.platformTypeRaftcastle:
self.platforms.append([random.randint(0, self.sx * 7 // 8), self.platforms[-1][1] - self.sy // 8, platformType, False, False])
+ elif platformType == self.platformTypeLucky:
+ self.platforms.append([0, self.platforms[-1][1] - self.sy // 12, platformType, False, False])
else:
self.platforms.append([random.randint(0, self.sx * 7 // 8), self.platforms[-1][1] - self.sy // 12, platformType, False, False])
if platformType <= self.platformTypeNormal:
if p[-2]:
self.screen.blit(self.imgFlagRight, (p[0] + self.imgPlatformCastle.get_width() - 16, p[1] - 4 - self.cameray))
self.screen.blit(self.imgPlatformCastle, (p[0], p[1] - self.cameray))
+ elif p[2] == self.platformTypeLucky:
+ if p[-2]:
+ self.screen.blit(self.imgPlatformLuckyAttacking, (p[0], p[1] - self.imgPlatformLuckyAttacking.get_height() + self.imgPlatformLuckySleeping.get_height() - self.cameray))
+ if p[-2] > 0:
+ self.screen.blit(self.imgFlagRight, (p[0] + self.imgPlatformLuckyAttacking.get_width() - 8, p[1] - 11 - self.cameray))
+ else:
+ self.screen.blit(self.imgPlatformLuckySleeping, (p[0], p[1] - self.cameray))
elif p[2] == self.platformTypeRaftcastle:
if self.raftcastleHasFlag:
self.screen.blit(self.imgFlagRight, (p[0] + 50, p[1] - 13 - self.cameray))