Here it is on github: https://github.com/LiquidHelium/LoveAchievements
Here are some videos I made, one is a shitty game I created as an example for the code and the other is my system in In Your Face City Trains:
To get it to work you need to do the following
It still needs some work (I need a way to display all achievements, currently it's left up to each game to implement how it's done individually because I don't know how I'm going to display them all on the screen, since I don't know what resolutions this is going to be run on) but as far as I know there is no other achievement system for love games, and if there is then I had fun making this so nothing has been lost. Feel free to add this to your games or do whatever you want with it, just give credit.copy the achievements directory into your love folder, so you have achievements.lua in achievements/achievements.lua
then add the following to the top of your main.luathen add this to the your love.load() methodCode: Select all
require("achievements/achievements")
then add this to the your love.update() methodCode: Select all
achievementSystem = AchievementSystem.New()
then add this to the your love.draw() methodCode: Select all
achievementSystem:Update()
then edit achievements/config.lua to add some achievements, there are some examples in there already, you should probably remove them, they follow this syntax:Code: Select all
achievementSystem:Draw()
achievements have to be defined in achievements/config.lua, nowhere elseCode: Select all
achievementSystem:CreateAchievement(UniqueID, Title, Description, imagename)
the imagename should just be file name and extension, not the full folder path, it should refer to a file in achievements/img, you should add your own images for achievement icons in that folder
to unlock an achievment you usedisplaying all the achievements and wether they are locked must be done by you for the moment, you can useCode: Select all
achievementSystem:UnlockAchievement(UniqueID)
to return a table with tables storing the UniqueID, name, description, image and unlock status of each achievementCode: Select all
achievementSystem:GetData()