From 5d58f841a2c6e3e679f8f55b916ecb720f4a3f74 Mon Sep 17 00:00:00 2001 From: Christoph Sommer Date: Mon, 18 Feb 2008 19:17:06 +0000 Subject: [PATCH] Resolves issue 0000304: Blocks don't return to original positions SVN-Revision: 5329 --- src/object/block.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/object/block.cpp b/src/object/block.cpp index 2a0e2af89..7d0b938a9 100644 --- a/src/object/block.cpp +++ b/src/object/block.cpp @@ -52,7 +52,7 @@ static const float EPSILON = .0001f; static const float BUMP_ROTATION_ANGLE = 10; Block::Block(Sprite* newsprite) - : sprite(newsprite), bouncing(false), breaking(false), bounce_dir(0), bounce_offset(0) + : sprite(newsprite), bouncing(false), breaking(false), bounce_dir(0), bounce_offset(0), original_y(-1) { bbox.set_size(32, 32.1f); set_group(COLGROUP_STATIC); @@ -131,7 +131,9 @@ Block::draw(DrawingContext& context) void Block::start_bounce(float center_of_hitter) { - original_y = bbox.p1.y; + if(original_y == -1){ + original_y = bbox.p1.y; + } bouncing = true; bounce_dir = -BOUNCY_BRICK_SPEED; bounce_offset = 0; -- 2.11.0