diff --git a/src/activities/intro_gravity/ActivityInfo.qml b/src/activities/intro_gravity/ActivityInfo.qml --- a/src/activities/intro_gravity/ActivityInfo.qml +++ b/src/activities/intro_gravity/ActivityInfo.qml @@ -29,7 +29,7 @@ description: qsTr("Introduction to the concept of gravity") //intro: "Change the planets' gravitational force by moving the sliders up and down. Be careful not to crash Tux's spaceship." //: Help goal - goal: qsTr("Maintain the spaceship in the middle without crashing into the planets or the asteroids") + goal: qsTr("Maintain the spaceship in the middle without crashing into the planets or the asteroids and join the space shuttle") //: Help prerequisite prerequisite: "" //: Help manual diff --git a/src/activities/intro_gravity/intro_gravity.js b/src/activities/intro_gravity/intro_gravity.js --- a/src/activities/intro_gravity/intro_gravity.js +++ b/src/activities/intro_gravity/intro_gravity.js @@ -37,7 +37,6 @@ var asteroidsErased = new Array; var minDuration = 20000 -var asteroidCounter var items; var message; @@ -56,7 +55,6 @@ items.shuttleMotion.stop() destroyAsteroids(asteroids) destroyAsteroids(asteroidsErased) - asteroidCounter = 0 } function initLevel() { @@ -145,7 +143,6 @@ asteroids.push(asteroid); asteroid.startMoving() - asteroidCounter++ } function destroyAsteroids(asteroids) { @@ -180,6 +177,14 @@ items.spaceship.source = "" stop() } + + // If shuttle moves away to the top + if(items.shuttle.y < 0 - items.shuttle.height/2) { + items.shuttle.x = Math.random() > 0.5 ? + items.background.width * 0.2 : items.background.width * 0.7 + items.shuttle.y = items.background.height + items.shuttle.height + items.shuttleMotion.restart() + } } function handleCollisionWithAsteroid() { @@ -201,12 +206,6 @@ crash() return } - if(asteroidCounter == 4) { - items.bonus.good("flower") - stop() - return - } - } } }