Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Jason Bradley
Courses Plus Student 7,219 PointsGame/badge system
I'm trying to build out a game and badge system for my website but I'm struggling to settle on a design. I'd like to do something similar to how treehouse awards points and badges. Our users can complete certain tasks and earn points based on what they complete. I'd also like to allow users to maintain a "rank". As you complete more tasks you rank up and have a status associated. Nothing novel here.
Any design advice?
1 Answer
Jason Bradley
Courses Plus Student 7,219 PointsI have nothing in the form of a demonstration but I do have some design ideas.
As a user completes tasks I would track what was completed in a table that associates back to the user. Each record would have a point value. Totalling all records associated to a given user would effectively give you total points earned.
Since we would track each task completed, the points earned, and can also calculate a total, we theoretically could know when the user hits a new milestone and could present them with a "level up" badge at certain points. I'm not sure how efficient this approach would be given a large user base.
Another thought is to have a server side process running which recalculated user status (by going through the table previously described) at a periodic interval. So it wouldn't be realtime.
Currently the plan is to track this in a MySQL db.
Thanks!
James Barnett
39,199 PointsI'd make a flowchart on how this will work. Cacoo is good for easily making and sharing flowcharts online.
Once you've worked out most of it in a flowchart you'll probably have a list of questions about stuff you aren't sure of.
James Barnett
39,199 PointsJames Barnett
39,199 PointsShow us what you've got so far.