示例#1
0
solids.append(plank)

movingPlank = MovingSolidX(color_palette.BROWN, startX, startY, plankLength,
                           plankThickness, xEnds, False)
solids.append(movingPlank)

goalWidth = 100
goalHeight = 150
goal = Goal(
    color_palette.WHITE,
    [(correctionTerm2 + plankThickness + 7 * plankLength + plankThickness * 2 +
      plankThickness * 3 + plankLength,
      waterLevel + plankThickness * 7 + goalHeight, goalWidth, goalHeight)])
solids.append(goal)

secretPlatform = Solid(
    color_palette.BROWN,
    [(STAGE_WIDTH - secretGapWidth, 110, secretGapWidth, 50)])
solids.append(secretPlatform)
solids.append(water)

startX = plankThickness + plankLength / 2
startY = int(HEIGHT / 2)
character = Character(screen, startX, startY, (255, 215, 0), 50)
isPeriodic = False
stage = Stage(screen, character, isPeriodic, STAGE_WIDTH, STAGE_HEIGHT, solids)

if __name__ == '__main__':
    stage.DrawStage(1200)
    input('press anything to exit')
示例#2
0
      platformSpacing * 5),
     (STAGE_X_SHIFT + platformSpacing + 400 + 450 + 800 + 600 +
      platformWidth * 4, groundLevel + platformSpacing * 4, platformWidth,
      platformSpacing * 4),
     (STAGE_X_SHIFT + platformSpacing + 400 + 450 + 800 + 600 +
      platformWidth * 5, groundLevel + platformSpacing * 3, platformWidth,
      platformSpacing * 3),
     (STAGE_X_SHIFT + platformSpacing + 400 + 450 + 800 + 600 +
      platformWidth * 6, groundLevel + platformSpacing * 2, platformWidth,
      platformSpacing * 2),
     (STAGE_X_SHIFT + platformSpacing + 400 + 450 + 800 + 600 +
      platformWidth * 7, groundLevel + platformSpacing * 1, platformWidth,
      platformSpacing * 1)])
solids.append(stairs)

secretPlatform = Solid(RED,
                       [(700, platformSpacing * 12, platformWidth * 5, 50)])
solids.append(secretPlatform)

goal = Goal(WHITE,
            [(STAGE_WIDTH - platformWidth - 50, groundLevel + platformSpacing,
              platformWidth, platformSpacing)])
solids.append(goal)

isPeriodic = False
stage = Stage(screen, character, isPeriodic, STAGE_WIDTH, STAGE_HEIGHT, solids)

if __name__ == '__main__':
    stage.DrawStage(800)
    input('press anything to exit')