Search found 175 matches

by Hexenhammer
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: 2343

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...
by Hexenhammer
Thu Mar 07, 2013 8:46 pm
Forum: General
Topic: Return not returning
Replies: 18
Views: 5306

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[higherCard]" s...
by Hexenhammer
Wed Mar 06, 2013 7:13 am
Forum: General
Topic: Good examples/read on handling data?
Replies: 6
Views: 1151

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...
by Hexenhammer
Mon Mar 04, 2013 10:30 pm
Forum: Support and Development
Topic: Collision (Need Help)
Replies: 19
Views: 3883

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 ...
by Hexenhammer
Mon Mar 04, 2013 10:09 pm
Forum: Support and Development
Topic: Collision (Need Help)
Replies: 19
Views: 3883

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.
by Hexenhammer
Mon Mar 04, 2013 9:57 pm
Forum: Support and Development
Topic: Collision (Need Help)
Replies: 19
Views: 3883

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 called "rect" but there is an object called "...
by Hexenhammer
Mon Mar 04, 2013 9:53 pm
Forum: Support and Development
Topic: Collision (Need Help)
Replies: 19
Views: 3883

Re: Collision (Need Help)

TheScriptan wrote:Umm, yeah, but the error goes to 23 line, which is

Code: Select all

if CheckCollision bla bla bla
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.
by Hexenhammer
Mon Mar 04, 2013 9:49 pm
Forum: Support and Development
Topic: Collision (Need Help)
Replies: 19
Views: 3883

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. they can be used everywhere. According to t...
by Hexenhammer
Mon Mar 04, 2013 9:41 pm
Forum: Support and Development
Topic: Collision (Need Help)
Replies: 19
Views: 3883

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?
by Hexenhammer
Mon Mar 04, 2013 9:33 pm
Forum: Support and Development
Topic: Games To Create First?
Replies: 8
Views: 1476

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 beginner. Next up the ladde...