Search found 209 matches

by MrFariator
Sat Feb 27, 2021 9:20 am
Forum: Support and Development
Topic: Using an older love version gives out a black screen
Replies: 6
Views: 92

Re: Using an older love version gives out a black screen

As darkfrei said, the range love.graphics.setColor uses was changed from 0-255 to 0-1 in version 11.0 of löve . In order to run your code in an older version, you could add this code snippet, in main.lua or elsewhere: local originalSetColor = love.graphics.setColor love.graphics.setColor = function ...
by MrFariator
Thu Feb 25, 2021 2:58 am
Forum: Support and Development
Topic: Attempt to index local 'self' (a number value)
Replies: 10
Views: 245

Re: Attempt to index local 'self' (a number value)

Yeah, that's what the error traceback is good for. It will give you the chain of function calls that led to the error, and often in errors like this it's simply the previous step. Like the error you posted signals that line 21 in your state/level.lua might be the source, because it's the last place ...
by MrFariator
Wed Feb 24, 2021 9:27 pm
Forum: Support and Development
Topic: Attempt to index local 'self' (a number value)
Replies: 10
Views: 245

Re: Attempt to index local 'self' (a number value)

You can access the score with self.score, that's perfectly fine. But you need to be mindful of how you invoke the function. To further drill the point, consider the following: function Score.update(self, amount) self.score = self.score + amount -- the 'self' is explicitly passed as the first paramet...
by MrFariator
Wed Feb 24, 2021 6:19 pm
Forum: Support and Development
Topic: Attempt to index local 'self' (a number value)
Replies: 10
Views: 245

Re: Attempt to index local 'self' (a number value)

If you want to create multiple score tracking objects (assuming a OOP approach, like OP's code), you could do something along the lines of: -- score.lua local Score = {} Score.__index = Score function Score.new ( initialScore ) local newScoreTracker = {} newScoreTracker.score = initialScore or 0 set...
by MrFariator
Wed Feb 24, 2021 12:43 pm
Forum: Support and Development
Topic: Attempt to index local 'self' (a number value)
Replies: 10
Views: 245

Re: Attempt to index local 'self' (a number value)

This is a mix up between the dot (.) and colon (:) syntax. Consider the following: function Score.load(self) self.score = 0 end Score.load(Score) -- is syntactically equivalent to function Score:load() self.score = 0 end Score:load() When you use the colon syntax, you are implicitly sending the tabl...
by MrFariator
Mon Feb 15, 2021 3:10 pm
Forum: Support and Development
Topic: % over math.fmod for IEEE remainder not working
Replies: 1
Views: 83

Re: % over math.fmod for IEEE remainder not working

This is more of an implementation detail with lua (and luajit), than it is with löve. I believe this lua mailing list post might be relevant.
by MrFariator
Sun Feb 14, 2021 12:00 pm
Forum: Libraries and Tools
Topic: SUPER STRICT for LUA
Replies: 31
Views: 12718

Re: SUPER STRICT for LUA

Couldn't get that one to specifically trigger, so I'm assuming it's working now. However, now I found a new issue regarding comments: return function ( item, other ) if --[[other.isSlope or]] (other.isSolid and other.isPassable) then return "cross" elseif other.isSolid or other.isPlayer or other.isB...
by MrFariator
Fri Feb 05, 2021 9:35 am
Forum: General
Topic: how to check for errors in the syntax of scripts for love2d?
Replies: 9
Views: 1247

Re: how to check for errors in the syntax of scripts for love2d?

To add to ivan's response, you could also use Luacheck.
by MrFariator
Thu Jan 28, 2021 11:06 pm
Forum: Support and Development
Topic: question about Love.js security
Replies: 42
Views: 9489

Re: question about Love.js security

For any modern games, you can disassemble any game that uses Unity or Monogame with relative ease - so take your pick from all the games that opens up. They might not be Fortnite popular, but they are there. For copyright reasons, you are unlikely to find those games' source codes dumped github or e...
by MrFariator
Thu Jan 28, 2021 10:46 pm
Forum: Support and Development
Topic: question about Love.js security
Replies: 42
Views: 9489

Re: question about Love.js security

Here is a handy list, and it's probably incomplete. The list includes titles such as Doom, Doom 3, Diablo, Pokemon Red & Blue, Sonic the Hedgehog, among others. As you might notice, some of these were released by the developers (Doom), while others were reverse engineered.