[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [knavalbattle] src: Play fade-in animation to show enemy ships after a defeat.
From: Roney Gomes <roney477 () gmail ! com>
Date: 2014-01-08 13:14:43
Message-ID: E1W0sy3-0007v8-Ut () scm ! kde ! org
[Download RAW message or body]
Git commit 4e1c1dc64ac4b360cef116ebfe1e2d977b8f6707 by Roney Gomes.
Committed on 08/01/2014 at 13:08.
Pushed by roneygomes into branch 'master'.
Play fade-in animation to show enemy ships after a defeat.
If the player has lost the game, then oponnent ships will appear in a
nice fade-in animation in the battlefield.
REVIEW: 114840
M +3 -2 src/battlefieldview.cpp
http://commits.kde.org/knavalbattle/4e1c1dc64ac4b360cef116ebfe1e2d977b8f6707
diff --git a/src/battlefieldview.cpp b/src/battlefieldview.cpp
index b682757..0fc2a35 100644
--- a/src/battlefieldview.cpp
+++ b/src/battlefieldview.cpp
@@ -185,9 +185,10 @@ void BattleFieldView::add(Ship* ship)
addSprite(ship->position(), sprite);
// fading preview in
+ Animation* a = new FadeAnimation(sprite, PREVIEW_OPACITY, 1, 1000);
+ Animator::instance()->add(a);
+
if (ship == m_preview.ship) {
- Animation* a = new FadeAnimation(sprite, PREVIEW_OPACITY, 1, 1000);
- Animator::instance()->add(a);
cancelPreview();
}
else if (!ship->alive()) {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic