pingus-devel
[Top][All Lists]
Advanced

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

Re: Pingu stuck and collision code


From: Gervase Lam
Subject: Re: Pingu stuck and collision code
Date: Mon, 16 Sep 2002 23:13:57 +0100

On Monday 16 September 2002 11:32 am, you wrote:
> actions. I am more thinking of something like:
>
> bool PinguAction::collide () =0
>
> Status
> PinguAction::linear_goto (int x, int y)
> {
>   while (pos.x < x && pos.y < y)
>      if (!collide (x, y)) {
>        pos.x += 1
>        pos.y += 1
>      } else {
>        return ABORT_AT (pos);
>      }
>   return SUCCESSFULL;
> }

I think the linear_goto will need to be more sophisticated than this.  A 
builder could build through a spike in the collision map.  This could 
stick right through the building brick between (0,0) and (+4,+2) that the 
Bridger needs to walk through.  If necessary, the spike should get in the 
way of the Bridger and make it reverse.

So, what really needs to happen is that as the loop is moving forwards, it 
should go up and down together with either the collision map or a bridging 
block.  It would be like an extremely poor version of the Walker update.

I'll try to give this a go tomorrow.

Thanks,
Gervase.





reply via email to

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