// $Id: fish.cc,v 1.4 2006/08/05 09:08:58 matthew Exp $ // Fish Supper // Copyright (C) 2006 Matthew Clarke // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. #include "fish.h" // ******************* // *** CONSTRUCTOR *** // ******************* FS::Fish::Fish() { x = FISH_X; y = FISH_Y; width = FISH_WIDTH; height = FISH_HEIGHT; dest_rect.x = FISH_X; dest_rect.y = FISH_Y; dirty_rect.x = FISH_X; dirty_rect.y = FISH_Y; dirty_rect.w = FISH_WIDTH; dirty_rect.h = FISH_HEIGHT; // Need these two values for Sprite::get_coll_box() // to work properly. sprite_rect.x = FISH_X; sprite_rect.y = FISH_Y; coll_box_x_offset = COLL_BOX_X_OFFSET; coll_box_y_offset = COLL_BOX_Y_OFFSET; coll_box.w = COLL_BOX_WIDTH; coll_box.h = COLL_BOX_HEIGHT; bounding_box.w = width; bounding_box.h = height; } // FS::Fish::Fish() // ****************** // *** DESTRUCTOR *** // ****************** FS::Fish::~Fish() { // nothing yet } // FS::Fish::~Fish() // ************************ // *** MEMBER FUNCTIONS *** // ************************ // ************************************************** void FS::Fish::draw(PlayDisplay * pd) { pd->request_erase(&dirty_rect); pd->request_blit( ((fish_taken) ? PLATE : FISH), NULL, &dest_rect ); pd->request_update(dirty_rect); } // FS::Fish::draw() // ************************************************** void FS::Fish::reset() { fish_taken = false; } // FS::Fish::reset(); // ************************************************** void FS::Fish::remove_fish() { fish_taken = true; } // FS::Fish::remove_fish() // ************************************************** // ************************************************** // **************************************************