File: level029.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,336 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('space')
    k.sound.music()
    k.world.setBackground('level-29')
    
    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': 'blue'}))
    
    # chains
    num = [6,12,16][k.config.stage-1]
    k.particles.chainCircle((cx, cy), 'orange', num, h*0.42)

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

    d = 50
    anchor = [(cx-d, cy-d),
              (cx+d, cy-d),
              (cx+d, cy+d),
              (cx-d, cy+d), ]
    for i in range(len(anchor)):
        num = min(2, k.config.stage)
        k.particles.add(Anchor({'pos':anchor[i], 'color': 'pink', 'maxLinks': num}))
        
    # simple player
    k.player.setPos((w*2/3,cy+h*0.42))