Changeset View
Changeset View
Standalone View
Standalone View
src/activities/gnumch-equality/Gnumch.qml
Context not available. | |||||
59 | } | 59 | } | ||
---|---|---|---|---|---|
60 | 60 | | |||
61 | function nextLevel() { | 61 | function nextLevel() { | ||
62 | Activity.nextLevel() | 62 | Activity.nextLevel(); | ||
63 | if (Activity._currentLevel == 7) { | 63 | initLevel(); | ||
64 | operator = " - " | 64 | } | ||
65 | Activity._operator = operator | | |||
66 | } | | |||
67 | 65 | | |||
68 | if (Activity._currentLevel == 0) { | 66 | function previousLevel() { | ||
69 | operator = " + " | 67 | Activity.previousLevel(); | ||
70 | } | 68 | initLevel(); | ||
71 | topPanel.goal = Activity.getGoal() | 69 | } | ||
72 | monsters.destroyAll() | 70 | | ||
73 | Activity.fillAllGrid() | 71 | function initLevel() { | ||
74 | topPanel.life.opacity = 1 | 72 | topPanel.life.opacity = 1; | ||
75 | spawningMonsters.stop() | 73 | forceActiveFocus(); | ||
76 | timerActivateWarn.stop() | 74 | operator = Activity._operator; | ||
77 | if (Activity._currentLevel != 7) { | 75 | topPanel.goal = Activity.getGoal(); | ||
78 | spawningMonsters.start() | 76 | monsters.destroyAll(); | ||
79 | timerActivateWarn.start() | 77 | spawningMonsters.stop(); | ||
78 | timerActivateWarn.stop(); | ||||
79 | if (Activity._currentLevel % 6 !== 0) { | ||||
80 | spawningMonsters.restart(); | ||||
80 | } | 81 | } | ||
82 | Activity.initLevel(); | ||||
81 | } | 83 | } | ||
82 | 84 | | |||
83 | anchors.fill: parent | 85 | anchors.fill: parent | ||
Context not available. | |||||
91 | } | 93 | } | ||
92 | 94 | | |||
93 | onStart: { | 95 | onStart: { | ||
94 | Activity.start(modelCells, topPanel.bar, bonus, type, operator) | 96 | Activity.start(modelCells, topPanel.bar, bonus, type, operator); | ||
95 | topPanel.life.opacity = 1 | 97 | initLevel(); | ||
96 | forceActiveFocus() | | |||
97 | operator = " + " | | |||
98 | Activity._operator = operator | | |||
99 | Activity.fillAllGrid() | | |||
100 | topPanel.goal = Activity.getGoal() | | |||
101 | if (Activity._currentLevel % 6 == 1) { | | |||
102 | spawningMonsters.restart() | | |||
103 | } else { | | |||
104 | spawningMonsters.stop() | | |||
105 | timerActivateWarn.stop() | | |||
106 | } | | |||
107 | } | 98 | } | ||
108 | onStop: { | 99 | onStop: { | ||
109 | monsters.destroyAll() | 100 | monsters.destroyAll() | ||
Context not available. |