forked from odoo/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 7
[IMP] awesome_clicker: implement a clicker game inside of Odoo. #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gicha-odoo
wants to merge
11
commits into
19.0-Awesome_Dashboard-gicha
Choose a base branch
from
19.0-Awesome_Clicker-gicha
base: 19.0-Awesome_Dashboard-gicha
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[IMP] awesome_clicker: implement a clicker game inside of Odoo. #6
gicha-odoo
wants to merge
11
commits into
19.0-Awesome_Dashboard-gicha
from
19.0-Awesome_Clicker-gicha
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This will add a click counter to the systray. This counter is incremented when clicking the button next to the counter. It will serve as the base of the awesome_clicker module game.
… service. The client action will display a dedicated window that will serve to play the game. In the current state, it only contains an increment button with a total value of 10. The clicks state has been transfer to a service to share it between the systray item and the client action. That way the clicks count will be the same for the entire web client. The service also implement the increment() function to replace the one that was defined in the systray item class.
… counter and add the ClickBots. This will introduce a custom cliker hook that will handle the required import to create and use the clicker service. That way, the classes that use this service will only require to import and use this hook. This will also add the clickValue class and component. It transform the displayed value of the clicks counter to something more readable for human, especially with greater values. To allow the player to see the exact number of clicks, a dynamic tooltip has been added to the counter. Finally, this will add the possibility to buy ClickBots with 1000 clicks. Those ClickBots will be available when reaching level 1 (1000 clicks) and will generate 10 clicks each every 10 seconds.
…c out of the service.
This will add a new effect when reaching milestones: the rainbow man effect, to give a feedack to the player and let them know that they can buy new bots. This will also add new bigbots: they are more expensive than clickbot but generate 100 clicks every 10 seconds.
This will add a new resource to the game: power upgrades. This upgrade will unlock at level 3 (100k clicks) and will cost 50k for each. It multiplies the power of the bots. Thi will also add the total clicks per second of every bot and the grand total on the client action view.
This will add reward that will randomly be given when opening form views inside the Odoo databse. The rewards are defined in the click_rewards.js file and all have a description and an action (apply). A minimum and maximum level can also be set.
This will add a new resource: trees. Each tree will cost 1M clicks and produce a fruit each 30 seconds. It represent the actual end-game of the clicker. The systray item has been improve to display the click count, tree count and fruit count and transform it into a dropdown menu. Inside the dropdown, we can access the clicker game panel and use a command to buy a clickbot. It also display the number of purchased trees and produced fruits in more detail.
This will separate the clicks upgrades from the trees and fruits using a notebook. This will allow to keep thing clearer for the user.
The game will save automatically every 10 seconds inside the browser local storage and this state will be retreive when the database is loaded. If there are no data saved in the browser, a new instance of ClickerModel will be created with the default values.
This will add a new migration mechanism, ensuring that when a new version is released, the state save in the local storage is updated correctly. This will also add a new tree resource: peachTree. The game is now in version 2 and will update its save file automatically.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[IMP] awesome_clicker: implement a clicker game inside of Odoo.
This will implement a clicker game inside of an Odoo database. Each click inside the database will increment a click counter and the user will be able to buy upgrade with those clicks. The upgrade are unlock when milestones are reached.
The available upgrades are:
The game also come with random reward that can be received when opening form view. Each reward can have a level requirement.