Saving
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Saving
By the way, don't put the save call in Update. Put it in KeyPress. Else it will be calling the save function every frame. That's what KeyPress is for.
*Disclaimer: I haven't Löved in a while so I forgot what the function for KeyPress was called so it's probably something else.
*Disclaimer: I haven't Löved in a while so I forgot what the function for KeyPress was called so it's probably something else.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Saving
Yeah, you're right. It would probably best be something like:Jasoco wrote:By the way, don't put the save call in Update. Put it in KeyPress. Else it will be calling the save function every frame. That's what KeyPress is for.
Code: Select all
love.keypressed(key)
if key == 's' and (love.keyboard.isDown 'lctrl' or love.keyboard.isDown 'rctrl') then
-- save code here
end
end
Help us help you: attach a .love.
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: Saving
Yes another way, if on 0.7.0, is to put it in love.quit().
Code: Select all
function love.quit()
--Before quitting, save the new information to the savefile.
end
- Attachments
-
- SaveLoad.love
- 0.7.0
- (934 Bytes) Downloaded 87 times
Who is online
Users browsing this forum: No registered users and 4 guests