From: Peter Todd <retep2@home.com>
Subject: Re: Explosion Forces
To: pingus-devel@lists.deus.net
Date: Sun, 14 Nov 1999 13:17:37 -0500
Reply-To: retep@penguinpowered.com
Resent-From: pingus-devel@lists.deus.net

> Don't know for sure, but I think the velocity stuff is somewhere
> broken. I tried to create a simple Jumper Action, but I was unable to
> make the Pingu jump, the following didn't work:

It was. It only supported velocities going down. The attached
patch fixes that.
 
>   pingu->v += CL_Vector(10.0, 2.0);
>   pingu->y_pos -= 1;
> 
> I tried different values for y, but I couldn't made the Pingu go
> up. The Jumper action along with your patch is now in CVS, it is
> available in Level9 (first button). I'll have a deeper look at it
> tomorrow.

I fixed the problem and changed things a bit. I removed the y_pos
-= and changed the jump speed to jump up and to the left. One
note. You were jumping to the right and down. Remember that
negitive velocities go up, positive down. 

Explosions are broken. I'll have to take a good look at that.
 
> > Also pingu that are preforming an action don't get effected by
> > the explosion. I tried to make them get effected but ended up
> > breaking *lots* of stuff.
> 
> I think its better to not influence Pingus with actions or at least
> only those where it makes sence (for example the floater), since that
> would have to much influence on the complete gameplay. Its better to
> stay as close as possible to the original gameplay and just use the
> forces as an additional feature without breaking much.

Ok.Index: pingus/src/Pingu.cc
===================================================================
RCS file: /home/mbn/public_cvsroot/pingus/src/Pingu.cc,v
retrieving revision 1.35
diff -u -r1.35 Pingu.cc
--- Pingu.cc	1999/11/14 12:04:31	1.35
+++ Pingu.cc	1999/11/14 18:12:45
@@ -310,16 +310,30 @@
       // and checking if the penguin has hit the bottom at each loop
       CL_Vector newp = v;
       while (1){
-	if (newp.x != 0) {
-	  x_pos++;
-	  newp.x--;
+	if (!(newp.x < 1 && newp.x > -1)) { // Since the velocity might be a
+	  // fraction stop when we are within 1 unit of the target
+	  if (newp.x > 0){
+	    x_pos++;
+	    newp.x--;
+	  }
+	  else{
+	    x_pos--;
+	    newp.x++;
+	  }
 	}
-	if (newp.y != 0) {
-	  y_pos++;
-	  newp.y--;
+
+	if (!(newp.y < 1 && newp.y > -1)) {
+	  if (newp.y > 0){
+	    y_pos++;
+	    newp.y--;
+	  }
+	  else {
+	    y_pos--;
+	    newp.y++;
+	  }
 	}
 
-	if ((rel_getpixel(0, -1) != ColMap::NOTHING) || ((newp.x == 0) && (newp.y == 0)))
+	if ((rel_getpixel(0, -1) != ColMap::NOTHING) || ((newp.x < 1 && newp.x > -1) && (newp.y < 1 && newp.y > -1)))
 	  break;
       }
     
Index: pingus/src/actions/Jumper.cc
===================================================================
RCS file: /home/mbn/public_cvsroot/pingus/src/actions/Jumper.cc,v
retrieving revision 1.1
diff -u -r1.1 Jumper.cc
--- Jumper.cc	1999/11/13 20:50:47	1.1
+++ Jumper.cc	1999/11/14 18:12:45
@@ -34,8 +34,8 @@
   surface = CL_Res_Surface::load("Pingus/jumper", *local_res());
   counter.set_size(4);
   counter.set_type(Counter::loop);
-  pingu->v += CL_Vector(10.0, 2.0);
-  pingu->y_pos -= 60;
+  pingu->v -= CL_Vector(10.0, 10.0);
+  //  pingu->y_pos -= 60;
 }
 
 void
