File: level007.py

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

import k
from Part import *

def init():
    k.sound.loadTheme('summer')
    k.sound.music()
    k.world.setBackground('level-07')

    cx, cy, w, h = k.world.rect.centerx, k.world.rect.centery, k.world.rect.width, k.world.rect.height
    
    # particles
    parts = [(  w/4,   h/4),
             (  w/2,   h/4),
             (3*w/4,   h/4),
             (  w/4, 3*h/4),
             (  w/2, 3*h/4),
             (3*w/4, 3*h/4)]
    
    for i in range(6):
        k.particles.add(Particle({'pos': parts[i], 'color': 'orange'}))
    
    # magnet 
    n = min(6, 3+k.config.stage)
    k.particles.add (Magnet({'pos': (w/2, h/2), 'color': 'orange', 'num': n}))

    # stones
    if k.config.stage >= 2:
        num = (k.config.stage-1)*5
        k.particles.stoneCircle((cx, cy), 'orange', num, 90, -math.pi/2)
        
    # simple player
    k.player.setPos((cx, cy-130))