/[enigma]/enigma/laser.cc
ViewVC logotype

Diff of /enigma/laser.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by dheck, Tue Dec 31 10:09:23 2002 UTC revision 1.18 by dheck, Fri Jan 3 22:58:04 2003 UTC
# Line 1  Line 1 
1  //======================================================================  /*
2  // Copyright (C) 2002 Daniel Heck   * Copyright (C) 2002,2003 Daniel Heck
3  //   *
4  // This program is free software; you can redistribute it and/or   * This program is free software; you can redistribute it and/or
5  // modify it under the terms of the GNU General Public License   * modify it under the terms of the GNU General Public License
6  // as published by the Free Software Foundation; either version 2   * as published by the Free Software Foundation; either version 2
7  // of the License, or (at your option) any later version.   * of the License, or (at your option) any later version.
8  //     *  
9  // This program is distributed in the hope that it will be useful,   * This program is distributed in the hope that it will be useful,
10  // but WITHOUT ANY WARRANTY; without even the implied warranty of   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  // GNU General Public License for more details.   * GNU General Public License for more details.
13  //     *
14  // You should have received a copy of the GNU General Public License along   * You should have received a copy of the GNU General Public License along
15  // with this program; if not, write to the Free Software Foundation, Inc.,   * with this program; if not, write to the Free Software Foundation, Inc.,
16  // 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.   * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
17  //======================================================================   *
18     * $Id$
19     */
20  #include "laser.hh"  #include "laser.hh"
21  #include "sound.hh"  #include "sound.hh"
22  #include "actors.hh"  #include "actors.hh"
# Line 278  LaserBeam::actor_hit(Actor *actor) Line 280  LaserBeam::actor_hit(Actor *actor)
280      double dx = fabs(p[0] - gp.x - 0.5) - r;      double dx = fabs(p[0] - gp.x - 0.5) - r;
281      double dy = fabs(p[1] - gp.y - 0.5) - r;      double dy = fabs(p[1] - gp.y - 0.5) - r;
282    
283      if ((directions & (EASTBIT | WESTBIT) && dy<0.1) ||      if ((directions & (EASTBIT | WESTBIT) && dy<-0.1) ||
284          (directions & (NORTHBIT | SOUTHBIT)) && dx<0.1)          (directions & (NORTHBIT | SOUTHBIT)) && dx<-0.1)
285      {      {
286          SendMessage(actor, "shatter");          SendMessage(actor, "shatter");
287      }      }

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26