Search found 76 matches

by spir
Sun Oct 28, 2012 7:05 pm
Forum: Support and Development
Topic: [solved] creating and modifying graphics only once
Replies: 14
Views: 2721

Re: creating and modifying graphics only once (newbie)

PS: What I'm currently seeing as solution for using Löve's present interface about graphic drawing: create a kind of super-structure storing all game/world state related to graphics/user interface; and a super-func drawing all of that. Call this super-func from love.draw. What do you think? How do y...
by spir
Sun Oct 28, 2012 6:45 pm
Forum: Support and Development
Topic: (Lua) Working with empty nested tables via loop
Replies: 3
Views: 1433

Re: (Lua) Working with empty nested tables via loop

Well, you're only filling the diagonals. This should do the trick: for i = 1, worldSize do for j = 1, worldSize do worldMap[i][j] = 1 end end and make sure worldMap is a table too! indeed! What you need is (below the code of seq_notation): size = 3 map = {} for i = 1, size do map[i] = {} -- *** -- ...
by spir
Sun Oct 28, 2012 6:27 pm
Forum: Support and Development
Topic: [solved] creating and modifying graphics only once
Replies: 14
Views: 2721

Re: creating and modifying graphics only once (newbie)

Indeed. And there are ways to improve performance if necessary: you don't have to draw everything to the screen straight away. If you draw to a buffer once, you can just draw the buffer every frame, which is normally faster than rendering a complete image from scratch. The buffer can be changed whe...
by spir
Sun Oct 28, 2012 6:19 pm
Forum: Support and Development
Topic: [solved] creating and modifying graphics only once
Replies: 14
Views: 2721

Re: creating and modifying graphics only once (newbie)

Hi spir, Welcome to the forums! If it is really so, why that? As I see it, typically, one would draw base graphics just once (say, the initial state of a map), and then draw each change (say, a character steps to next tile), again just once. There is a reason. The library LÖVE uses to draw things o...
by spir
Sun Oct 28, 2012 5:50 pm
Forum: Support and Development
Topic: (Lua) Passing variable from one function to another?
Replies: 9
Views: 3647

Re: (Lua) Passing variable from one function to another?

Actually, a piece of code where you'd better see what a global var means, and why it's bad ;-), looks like: var = 1 inc_var = function () var = var + 1 end print(var) inc_var() print(var) Typically, if you have data outside functions, then they certainly mean something in your "world". The...
by spir
Sun Oct 28, 2012 2:19 pm
Forum: Support and Development
Topic: [solved] creating and modifying graphics only once
Replies: 14
Views: 2721

[solved] creating and modifying graphics only once

Hello, I'm new to Löve -- and to game engines in general. First, thank you authors for this framework. Overall, it seems very nice and clear. Currently exploring the interface. I have however an issue about changes in graphics: how to make them only once? and how to have everything drawn only once, ...