Skip to content
This repository has been archived by the owner on Mar 10, 2021. It is now read-only.

Possible incompatibility with Löve 11.0 #4

Closed
coelhucas opened this issue Apr 26, 2018 · 2 comments
Closed

Possible incompatibility with Löve 11.0 #4

coelhucas opened this issue Apr 26, 2018 · 2 comments

Comments

@coelhucas
Copy link

I was following your tutorial at a327ex/blog#16 and realized that when I do this:

	for i = 10, 0, -1 do
		timer:after(0.5, print(love.math.random()))
	end

After the prints, I get this error:
`Error

libraries/timer.lua:42: attempt to call field 'action' (a nil value)

Traceback

libraries/timer.lua:42: in function 'update'
main.lua:69: in function 'update'
main.lua:35: in function main.lua:17
[C]: in function 'xpcall'`

@flamendless
Copy link

You need to pass an anonymous function.

for i = 10, 0, -1 do
  timer:after(0.5, function()
    print(love.math.random())
  end))
end

@coelhucas
Copy link
Author

Oh, my bad. Thank you!

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants