Merged changes from branches/supertux-milestone2-grumbel/ to trunk/supertux/
[supertux.git] / src / object / rainsplash.cpp
1 //  SuperTux
2 //  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
3 //
4 //  This program is free software: you can redistribute it and/or modify
5 //  it under the terms of the GNU General Public License as published by
6 //  the Free Software Foundation, either version 3 of the License, or
7 //  (at your option) any later version.
8 //
9 //  This program is distributed in the hope that it will be useful,
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 //  GNU General Public License for more details.
13 //
14 //  You should have received a copy of the GNU General Public License
15 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 #include "object/rainsplash.hpp"
18
19 RainSplash::RainSplash(Vector pos, bool vertical)
20 {
21   frame = 0;
22   position = pos;
23   if (vertical) sprite = sprite_manager->create("images/objects/particles/rainsplash-vertical.sprite");
24   else sprite = sprite_manager->create("images/objects/particles/rainsplash.sprite");
25 }
26
27 RainSplash::~RainSplash() {
28   remove_me();
29 }
30
31 void
32 RainSplash::hit(Player& )
33 {
34 }
35
36 void
37 RainSplash::update(float time)
38 {
39   time = 0;//just so i don't get an "unused variable" error - don't know how to circumvent this
40   frame++;
41   if (frame >= 10) remove_me();
42 }
43
44 void
45 RainSplash::draw(DrawingContext& context)
46 {
47   sprite->draw(context, position, LAYER_OBJECTS);
48 }
49
50 /* EOF */