Search found 48 matches

by philnelson
Sat Feb 07, 2009 10:42 pm
Forum: Support and Development
Topic: Referring to individual sprites of the same time
Replies: 6
Views: 2666

Referring to individual sprites of the same time

I'm really banging my head on how to keeping items shown or hidden, like one might find in Nethack or the Mystery Dungeon series. Essentially: everything the player has actually been near is revealed, all else is hidden. I can't figure it out.
by philnelson
Thu Feb 05, 2009 12:10 am
Forum: General
Topic: lua tables
Replies: 6
Views: 5641

Re: lua tables

The key is significant to the operation I'm doing. It is a unique ID that is generated elsewhere.
by philnelson
Wed Feb 04, 2009 11:59 pm
Forum: General
Topic: lua tables
Replies: 6
Views: 5641

lua tables

This is a lua question, but I assume it will be of use to new love2d people, also. In PHP (the language I am most familiar with) I can, for example, create an multidimentional arrays like this: array[1]['field'] = "a value" , and then simply refer to it as array[1]['field'] in order to get...
by philnelson
Tue Feb 03, 2009 6:38 am
Forum: General
Topic: good seeding for math.random
Replies: 21
Views: 13361

Re: good seeding for math.random

The Wiki helped, specifically this:

Code: Select all

-- Initialize the pseudo random number generator
math.randomseed( os.time() )
math.random(); math.random(); math.random()
-- done. :-)
Calling math.random() 3 or 4 times before I actually need it seems to give me the results I need. Very weird.
by philnelson
Tue Feb 03, 2009 3:54 am
Forum: General
Topic: good seeding for math.random
Replies: 21
Views: 13361

Re: good seeding for math.random

I get the same result: 8, every single time running it via the Love executable in OS X and Windows XP. On OS X I just double click test.love, on windows I click and drag test.love (which contains the main.lua file posted by nunix) onto the Love.exe. 8 every time.
by philnelson
Tue Feb 03, 2009 3:41 am
Forum: General
Topic: good seeding for math.random
Replies: 21
Views: 13361

Re: good seeding for math.random

I am wondering if this is possibly an OS X issue? Both nunix and I are running Mac OS X 10.5 intel.
by philnelson
Sun Feb 01, 2009 5:48 am
Forum: General
Topic: good seeding for math.random
Replies: 21
Views: 13361

Re: good seeding for math.random

"seeming" random .vs. "being" random seems to be at issue, here. Getting numbers that "seem more random" is definitely a desirable goal, but how to accomplish it?
by philnelson
Sun Feb 01, 2009 3:41 am
Forum: General
Topic: good seeding for math.random
Replies: 21
Views: 13361

good seeding for math.random

I'm working on a roguelike engine using love2d, and I'm really hitting a wall with lua's math.random() function to get, you know, random numbers. The first thing I did was try os.time() as my randomseed, but that kind of falls apart when you are hitting it multiple times within one second ( using th...