I am trying to create swimming/buoyancy functionality in my game. I created a block in a castle moat that represents water. If the player jumps into the block, I want the player to start swimming. However, I am at the very beginning stages of trying to make this happen.

Right now, I am just trying to make my player "sense" the passable and transparent block, by sounding a beep() when the player makes contact with it. So far, the beep() is not sounding when the player jumps into and makes contact with the block.

The block is saved as a map entity in its own WED file.

Here is the code to try to make the beep() sound when the player makes contact with the block:

Code:
action moatSide1()
{
   moat_side_one = me;
}

...


player_code()
{

   ...


   while(my.x)
   {

      ...


      if(you == moat_side_one)
      {
         beep();
      }

      ...

      wait(1)
   }
}



The moat block is given the behaviour action of "moatSide1" in WED, and the player is given the behaviour action of "player_code". Yet when the player jumps in the block, and player passes through it since it is passable, no beep() is sounded off.

Does anyone know why?

Last edited by Ruben; 06/30/15 06:49.