File: bonus001.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 (21 lines) | stat: -rw-r--r-- 564 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

import k
from Part import *

def init():
    k.sound.loadTheme('water')
    k.sound.music()
    k.world.setBackground('bonus-01')
    
    cx, cy, w, h = k.world.rect.centerx, k.world.rect.centery, k.world.rect.width, k.world.rect.height
        
    xn, yn = 9,7
    
    for x in range(xn):
        for y in range(yn):
            if x != xn//2 and y != yn//2:
                pos = ((x+1.0)*w/(xn+1.0), (y+1.0)*h/(yn+1.0))
                k.particles.add(Chain({'pos': pos, 'color': 'blue'}))
                
    # simple player
    k.player.setPos((cx, cy))