C:/Documents and Settings/mtauraso/Desktop/proj3/projectX/Tile.cpp

Go to the documentation of this file.
00001 #include "Tile.h"
00002 #include "CollisionHandler.h"
00003 
00004 #include <iostream>
00005 #include <sstream>
00006 
00007 using namespace std;
00008 
00009 Tile::Tile()
00010 {
00011 }
00012 
00013 Tile::Tile(Sprite* sprite, bool collidable, int x, int y, double depth)
00014 :_sprite(sprite)
00015 {
00016         _type = TILE;
00017         
00018         // FIXME  make this general
00019         stringstream id;
00020         id << this;
00021         _id = id.str();
00022 
00023         _collidable = collidable;
00024         _box.x = x;
00025         _box.y = y;
00026 
00027         _box.w = _sprite->width();
00028         _box.h = _sprite->height();
00029 
00030         _depth = depth;
00031 }
00032 
00033 
00034 void Tile::collide( Object* o )
00035 {
00036          //does nothing
00037 }
00038 void Tile::draw()
00039 {
00040         _sprite->draw(_box.x,_box.y);
00041 }
00042 
00043 void Tile::update()
00044 {
00045         _sprite->update();
00046 }

Generated on Sat Apr 22 15:05:20 2006 for ProjectX by  doxygen 1.4.6-NO