-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparticles.py
43 lines (33 loc) · 1020 Bytes
/
particles.py
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
#import baseparticle
import smokeparticle
import textparticle
import simplenet
particles = []
#display.loadtex("fire.png")
def addParticle(x, y, startspeed, img, scale, num,colour=[1,1,1]):
global particles
simplenet.sendall("addps", [x, y, startspeed, img, scale, num,colour])
#if simplenet.isServer:
# return
startspeed = num/25.0
for i in range(num):
particles.append(smokeparticle.smokeparticle(x,y,img,scale,startspeed,colour))
def addTextParticle(x, y, startspeed, img, scale, colour=[1,1,1]):
global particles
simplenet.sendall("addtps", [x, y, startspeed, img, scale, colour])
#if simplenet.isServer:
# return
particles.append(textparticle.textparticle(x,y,img,scale,1,colour))
def update():
global particles
remlist = []
for i in particles:
i.move()
if i.dead:
remlist.append(i)
for i in remlist:
particles.remove(i)
def draw():
global particles
for i in particles:
i.draw()