Search found 1549 matches

by raidho36
Thu Feb 22, 2018 5:33 pm
Forum: Support and Development
Topic: Same randomness between instances of the same class
Replies: 2
Views: 71

Re: Same randomness between instances of the same class

Just don't touch your seed value. Then every time you call random, it'll be different. PRNGs always produce identical series of numbers given identical seed. Series are fairly long and impossible to memorize so they appear random, and in-game with different number of times this function is called pe...
by raidho36
Wed Feb 21, 2018 6:55 pm
Forum: General
Topic: Grab part of screen, draw, replace
Replies: 4
Views: 141

Re: Grab part of screen, draw, replace

You can draw to an intermediate render target, then perform manipulations with it, and finally put it on the screen.
by raidho36
Sat Feb 17, 2018 12:05 pm
Forum: Support and Development
Topic: Disable key repeat?
Replies: 22
Views: 707

Re: Disable key repeat?

LÖVE mainly handles input via events, the "isDown" is for quick and dirty hacks mid-development and you shouldn't rely on it.
by raidho36
Fri Feb 16, 2018 7:34 pm
Forum: Games and Creations
Topic: Metal Slug Type Game [Prototype]
Replies: 2
Views: 294

Re: Metal Slug Type Game [Prototype]

Odd choice of player sprites.
by raidho36
Fri Feb 16, 2018 7:31 pm
Forum: Support and Development
Topic: Disable key repeat?
Replies: 22
Views: 707

Re: Disable key repeat?

My input library (see signature) supports "wasDown" function which returns "true" or "false" if the key was depressed or released on the previous frame.
by raidho36
Fri Feb 16, 2018 4:05 pm
Forum: Support and Development
Topic: Disable key repeat?
Replies: 22
Views: 707

Re: Disable key repeat?

The isDown function returns "true" for as long as the button is depressed, "false" otherwise. Simple, really. You can get individual press or release events using event handler, and they will indicate if it's a system repeated press or not.
by raidho36
Fri Feb 16, 2018 8:05 am
Forum: Support and Development
Topic: luajit - attempt to index global 'love' (a nil value)
Replies: 18
Views: 589

Re: luajit - attempt to index global 'love' (a nil value)

Well it's a given that bytecode generated for Lua 5.1 will not work with Lua 5.2 either, so that's not really an argument.

As far as I'm concerned, Lua 5.2 or 5.3 didn't add anything that LuaJIT 5.1 doesn't have.
by raidho36
Thu Feb 15, 2018 5:47 pm
Forum: Support and Development
Topic: luajit - attempt to index global 'love' (a nil value)
Replies: 18
Views: 589

Re: luajit - attempt to index global 'love' (a nil value)

Note that JIT is disabled by default on mobile - on iOS it's because JIT violates AppStore policy, and on Android it's because often enough performance will be many times worse than in interpreted mode. If you want to improve performance, there is a number of tricks you can employ. Use FFI C structs...
by raidho36
Thu Feb 15, 2018 2:21 pm
Forum: Support and Development
Topic: Ternary operator for just two possibilities?
Replies: 9
Views: 258

Re: Ternary operator for just two possibilities?

You check against "1", not "variable", so it doesn't work. Note that this is not a real ternary operator, it's just the way Lua's "and" and "or" work allows to make things like that. It will fail to work if your first value resolves to "false" and will return the second value instead.