RainSplash Class Reference

#include <rainsplash.hpp>

Inherits GameObject.

List of all members.

Public Member Functions

 RainSplash (Vector pos, bool vertical)
 ~RainSplash ()

Protected Member Functions

virtual void hit (Player &)
virtual void update (float 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 Attributes

SpritePtr sprite
Vector position
int frame


Detailed Description

Definition at line 26 of file rainsplash.hpp.


Constructor & Destructor Documentation

RainSplash::RainSplash ( Vector  pos,
bool  vertical 
)

Definition at line 19 of file rainsplash.cpp.

References SpriteManager::create(), frame, position, sprite, and sprite_manager.

00019                                                 :
00020   sprite(),
00021   position(),
00022   frame()
00023 {
00024   frame = 0;
00025   position = pos;
00026   if (vertical) sprite = sprite_manager->create("images/objects/particles/rainsplash-vertical.sprite");
00027   else sprite = sprite_manager->create("images/objects/particles/rainsplash.sprite");
00028 }

RainSplash::~RainSplash (  ) 

Definition at line 30 of file rainsplash.cpp.

References GameObject::remove_me().

00030                         {
00031   remove_me();
00032 }


Member Function Documentation

void RainSplash::hit ( Player  )  [protected, virtual]

Definition at line 35 of file rainsplash.cpp.

00036 {
00037 }

void RainSplash::update ( float  time  )  [protected, 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 40 of file rainsplash.cpp.

References frame, and GameObject::remove_me().

00041 {
00042   time = 0;//just so i don't get an "unused variable" error - don't know how to circumvent this
00043   frame++;
00044   if (frame >= 10) remove_me();
00045 }

void RainSplash::draw ( DrawingContext context  )  [protected, virtual]

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

Implements GameObject.

Definition at line 48 of file rainsplash.cpp.

References LAYER_OBJECTS, position, and sprite.

00049 {
00050   sprite->draw(context, position, LAYER_OBJECTS);
00051 }


Member Data Documentation

SpritePtr RainSplash::sprite [private]

Definition at line 37 of file rainsplash.hpp.

Referenced by draw(), and RainSplash().

Vector RainSplash::position [private]

Definition at line 38 of file rainsplash.hpp.

Referenced by draw(), and RainSplash().

int RainSplash::frame [private]

Definition at line 39 of file rainsplash.hpp.

Referenced by RainSplash(), and update().


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