Merge lp:~rpadovani/falldown/force-controls into lp:falldown

Proposed by Riccardo Padovani
Status: Merged
Merged at revision: 75
Proposed branch: lp:~rpadovani/falldown/force-controls
Merge into: lp:falldown
Diff against target: 54 lines (+14/-0)
3 files modified
falldown/components/Ball.qml (+5/-0)
falldown/js/game.js (+8/-0)
falldown/scenes/EndScene.qml (+1/-0)
To merge this branch: bzr merge lp:~rpadovani/falldown/force-controls
Reviewer Review Type Date Requested Status
Riccardo Padovani Pending
Review via email: mp+270899@code.launchpad.net

Description of the change

Force some basic controls to assure there aren't two floors or the last ball disappears without ending the game.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'falldown/components/Ball.qml'
2--- falldown/components/Ball.qml 2015-07-06 22:19:43 +0000
3+++ falldown/components/Ball.qml 2015-09-13 14:29:00 +0000
4@@ -66,6 +66,11 @@
5 if (position < 0) {
6 ballEntity.doDestroy();
7 }
8+
9+ if (position > game.height + units.gu(5)) {
10+ // If the ball falls in some way out of the game
11+ ballEntity.doDestroy();
12+ }
13 }
14 }
15
16
17=== modified file 'falldown/js/game.js'
18--- falldown/js/game.js 2015-08-29 23:58:45 +0000
19+++ falldown/js/game.js 2015-09-13 14:29:00 +0000
20@@ -31,8 +31,14 @@
21 var UPPER_LIMIT_WINE = 1;
22
23 var howManyFloorsWithoutPowerUp = 0;
24+var floorMutex = false;
25
26 function addFloor(width, gu) {
27+ // Be sure we don't duplicate floors
28+ // https://bugs.launchpad.net/falldown/+bug/1495066
29+ if (floorMutex) return;
30+ floorMutex = true;
31+
32 // Choose number of holes in the floor, 90% of times just one
33 var numberOfHoles = Math.random() < PERCENTUAL_OF_TWO_HOLES ? 2 : 1;
34
35@@ -73,6 +79,8 @@
36 thirdFloor.y = gameScene.height;
37 thirdFloor.width = width - secondHolePosition - gu * 7 + 10;
38 }
39+
40+ floorMutex = false;
41 }
42
43 function addBall(x, y) {
44
45=== modified file 'falldown/scenes/EndScene.qml'
46--- falldown/scenes/EndScene.qml 2015-09-09 21:27:54 +0000
47+++ falldown/scenes/EndScene.qml 2015-09-13 14:29:00 +0000
48@@ -153,6 +153,7 @@
49 i18n.tr("Your best score is ") + settings.highScore :
50 i18n.tr("This is your new best score!")
51 font.pixelSize: units.gu(2.5)
52+ horizontalAlignment: Text.AlignHCenter
53
54 wrapMode: Text.WordWrap
55

Subscribers

People subscribed via source and target branches

to all changes: