#include <rainsplash.hpp>
Inherits GameObject.
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 |
Definition at line 26 of file rainsplash.hpp.
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 }
void RainSplash::hit | ( | Player & | ) | [protected, virtual] |
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 }
SpritePtr RainSplash::sprite [private] |
Vector RainSplash::position [private] |
int RainSplash::frame [private] |