How do you change backgrounds when a key is pressed?
Posted: Fri Dec 30, 2011 12:17 pm
Hi, i am quite new to love2d, but i am playing around with it and starting to get the hang of the basic commands.
So i thought it would be cool if i had a background, then pressed a key, and the background would change. This could also be usefull for making games where you press a key when in the menu and then you suddenly can select a level on an entirely new background.
I got the code working, but when i tested it, the new background just flashes, then the old one comes back. This could have something to do with the fact that i do not remove the old background. If it is as simple as that, please tell me how, if else, tell me anyway.
Thanks in advance! /Randomgajmes
So i thought it would be cool if i had a background, then pressed a key, and the background would change. This could also be usefull for making games where you press a key when in the menu and then you suddenly can select a level on an entirely new background.
I got the code working, but when i tested it, the new background just flashes, then the old one comes back. This could have something to do with the fact that i do not remove the old background. If it is as simple as that, please tell me how, if else, tell me anyway.
Thanks in advance! /Randomgajmes