File: level025.py

package info (click to toggle)
krank 0.7%2Bdfsg2-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 68,092 kB
  • sloc: python: 3,421; sh: 31; makefile: 11
file content (46 lines) | stat: -rw-r--r-- 1,375 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

import k
from Part import *

def init():
    k.sound.loadTheme('water')
    k.sound.music()
    k.world.setBackground('level-25')
    
    cx, cy, w, h = k.world.rect.centerx, k.world.rect.centery, k.world.rect.width, k.world.rect.height

    # particles
    num = [2,4,4][k.config.stage-1]
    k.particles.ballCircle((cx, cy), 'orange', num, h*0.32)
    
    # chains
    num = [8, 16, 16][k.config.stage-1]
    k.particles.chainCircle((cx, cy), 'white', num, h*0.42)

    num = [4, 4, 12][k.config.stage-1]
    k.particles.chainCircle((cx, cy), 'blue', num, h*0.32, -math.pi/2-math.pi/4)
        
    # anchors
    d = 120
    anchor = [(cx, cy-d),
              (cx+d, cy),
              (cx, cy+d),
              (cx-d, cy),]
    for i in range(len(anchor)):
        num = k.config.stage == 1 and 1 or 2
        k.particles.add(Anchor({'pos':anchor[i], 'color': 'white', 'maxLinks': num}))

    d = 50
    anchor = [(cx, cy),
              (cx-d, cy-d),
              (cx+d, cy+d),
              (cx-d, cy+d), 
              (cx+d, cy-d),
              ]
    num_anchor = [3, 5, 5][k.config.stage-1]
    for i in range(num_anchor):
        num = i == 0 and (min(4, k.config.stage*2)) or [1,1,3][k.config.stage-1]
        k.particles.add(Anchor({'pos':anchor[i], 'color': 'blue', 'maxLinks': num}))
        
    # simple player
    k.player.setPos((cx+w*0.23,cy+h*0.38))