SmokeCloud Class Reference

#include <smoke_cloud.hpp>

Inherits GameObject.

List of all members.

Public Member Functions

 SmokeCloud (const Vector &pos)
 ~SmokeCloud ()
virtual void update (float elapsed_time)
 This function is called once per frame and allows the object to update it's state.
virtual void draw (DrawingContext &context)
 The GameObject should draw itself onto the provided DrawingContext if this function is called.

Private Member Functions

 SmokeCloud (const SmokeCloud &)
SmokeCloudoperator= (const SmokeCloud &)

Private Attributes

SpritePtr sprite
Timer timer
Vector position


Detailed Description

Definition at line 28 of file smoke_cloud.hpp.


Constructor & Destructor Documentation

SmokeCloud::SmokeCloud ( const Vector pos  ) 

Definition at line 22 of file smoke_cloud.cpp.

References SpriteManager::create(), sprite, sprite_manager, Timer::start(), and timer.

00022                                         :
00023   sprite(),
00024   timer(),
00025   position(pos)
00026 {
00027   timer.start(.3f);
00028   sprite = sprite_manager->create("images/objects/particles/stomp.sprite");
00029 }

SmokeCloud::~SmokeCloud (  ) 

Definition at line 31 of file smoke_cloud.cpp.

00032 {
00033 }

SmokeCloud::SmokeCloud ( const SmokeCloud  )  [private]


Member Function Documentation

void SmokeCloud::update ( float  elapsed_time  )  [virtual]

This function is called once per frame and allows the object to update it's state.

The elapsed_time is the time since the last frame in seconds and should be the base for all timed calculations (don't use SDL_GetTicks directly as this will fail in pause mode)

Implements GameObject.

Definition at line 36 of file smoke_cloud.cpp.

References Timer::check(), position, GameObject::remove_me(), timer, and Vector::y.

00037 {
00038   position.y -= 120 * elapsed_time;
00039 
00040   if(timer.check())
00041     remove_me();
00042 }

void SmokeCloud::draw ( DrawingContext context  )  [virtual]

The GameObject should draw itself onto the provided DrawingContext if this function is called.

Implements GameObject.

Definition at line 45 of file smoke_cloud.cpp.

References LAYER_OBJECTS, position, and sprite.

00046 {
00047   sprite->draw(context, position, LAYER_OBJECTS+1);
00048 }

SmokeCloud& SmokeCloud::operator= ( const SmokeCloud  )  [private]


Member Data Documentation

SpritePtr SmokeCloud::sprite [private]

Definition at line 38 of file smoke_cloud.hpp.

Referenced by draw(), and SmokeCloud().

Timer SmokeCloud::timer [private]

Definition at line 39 of file smoke_cloud.hpp.

Referenced by SmokeCloud(), and update().

Vector SmokeCloud::position [private]

Definition at line 40 of file smoke_cloud.hpp.

Referenced by draw(), and update().


The documentation for this class was generated from the following files:
Generated on Mon Jun 9 03:38:36 2014 for SuperTux by  doxygen 1.5.1