Systers, an Anita Borg Institute Community
Implementing the Replay Button in PowerUp Android. [PWR]
Prerequisite:
Successfully build and run Powerup - Android.
Simple Definition:
Implementing the Replay Button for Powerup application by resetting the points earned in the current Scenario.
Steps to Take:
- Implement onClickListener on the replayButton in ScenarioOverActivity.
- Create a new variable in SessionHistory which would store the last scenario ID played and -1 incase no scenarios have been played.
- After playing a Scenario in GameActivity,while updating the currSessionId of SessionHistory, also update the value of newly added prevSessionId with the just finished scenario ID.
- When replay button clicked in ScenarioOverActivity,update currSessionId in SessionHistory with the one stored in recently played scenario Id stored in prevSessionId because the recently played scenario has to be replayed.
- Update totalPoints stored in SessionHistory by deducting currScenePoints which is also stored in SessionHistory
- Also update the static variable of ScenarioOverActivity,scenarioActivityDone to zero
- Update the values of attributes Completed and Replayed in Scenario table to zero for the replayed scenario by creating two sql update queries.
- Now just flag an intent to GameActivity and you are done.
Required:
As you work on this task, you should join and remain in #gci-general or #powerup on Systers Opensource Slack to get help, feedback, and guidance from mentors and other developers.
Evaluated Work:
Submit the link to your pull request.
Task tags
Students who completed this task
Farbod Salamat-Zadeh, Soham Sen, JacquelineVB