File: level011.py

package info (click to toggle)
krank 0.7%2Bdfsg2-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 68,072 kB
  • sloc: python: 3,422; sh: 31; makefile: 11
file content (28 lines) | stat: -rw-r--r-- 827 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

import k
from Part import *

def init():
    k.sound.loadTheme('industry')
    k.sound.music()
    k.world.setBackground('level-11')

    cx, cy, w, h = k.world.rect.centerx, k.world.rect.centery, k.world.rect.width, k.world.rect.height
        
    k.particles.add(Particle({'pos': (cx, cy), 'color': 'white'}))    
        
    # chains
    num = k.config.stage * 6
    k.particles.chainCircle((cx, cy), 'blue', num, 200)
            
    # anchors
    anchor = [(cx, cy-100),
              (cx, cy+100),
              (cx+100, cy),
              (cx-100, cy)]
    for i in range(len(anchor)):
        n = i < 2 and (k.config.stage == 3 and 3 or 1) or min(2, k.config.stage)
        k.particles.add(Anchor({'pos':anchor[i], 'color': 'blue', 'maxLinks': n}))
        
    # simple player
    k.player.setPos((cx+200,cy+150))