Search found 6 matches

by FrogsFriend
Sun Mar 10, 2013 1:34 pm
Forum: General
Topic: Return not returning
Replies: 18
Views: 11100

Re: Return not returning

If you return the whole 'hand' (e.g. return hand ) it should be ok as it is. It's already in the format { {}, {}, {}, } that the code it's returning to is expecting. You only need to enclose the returned value in a table (e.g. return {hand[specific_card]} ) where you're just returning a single card ...
by FrogsFriend
Sun Mar 10, 2013 10:13 am
Forum: General
Topic: Return not returning
Replies: 18
Views: 11100

Re: Return not returning

Looking at this section: print("PLAYING A CARD NON AGRESSIVELY OR BASED ON RESETS"); --Resetting Variables Opponent_AI.isMultiples = false; --A little error catch to stop it returning no cards local handNum = 0; for i = 1, #hand do if( hand[i].number >= cardPile[#cardPile].number ) then ha...
by FrogsFriend
Fri Mar 08, 2013 10:21 pm
Forum: General
Topic: Return not returning
Replies: 18
Views: 11100

Re: Return not returning

Just to clarify, what is actually returned? zero, empty table, nill?

What do you see if you print the entire 'hand' table before calling the function, immediately the function starts and just before you return?
by FrogsFriend
Tue Feb 05, 2013 9:40 pm
Forum: Support and Development
Topic: need help with lookAt function for two objects
Replies: 3
Views: 2281

Re: need help with lookAt function for two objects

Something like this gives an angle in Radians.

Code: Select all

-- Returns the angle between two points.
function utils.angle(x1,y1, x2,y2)
	local angle = math.atan2(y2-y1, x2-x1)
	if angle < 0 then angle = angle + math.pi * 2 end
	return angle
end
http://polygeek.com/1819_flex_exploring-math-atan2
by FrogsFriend
Tue Oct 09, 2012 8:50 pm
Forum: General
Topic: Love2D - Font Messed Up!
Replies: 20
Views: 10767

Re: Love2D - Font Messed Up!

If you zoom in on the font it's clear that all the straight edges are very crisp, but the curves are blurred.

Is that the problem?
Is that the way the font is supposed to be?
by FrogsFriend
Sat Sep 29, 2012 9:10 am
Forum: Support and Development
Topic: Moving one point to another at a static speed
Replies: 11
Views: 7426

Re: Moving one point to another at a static speed

I had a similar problem when using gridlocked movement (only moving single hexes in my case but similar enough). Try calculating the move_distance_x and move_distance_y between the start point and end point of the move, then use something like: if player.moving == true then player.act_x = player.act...