/*
-Copyright (C) 2004 Parallel Realities
+Copyright (C) 2004-2011 Parallel Realities
+Copyright (C) 2011-2015 Perpendicular Dimensions
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
void addWindParticles()
{
- int c = graphics.white;
+ int c;
float x, y, dx, dy;
- if (player.x < 320)
- {
- x = Math::rrand(-100, 700);
- }
- else
- {
- x = player.x + Math::rrand(-450, 450);
- }
-
+
for (int i = 0 ; i < 50 ; i++)
{
-
+ if (player.x < 320)
+ {
+ x = Math::rrand(-100, 700);
+ }
+ else
+ {
+ x = player.x + Math::rrand(-450, 450);
+ }
+
c = Math::prand() % 4;
switch (c)
{
for (int i = 0 ; i < amount ; i++)
{
if (color == -1)
- {
c = Math::prand() % 5;
- switch (c)
- {
- case 0: c = graphics.white; break;
- case 1: c = graphics.grey; break;
- case 2: c = graphics.blue; break;
- case 3: c = graphics.cyan; break;
- case 4: c = graphics.red; break;
- }
+
+ switch (c)
+ {
+ case 0: c = graphics.white; break;
+ case 1: c = graphics.grey; break;
+ case 2: c = graphics.blue; break;
+ case 3: c = graphics.cyan; break;
+ case 4: c = graphics.red; break;
}
dx = Math::rrand(-30, 30); dx /= 30;
void addFireParticles(float x, float y, int amount)
{
- map.addParticle(x + Math::rrand(-2, 2), y + Math::rrand(-2, 2), 0, 1, Math::rrand(5, 30), graphics.red, graphics.getSprite("Explosion", true), PAR_COLLIDES);
+ for (int i = 0 ; i < amount ; i++)
+ {
+ map.addParticle(x + Math::rrand(-2, 2), y + Math::rrand(-2, 2), 0, 1, Math::rrand(5, 30), graphics.red, graphics.getSprite("Explosion", true), PAR_COLLIDES);
+ }
}
void addBubble(float x, float y)
{
if ((Math::prand() % 50) == 0)
{
- map.addParticle(x + Math::prand() % BRICKSIZE, y + 19, 0, Math::rrand(-3, -1), Math::rrand(30, 90), graphics.red, graphics.getSprite("Bubble", true), PAR_COLLIDES + PAR_WEIGHTLESS);
+ map.addParticle(x + Math::prand() % BRICKSIZE, y + 19, 0, Math::rrand(-3, -1), Math::rrand(30, 90), graphics.red, graphics.getSprite("Bubble", true), PAR_COLLIDES | PAR_WEIGHTLESS | PAR_LIQUID);
}
}
if (soundToPlay != -1)
{
- audio.playSound(soundToPlay, CH_SPAWN);
+ audio.playSound(soundToPlay, CH_SPAWN, x);
}
}
}
}
+ if (particle->flags & PAR_LIQUID)
+ {
+ if (!map.isLiquid(x, y))
+ {
+ particle->health = 0;
+ }
+ }
+
if (particle->health > 0)
{
previous = particle;