Search found 5 matches

by lushfoliage
Fri May 29, 2020 7:51 pm
Forum: Support and Development
Topic: Attempt to perform arithmetic on "color" a nil value.
Replies: 4
Views: 3576

Re: Attempt to perform arithmetic on "color" a nil value.

Ahaha...turns out in some functions I had brick:render() instead of Brick:render(), That should be the correct thing to have. You don't call an instance method on a class (Brick), you call it on the instances (brick). That's the whole point of the self parameter and the colon syntax. Mhmm this is d...
by lushfoliage
Fri May 29, 2020 7:00 pm
Forum: Support and Development
Topic: Attempt to perform arithmetic on "color" a nil value.
Replies: 4
Views: 3576

Re: Attempt to perform arithmetic on "color" a nil value.

Ahaha...turns out in some functions I had brick:render() instead of Brick:render(), however the bricks are all invisible now...I'll figure this out this whole coding business sooner or later.
by lushfoliage
Fri May 29, 2020 6:02 pm
Forum: Support and Development
Topic: Attempt to perform arithmetic on "color" a nil value.
Replies: 4
Views: 3576

Attempt to perform arithmetic on "color" a nil value.

Have a Brick class that declares self.color = 1 in its init function, and however when I call self.color in the Brick's render function, I get the error that color is a nil value. The code works perfectly fine if I replace self.color in Brick:render() with a 1, and also if I put self.color = 1 in th...
by lushfoliage
Mon May 18, 2020 5:37 pm
Forum: Support and Development
Topic: bad argument #2 to 'newSource' (string expected, got no value)
Replies: 3
Views: 4352

bad argument #2 to 'newSource' (string expected, got no value)

Hello, I've been taking Harvard's free game design course so I'm not particularly well-versed with lua or Love2D. When creating a global table for all of my sounds, I received this error: bad argument #2 to 'newSource' (string expected, get no value) I went as far as to copy and paste the code found...