summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d9d3a0c)
raw | patch | inline | side by side (parent: d9d3a0c)
author | Stas'M <x86corez@gmail.com> | |
Fri, 28 Dec 2018 14:50:58 +0000 (17:50 +0300) | ||
committer | Stas'M <x86corez@gmail.com> | |
Fri, 28 Dec 2018 14:50:58 +0000 (17:50 +0300) |
src/game/g_gfx.pas | patch | blob | history |
diff --git a/src/game/g_gfx.pas b/src/game/g_gfx.pas
index e4c46f199d17a9bf74a2180be95d1ff5e4fc0c4c..567fb5f5d6e66ff87e9cba272861948e65650cc9 100644 (file)
--- a/src/game/g_gfx.pas
+++ b/src/game/g_gfx.pas
particleType: TPartType;
red, green, blue: Byte;
alpha: Byte;
- time, liveTime: Word;
+ time, liveTime, waitTime: Word;
stickDX: Integer; // STATE_STICK: -1,1: stuck to a wall; 0: stuck to ceiling
justSticked: Boolean; // not used
floorY: Integer; // actually, floor-1; `Unknown`: unknown
begin
if (env = TEnvType.ELiquid) then
begin
- time += 1;
+ if waitTime > 0 then
+ waitTime -= 1
+ else
+ time += 1;
if (liveTime <= 0) then begin die(); exit; end;
ex := 255-trunc(255.0*time/liveTime);
if (ex <= 10) then begin die(); exit; end;
begin
// water will disappear in any liquid
if (env = TEnvType.ELiquid) then begin die(); exit; end;
- time += 1;
+ if waitTime > 0 then
+ waitTime -= 1
+ else
+ time += 1;
// dry water
if (liveTime <= 0) then begin die(); exit; end;
ex := 255-trunc(255.0*time/liveTime);
state := TPartState.Normal;
time := 0;
liveTime := 120+Random(40);
+ waitTime := 20;
floorY := Unknown;
ceilingY := Unknown;
end;
state := TPartState.Normal;
time := 0;
liveTime := 60+Random(60);
+ waitTime := 120;
floorY := Unknown;
ceilingY := Unknown;
end;
if (velY > -4) then velY += accelY;
- time += 1;
+ if waitTime > 0 then
+ waitTime -= 1
+ else
+ time += 1;
end;
particleType := TPartType.Bubbles;
time := 0;
liveTime := 65535;
+ waitTime := 0;
end;
if (CurrentParticle >= MaxParticles-1) then CurrentParticle := 0 else CurrentParticle += 1;
//writeln('spark1: pos=(', x, ',', y, '); delta=(', velX:6:3, ',', velY:6:3, '); state=', state, '; ceilingY=', ceilingY, '; floorY=', floorY);
- time += 1;
+ if waitTime > 0 then
+ waitTime -= 1
+ else
+ time += 1;
end;
state := TPartState.Normal;
time := 0;
liveTime := 30+Random(60);
+ waitTime := 0;
floorY := Unknown;
ceilingY := Unknown;
end;
state := TPartState.Normal;
time := 0;
liveTime := 30+Random(60);
+ waitTime := 0;
floorY := Unknown;
ceilingY := Unknown;
end;