Re: LUNAR Lua+Narrative
Posted: Wed Aug 22, 2012 3:18 pm
Can I put the save and load function in love.update instead? and what are meta tables? Can I use plain variables like save_state and load_state instead of save.state and load.state.
Are you saying I just toss the contents of the if statement into some variable and use that instead?
But I only check the collision once for the notepad and the canvas I actually never need to reuse the collision ever again, it is only for the floppy icon and nothing more. but I guess it might look cleaner or something...
What do you mean by that?Second, it is better to define once a collision check function and then reuse it, instead of repeating ;
CODE: SELECT ALL
if ... and ( save_icon.x > note.x ) and ( save_icon.x < note.x + note.width )
and ( save_icon.y > note.y ) and ( save_icon.y < note.y + note.height )
That is less verbose, and of course better.
Are you saying I just toss the contents of the if statement into some variable and use that instead?
But I only check the collision once for the notepad and the canvas I actually never need to reuse the collision ever again, it is only for the floppy icon and nothing more. but I guess it might look cleaner or something...