Search found 175 matches
- Tue Mar 12, 2013 2:44 pm
- Forum: Support and Development
- Topic: local vars to eliminate indexing - why do lovers do that ?
- Replies: 9
- Views: 4058
Re: local vars to eliminate indexing - why do lovers do that
It makes no sense to repeat a long dereference chain again and again. The repeated dereferencing is just noise which distracts from the signal (the logic of the algorithm). According to the documentation there is no performance gain if you use LuaJIT and if you have performance issues the first step...
- Thu Mar 07, 2013 8:46 pm
- Forum: General
- Topic: Return not returning
- Replies: 18
- Views: 11134
Re: Return not returning
The hand[x] returns do not seem to work; despite the fact that I am able to actually print out these objects right before the return, as you can see from some of the code right at the end (around line 80). The error is that they return nothing. Very strange. So in line 22 "print hand[higherCar...
- Wed Mar 06, 2013 7:13 am
- Forum: General
- Topic: Good examples/read on handling data?
- Replies: 6
- Views: 2269
Re: Good examples/read on handling data?
Lua has pretty good support for functional programming I think. However, I am not really qualified to say much about that given that I have very little experience with that style. But I can show you a basic example -- Imperative style for i = 1, #myTable do myFunction(myTable[i]) end -- Functional s...
- Mon Mar 04, 2013 10:30 pm
- Forum: Support and Development
- Topic: Collision (Need Help)
- Replies: 19
- Views: 10003
Re: Collision (Need Help)
Here is .love file, maybe you can find out what is wrong with if, because still can't find it, i used rectangle object only in game.lua :( Okay, found it (as promised! :) ). Just change the beginning of game.lua to this: rectangle = { {x = 0, y = 0, w = 128, h = 128}, {x = 400, y = 300, w = 128, h ...
- Mon Mar 04, 2013 10:09 pm
- Forum: Support and Development
- Topic: Collision (Need Help)
- Replies: 19
- Views: 10003
Re: Collision (Need Help)
Again, post the entire source. I don't get any errors in the parts of the source I can run. I guess you are destroying the "rectangle" object somewhere.. somewhere in the parts of the code you did not post.
- Mon Mar 04, 2013 9:57 pm
- Forum: Support and Development
- Topic: Collision (Need Help)
- Replies: 19
- Views: 10003
Re: Collision (Need Help)
"attempt to index global 'rectangle' (a nil value) '" "rectanlge" But there is no words like rectanlge, i can't find it. :brows: :? I did not write that. I said you wrote "rect" instead of "rectangle", and that causes an error because there is no object calle...
- Mon Mar 04, 2013 9:53 pm
- Forum: Support and Development
- Topic: Collision (Need Help)
- Replies: 19
- Views: 10003
Re: Collision (Need Help)
I don't see any other obvious problems. Post the entire source (i.e. something people can actually run) then I could easily tell you.TheScriptan wrote:Umm, yeah, but the error goes to 23 line, which isCode: Select all
if CheckCollision bla bla bla
- Mon Mar 04, 2013 9:49 pm
- Forum: Support and Development
- Topic: Collision (Need Help)
- Replies: 19
- Views: 10003
Re: Collision (Need Help)
"attempt to index global 'rectangle' (a nil value) '" That just means you try to use an object called "rectanlge" but no such object exists. "A nil value" = does not exist in Luaspeak. It says "global" because all objects are global by default in Lua i.e. the...
- Mon Mar 04, 2013 9:41 pm
- Forum: Support and Development
- Topic: Collision (Need Help)
- Replies: 19
- Views: 10003
Re: Collision (Need Help)
TheScriptan wrote:
for i=1, #rectangle do
love.graphics.rectangle("fill",rect.x,rectangle.y,rectangle.w,rectangle.h)
end
I think you mean "rectangle" here, right?
- Mon Mar 04, 2013 9:33 pm
- Forum: Support and Development
- Topic: -
- Replies: 8
- Views: 3912
Re: Games To Create First?
The very first "game" is usually "Guess the number". You only need to understand the very basics of conditionals and looping for that. Oh and basic text input/output. Unfortunately, LÖVE comes without a text input function and coding one yourself is not a task for a total beginne...