
Search found 3077 matches
- Fri Nov 07, 2014 1:34 pm
- Forum: General
- Topic: Show off clean code examples
- Replies: 13
- Views: 3572
Re: Show off clean code examples
they are both false in a sense, but you can indeed test explicitly if the return value is nil, or not (Rudimentary ternary logic ftw
)

- Fri Nov 07, 2014 5:35 am
- Forum: General
- Topic: Noob help, can't run .lua file
- Replies: 10
- Views: 4698
Re: Noob help, can't run .lua file
It does support plain ZIPs as well.
- Thu Nov 06, 2014 8:44 pm
- Forum: Support and Development
- Topic: Run pure lua programs
- Replies: 6
- Views: 2883
Re: Run pure lua programs
agreed, i did not actually state that he should set console to false, just that i wasn't sure whether window was needed for the console window or not; guess not then! 

- Wed Nov 05, 2014 11:19 pm
- Forum: Support and Development
- Topic: Run pure lua programs
- Replies: 6
- Views: 2883
Re: Run pure lua programs
or you could do t.window = false in your conf, so it's not even initialized... OR even better, just set the window module to false, so it's not even loaded. (i -think- it's not needed for a console on win, and on other OSes, it interfaces with the proper console anyway)
- Wed Nov 05, 2014 5:30 pm
- Forum: Support and Development
- Topic: Smoothly rotate to face the cursor
- Replies: 11
- Views: 3865
Re: Smoothly rotate to face the cursor
Sorry for the bump, but I'm trying to make this work, where did you get 'goal' and 'current' and 'dt' from? Nil values... NIL VALUES EVERYWHERE... Those are parameters. You define them somewhere, and pass them to the function for it to work on. not gonna give code (yet anyway), but: goal - should b...
- Tue Nov 04, 2014 12:56 pm
- Forum: Support and Development
- Topic: attempt to call method 'draw' a nil value
- Replies: 5
- Views: 3108
Re: attempt to call method 'draw' a nil value
of course, you do not need to use metatables for something simple: local units = {} local draw = function(self) love.graphics.circle( 'fill', self.x, self.y, 2 ) end local update = function(self,dt) -- meh end local unit = {} function unit.create(x, y) local new = {x=x, y=y} new.draw = draw new.upda...
- Tue Nov 04, 2014 10:10 am
- Forum: Libraries and Tools
- Topic: LÖVE3D
- Replies: 202
- Views: 113842
Re: LOVE3D: For Realsies
even with raw opengl calls, i could utilize it as 3D backgrounds for a 2D game, for example; that wouldn't need too much power. 

- Tue Nov 04, 2014 5:23 am
- Forum: Support and Development
- Topic: attempt to call method 'draw' a nil value
- Replies: 5
- Views: 3108
Re: attempt to call method 'draw' a nil value
Love complains because unit.x and unit.y are tables, not numbers. The thing is, you don't even need those tables since you save the x and y in the units table anyway. The code function unit:draw() love.graphics.draw(unit.img, units.x, units.y would work, but you don't iterate over all the units with...
- Tue Nov 04, 2014 5:13 am
- Forum: General
- Topic: Sprite Lamp with LÖVE?
- Replies: 2
- Views: 1986
Re: Sprite Lamp with LÖVE?
The light vs shadow engine, or rather, it's successor, may be able to do this already; and it's free in both ways.
- Sun Nov 02, 2014 10:12 am
- Forum: Support and Development
- Topic: Loading a .lua file multiple times...
- Replies: 10
- Views: 3917
Re: Loading a .lua file multiple times...
i'm assuming your lua file has something like at the end of it, since you assign it via require to a variable.
Just change that to something like
That will make it instantiable, if i didn't mess up 
Code: Select all
return aiTable
Just change that to something like
Code: Select all
return setmetatable({state,variables,go,here},aiTableOfMethodsOnly)
