Hello again, everyone! This time, I worked hard on a project that isn't THAT MUCH useful, but rather entertaining. This was an experiment, and I made it in a single day, so if you find any problems, please contact me.
Description:
As the title says, it is a "Screensaver Loader". What that means is that not only does this plays screensavers (like any screensaver), but it can also LOAD custom user-made screensavers.
There are 3 screensavers that come with this: 1 made by a great friend, TurtleP (he made that before I started this project. In fact, his screensaver inspired me to do this all), and the other 2 by me (recycled from doodles I made on the "Code Doodles" thread). And, these 2 ones made by me are interactive: remember back in the old Windows versions where some screensavers were like "minigames" (especially the 3D maze)? Exactly, that's what this "program" allows you to do.
If anyone ends up making a screensaver for this, it'd be very nice if you posted here, as I'd like to know how well my program would work in other's computers, as well as how creative you can get!
Info:
To quit a screensaver, simply press any key/button or move your mouse around. If you're on an interactive screensaver, press [Esc]. To switch between screensavers, press [F1]. In the console for changing screensavers, use Left/Right, [a]/[d] or [click] in the arrows. To view the information about keys/mouse buttons, use [Mouse wheel] or drag the scrollbar. Simple as that!
Screenshots and Download:
Pac-Man screensaver - By TurtleP
Selection menu
Selection menu (2)
Screensavers 1.0.love
How to make your OWN screensavers:
Place a .lua file inside a folder named "screensavers". If this folder wasn't already created in the game's folder, create it yourself. The game's folder is "hbd_screensavers", and goes on the "%appdata%/LOVE" folder (again, if it doesn't exists, create yourself).
Complete path: %appdata%/LOVE/hbd_screensavers/screensavers/[screensaver name].lua
Let's call this screensaver "test". The name of the .lua file doesn't matter, but the program will get the file name if no name is specified inside the file itself.
Code: Select all
local test = {}
test.name = "My first screensaver" --default to filename
test.author = "My name!!!" --default to "Unknown"
test.showmouse = true --if false, you don't even need this
Code: Select all
test.mouse = {
["l"] = "Select something",
["r"] = "Change something",
["wu"] = "Increase something",
["wd"] = "Decrease something",
["m"] = "Do something RANDOM!!!"
}
test.keys = {
["A"] = "Do something",
["W"] = "Do another thing",
["Enter"] = "Toggle something",
["Ctrl+S"] = "Save something",
["Delete"] = "Delete something",
["Space"] = "JUMP!!!"
}
Then, you'll have the callbacks. PAY ATTENTION: like any screensaver, the program will close as soon as you press a button/move the mouse. To avoid that, do this:
Code: Select all
function test:load()
self.value = n
self:startSomething()
end
function test:update(dt)
--If you don't want the game to close on mouse movement, add the following line in the end:
return true
end
function test:draw()
--Draw your screensaver
end
function test:mousepressed(x, y, button)
--If you don't want the game to close on mouse press, add the following line in the end:
return true
end
function test:mousereleased(x, y, button)
--If you don't want the game to close on mouse release, add the following line in the end:
return true
end
function test:keypressed(key)
--If you don't want the game to close on key press, add the following line in the end:
return true
end
function test:keyreleased(key)
--If you don't want the game to close on key release, add the following line in the end:
return true
end
function test:startSomething()
--Do something here. You can have as many functions/variables as you want, just try to keep using "self."
end
Code: Select all
return test
A couple of things to keep in mind: the keys "Escape" and "F1" have predefined functions, so avoid using them. And if you want your screensaver to quit, do "quit()" instead of "love.event.quit()", as there's already a function that handles a few things before quitting.
I hope you guys enjoy it, because it was really fun for me doing this!