I think you're using "food:draw()" instead of "fod:draw()".
Also, "fod" is a global, that might cause issues if you want to make more than one food.
Search found 6382 matches
- Sun Aug 16, 2015 8:27 am
- Forum: General
- Topic: tables, love.graphics.setColor and math.random problems
- Replies: 3
- Views: 2633
- Sun Aug 16, 2015 8:16 am
- Forum: Libraries and Tools
- Topic: [library] binser - Customizable Lua Serializer
- Replies: 13
- Views: 8798
Re: [library] binser - Customizable Lua Serializer
Nice, I'll check it out. The benchmark code is adapted from Serpent's: local ITERS = 1000 local ITERSD = 10000 package.path = package.path .. ';./../Smallfolk/?.lua' des = function(s) return loadstring(s)() end local TESTS = { serpent = {require("serpent").dump, des}, ser = {require('ser')...
- Sat Aug 15, 2015 10:47 am
- Forum: Support and Development
- Topic: "Questions that don't deserve their own thread" thread
- Replies: 905
- Views: 412262
Re: "Questions that don't deserve their own thread" thread
I didn't think using math.random() would work either. I'd just use: local shuffleRNG = love.math.newRandomGenerator(seed) function shuffle(t) for i = #t, 2, -1 do local j = shuffleRNG:random(1, i) t[i], t[j] = t[j], t[i] end end I don't think sorting with a random comparison function would work well...
- Fri Aug 14, 2015 10:23 am
- Forum: General
- Topic: What's faster: table or string?
- Replies: 4
- Views: 1293
Re: What's faster: table or string?
Use whatever makes sense (so tables in this case), and it'll probably be faster as a bonus. Saving numbers as strings takes more memory than as numbers, for example 126 is 1 byte when stores as a number and 3 bytes when stored as a string Okay, but that is wrong. How numbers are stored depends on th...
- Fri Aug 14, 2015 10:06 am
- Forum: General
- Topic: Suggestion for a new URL
- Replies: 13
- Views: 7942
Re: Suggestion for a new URL
It's a metal umlaut.Reenen wrote:As a point of historical interest... why is there an ö and not an o?
- Fri Aug 14, 2015 9:57 am
- Forum: Libraries and Tools
- Topic: Ser: a new old serialization library
- Replies: 22
- Views: 10022
Re: Ser: a new old serialization library
Yeah, I think the only downside is that slightly more bytes than needed will be used for 32-bit builds, but that's a trade-off I'm willing to make for maintainability, especially because I don't think Ser will be used often with those builds.
- Fri Aug 14, 2015 9:21 am
- Forum: Libraries and Tools
- Topic: [library] binser - Customizable Lua Serializer
- Replies: 13
- Views: 8798
Re: [library] binser - Customizable Lua Serializer
Cool! Some feedback: Number serialisation doesn't support +inf, -inf, nan, and it loses precision for double length builds of Lua "default" is spelled as "defualt" in some places That's it, I've got nothing else It's a very interesting implementation. I see it shares some design ...
- Tue Aug 11, 2015 1:49 pm
- Forum: Libraries and Tools
- Topic: Ser: a new old serialization library
- Replies: 22
- Views: 10022
Re: Ser: a new old serialization library
Thanks for the heads-up, ivan. What happens with that line for a single precision build?
The problem with removing that line is that tostring() is not precise enough for double precision builds of Lua. I'll have to think about the best course of action here.
The problem with removing that line is that tostring() is not precise enough for double precision builds of Lua. I'll have to think about the best course of action here.
- Fri Jul 17, 2015 12:57 pm
- Forum: Games and Creations
- Topic: NUMBERF/CKER (formerly Numberwang) - math game (not 2048)
- Replies: 24
- Views: 18179
- Sat Jul 04, 2015 9:56 am
- Forum: General
- Topic: Fullscreen problem in 0.9.2
- Replies: 2
- Views: 1941
Re: Fullscreen problem in 0.9.2
Okay! First, you check for love.keyboard.isDown("f") twice. So let's see what that does: if the f key is down, then: make the window fullscreen else, if the f key is not down then: if the f key is down then: make the window not fullscreen So you see, the last part is never used, because th...