Search found 212 matches

by KayleMaster
Thu Sep 01, 2016 7:07 am
Forum: Support and Development
Topic: Limit framerate to exactly 60
Replies: 10
Views: 6256

Re: Limit framerate to exactly 60

zorg wrote:@KayleMaster: That caps frames per second, it does not give you a constant rate for logic, or anything Nilxoc wanted to do.
Ugh, here I am again, with my "GML" knowledge where fps and game logic is the same thing. (well at least you could uncouple them tho)
by KayleMaster
Thu Sep 01, 2016 7:03 am
Forum: Support and Development
Topic: Local variables and global variables
Replies: 40
Views: 8937

Re: Local variables and global variables

raidho36 wrote:
Yes your GameMaker background is apparent from the way you code.

That's why I prefer using underscores rather than dots. I just think it's way more readable, just my opinion tho.
by KayleMaster
Wed Aug 31, 2016 7:42 pm
Forum: Support and Development
Topic: Limit framerate to exactly 60
Replies: 10
Views: 6256

Re: Limit framerate to exactly 60

What about LOVE's tutorial on capping fps? function love.load() min_dt = 1/30 --fps next_time = love.timer.getTime() end function love.update(dt) next_time = next_time + min_dt --rest of function here end function love.draw() --rest of function here local cur_time = love.timer.getTime() if next_time...
by KayleMaster
Wed Aug 31, 2016 9:13 am
Forum: Support and Development
Topic: Multidimensional array returns nil.
Replies: 8
Views: 1805

Re: Multidimensional array returns nil.

Yeah, It was somewhere else in the code.
by KayleMaster
Wed Aug 31, 2016 8:02 am
Forum: Support and Development
Topic: Local variables and global variables
Replies: 40
Views: 8937

Re: Local variables and global variables

What if I did this in my second file?

Code: Select all

local chunk_width = 15

function get_chunk_width()
    return chunk_width
end

And I could just do get_chunk_width in main.lua
Is this slow? Is this preferred over using the global environment ?
by KayleMaster
Tue Aug 30, 2016 6:41 pm
Forum: Support and Development
Topic: Local variables and global variables
Replies: 40
Views: 8937

Re: Local variables and global variables

Well, I'm not really a beginner, I came from GM:S so I know my way around.
The problem is I'm working on a large-scale game (huh, I've wondered if this is the hundredth time you heard this) so I'd really prefer the multiple files convenience. I'd guess I would use globals after all. (for some stuff)
by KayleMaster
Tue Aug 30, 2016 3:48 pm
Forum: Support and Development
Topic: Local variables and global variables
Replies: 40
Views: 8937

Re: Local variables and global variables

Maybe it's better to keep my game in one file mostly then :/
by KayleMaster
Tue Aug 30, 2016 11:29 am
Forum: Support and Development
Topic: Local variables and global variables
Replies: 40
Views: 8937

Re: Local variables and global variables

So If I put return varname in my second file, it's scope will also be extended to the file that called that file? (in this case main.lua) Why are we initializing variables just there and not in love.load() as it is said in love2d beginner tutorial? If I do local varname in love.load, does it mean I ...
by KayleMaster
Tue Aug 30, 2016 10:53 am
Forum: Support and Development
Topic: How to make a clicked image (button) draw an image[SOLVED]
Replies: 7
Views: 2057

Re: How to make a clicked image (button) draw an image

So that's how you create instances...
by KayleMaster
Tue Aug 30, 2016 10:50 am
Forum: Support and Development
Topic: Local variables and global variables
Replies: 40
Views: 8937

Local variables and global variables

I often notice when somebody asks a question for love2d and supplies code, the one who answers that with the new code always changes the global variables to local. For example: function love.load() --Version, title and window information version = 0.001; width, height, flags = love.window.getMode();...