(sprite (name "rainsplash")
(action
+ (fps 20)
(images "objects/particles/rainsplash-1.png"
"objects/particles/rainsplash-2.png"
"objects/particles/rainsplash-3.png"
"objects/particles/rainsplash-4.png")
)
)
-
+ (sprite (name "rainsplash-vertical")
+ (action
+ (fps 20)
+ (images "objects/particles/rainsplash-vertical-1.png"
+ "objects/particles/rainsplash-vertical-2.png"
+ "objects/particles/rainsplash-vertical-3.png"
+ "objects/particles/rainsplash-vertical-4.png")
+ )
+ )
+
(sprite (name "worldmaptux")
(action
(name "small")
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 1315 1313 1315 1314 1316 1313 1314 1316 1315 1313 1314 1316 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1314 1313 1316 1315 1313 1315 1314 1316 0 0 0 0 0 0 1316 1313 1314 0 0 0 0 0 0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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 47 0 0 0 0 0 0 0 0 0 0
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 47 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 47 0 0 0 0 0 0 0 0 0 0
47 47 47 47 47 47 47 47 47 47 47 47 47 47 0 0 0 0 0 0 0 0 0 0 0 0 0 0 47 47 47 47 47 47 47 47 47 47 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 47 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 47 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 47 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 47 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 47 47 0 0 0 0 0 47 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 47 0 0 0 0 0 0 0 0 0 0
#include "collision.h"
#include "collision_hit.h"
#include "object/camera.h"
+#include "object/rainsplash.h"
#include "badguy/bomb.h"
//TODO: Dynamically create splashes at collision spots
particle->pos.y += movement;
particle->pos.x -= movement;
if ((particle->pos.y > SCREEN_HEIGHT + abs_y) || (collision(particle, Vector(-movement, movement)))) {
+ //Create rainsplash
+ if (particle->pos.y <= SCREEN_HEIGHT + abs_y){
+ //TODO: Find out at which side of the tile the collision happens
+ bool vertical = false;
+ int splash_x, splash_y;
+ if (vertical) {
+ splash_x = int(particle->pos.x) - (int(particle->pos.x) % 32) + 32;
+ splash_y = int(particle->pos.y);
+ }
+ else {
+ splash_x = int(particle->pos.x);
+ splash_y = int(particle->pos.y) - (int(particle->pos.y) % 32) + 32;
+ }
+ Sector::current()->add_object(new RainSplash(Vector(splash_x, splash_y),vertical));
+ }
int new_x = (rand() % int(virtual_width)) + int(abs_x);
int new_y = 0;
//FIXME: Don't move particles over solid tiles
--- /dev/null
+// SuperTux
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+#include "rainsplash.h"
+#include "sector.h"
+
+RainSplash::RainSplash(Vector pos, bool vertical)
+{
+ frame = 0;
+ position = pos;
+ if (vertical) sprite = sprite_manager->create("rainsplash-vertical");
+ else sprite = sprite_manager->create("rainsplash");
+}
+
+RainSplash::~RainSplash() {
+ remove_me();
+}
+
+void
+RainSplash::hit(Player& )
+{
+}
+
+void
+RainSplash::update(float time)
+{
+ time = 0;//just so i don't get an "unused variable" error - don't know how to circumvent this
+ frame++;
+ if (frame >= 10) remove_me();
+}
+
+void
+RainSplash::draw(DrawingContext& context)
+{
+ sprite->draw(context, position, LAYER_OBJECTS);
+}
--- /dev/null
+// SuperTux
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+
+#ifndef __RAINSPLASH_H__
+#define __RAINSPLASH_H__
+
+
+#include "game_object.h"
+#include "resources.h"
+#include "player.h"
+#include "sprite/sprite.h"
+#include "sprite/sprite_manager.h"
+#include "video/drawing_context.h"
+
+class RainSplash : public GameObject
+{
+public:
+ RainSplash(Vector pos, bool vertical);
+ ~RainSplash();
+protected:
+ virtual void hit(Player& );
+ virtual void update(float time);
+ virtual void draw(DrawingContext& context);
+private:
+ Sprite* sprite;
+ Vector position;
+ int frame;
+};
+
+#endif
+