show particle()
SUB show
(particles
() AS VERTEX
)
this = particles(i)
CircleFill this.x
, this.y
, map
(this.life
, 0, 255, 1, 2), _RGB32(255, this.life
) this.life = this.life + this.stepToTake
this.xv = this.xv + this.xa
this.yv = this.yv + this.ya
this.x = this.x + this.xv
this.y = this.y + this.yv
this.stepToTake = this.stepToTake * -1
this.xv = 0
this.yv = 0
this.xa = 0
this.ya = 0
this.stepToTake
= RND * 3
IF click.x
> 0 AND click.y
> 0 AND dist
(click.x
, click.y
, this.x
, this.y
) < 15 THEN particles(i) = this
click.x = 0
click.y = 0
dist!
= _HYPOT((x2!
- x1!
), (y2!
- y1!
))
FUNCTION map!
(value!
, minRange!
, maxRange!
, newMinRange!
, newMaxRange!
) map! = ((value! - minRange!) / (maxRange! - minRange!)) * (newMaxRange! - newMinRange!) + newMinRange!
x0 = R
y0 = 0
e = 0
y0 = y0 + 1
LINE (x
- x0
, y
+ y0
)-(x
+ x0
, y
+ y0
), C
, BF
LINE (x
- x0
, y
- y0
)-(x
+ x0
, y
- y0
), C
, BF
e = e + 2 * y0
LINE (x
- y0
, y
- x0
)-(x
+ y0
, y
- x0
), C
, BF
LINE (x
- y0
, y
+ x0
)-(x
+ y0
, y
+ x0
), C
, BF
x0 = x0 - 1
e = e - 2 * x0
LINE (x
- R
, y
)-(x
+ R
, y
), C
, BF