Search found 1946 matches

by raidho36
Mon Dec 09, 2019 6:10 am
Forum: Support and Development
Topic: How to use local variables in games properly?
Replies: 4
Views: 206

Re: How to use local variables in games properly?

Passing around values: local function do_many_things ( foo, bar ) do_things ( foo, 1, 2, 3 ) do_other_things ( bar, 'a', 'b', 'c' ) end do_many_things ( table1, table2 ) Making local duplicates: local mmax, mmin, mabs = math.max, math.min, math.abs local function do_math ( value ) return mmax ( mmin...
by raidho36
Sun Dec 08, 2019 11:27 pm
Forum: Support and Development
Topic: How to use local variables in games properly?
Replies: 4
Views: 206

Re: How to use local variables in games properly?

You simply declare everything that doesn't needs to be globally accessible as local. That's it. Pass around values through function arguments if you need to. Making local duplicates of global variables helps with performance (but they don't track global variable changes). Don't go nuts with generati...
by raidho36
Sun Dec 08, 2019 11:16 pm
Forum: Support and Development
Topic: Are sprite batches the solution to my low FPS?
Replies: 2
Views: 123

Re: Are sprite batches the solution to my low FPS?

Overdraw doesn't by itself causes slowdowns, it's just usually every pixel is only rendered once (ideally) so in 1080p monitor you only have to process 2 million pixels per frame, but if you overdraw then this goes up by a multiple of overdraw passes, so with just a handful of fullscreen overdraws y...
by raidho36
Sun Dec 08, 2019 11:12 am
Forum: Support and Development
Topic: Running love2d programs with intellij idea [closed]
Replies: 5
Views: 211

Re: Running love2d programs with intellij idea

Well this has clearly nothing to do with your config because your argument #2 (A1) is nil, as appears in Menu.lua @ line 292. Pay attention to error messages, they tell you exactly what went wrong. You can make error messages point to specific mistakes in your code by adopting defensive programming ...
by raidho36
Sat Dec 07, 2019 9:44 pm
Forum: Support and Development
Topic: Running love2d programs with intellij idea [closed]
Replies: 5
Views: 211

Re: Running love2d programs with intellij idea

You must pass game directory as an argument, setting working directory does nothing.
by raidho36
Sat Dec 07, 2019 9:39 pm
Forum: Support and Development
Topic: setRequirePath() correct usage
Replies: 3
Views: 157

Re: setRequirePath() correct usage

Basically, you shouldn't touch require path, you should instead organize your project to work with default settings. This way you avoid ridiculous scenarios where the user has to install specific package managers to install specific Lua libraries in specific filesystem locations. Yes this means you ...
by raidho36
Sat Dec 07, 2019 9:33 pm
Forum: General
Topic: Lua function declarations
Replies: 6
Views: 203

Re: Lua function declarations

pixelfixation wrote:
Sat Dec 07, 2019 12:31 am
In Lua what is the difference between these two function declarations.
None.
by raidho36
Sat Dec 07, 2019 11:35 am
Forum: Support and Development
Topic: love.graphics.newCubeimage
Replies: 2
Views: 163

Re: love.graphics.newCubeimage

CubeImage is for cubemaps, 3d textures are a different thing entirely (and there's no simple way to render them).
by raidho36
Thu Dec 05, 2019 9:20 pm
Forum: General
Topic: Help with shaders [Solved]
Replies: 4
Views: 208

Re: Help with shaders

You don't need shaders for this, you can accomplish such effect by drawing glow effect into sprites, or rendering glow sprites over normal sprites. If you insist on using shaders, you 1) take the base scene image and subtract some value fixed from all color components, multiply the remaining values ...
by raidho36
Sun Dec 01, 2019 1:54 am
Forum: Support and Development
Topic: Managing bullet object lists
Replies: 3
Views: 371

Re: Managing bullet object lists

Bullet = Class ( ) function Bullet:init ( x, y, damage, ... ) bulletpool = Pool ( Bullet ) newbullet = bulletpool ( x, y, damage, ... ) bulletpool:push ( deadbullet ) Also my mistake. The "uarray.lua" datastructure has additional bookkeeping to prevent duplicate objects in it so you don't need to w...