pingus-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bombers stop in the air if they detonate


From: Gervase Lam
Subject: Re: Bombers stop in the air if they detonate
Date: Sun, 6 Oct 2002 14:13:14 +0100

On Sunday 06 October 2002 03:04 am, you wrote:
> Subject: Re: Bombers stop in the air if they detonate
> From: Ingo Ruhnke <address@hidden>
> Date: 05 Oct 2002 14:44:46 +0200

> Workaround could look like this:
>
> 1. Bomber starts to fill itself with air
>
> 2. Fall speed goes down, since bomber will behave like a baloon
>
> 3. Bomber explodes like normal.
>
>
> So, instead of letting the bomber behave like a faller, it should get
> an additional force pushing him upwards, so that:
>
>  faller-speed += gravity - bomber_upforce;
>
> Floater->Bomber must be useable to bomb holes into the wall to the
> left/right (quite a lot levels use that), Faller->Bomber is ok if they
> aren't really useable for this (if levels use that a floater
> should/could be added). Since floater don't accelerate and have a slow
> constant speed, the bomber translation shouldn't cause to much of
> height-loose, if any.

OK.  I've taken the vital "three" lines of code from Floater::Update() and 
put them into Bomber::Update().  Floater::Update() doesn't use the 
faller-speed calculation, so I won't either!

I don't know why there is a 'step' variable and a 'falling_depth' variable 
in Faller::Update() but I have got rid of them in the Bomber::Update().  
In any case, the whole thing works very well.

I suppose really the Update() methods for each Pingu Action should be 
split into two parts.  The first part is for moving the Pingu and the 
second part to do the rest of the stuff like changing the PinguAction or 
changing the sprite.

This would enable things like Floaters and Bombers sharing common code.  
However, the two parts are so entangled with each other in the code, I 
don't know how this could be done.

Thanks,
Gervase.

Attachment: pingus.200210061410.cvs.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]