Search found 5 matches

by Chaoselite
Sat Sep 03, 2011 5:01 pm
Forum: Support and Development
Topic: Random number keeps generating
Replies: 8
Views: 2829

Re: Random number keeps generating

Robin wrote:

Code: Select all

floor[i] = love.graphics.draw(stonetile, x*32, y*32)
This is madness. love.graphics.draw draws an image, it doesn't create a tile or something. As you can see on the wiki, it returns nothing.
Wow, didn't even see that it returned nothing, I'll just have it return the co-ordinates of the tile.
by Chaoselite
Sat Sep 03, 2011 4:16 pm
Forum: Support and Development
Topic: Random number keeps generating
Replies: 8
Views: 2829

Re: Random number keeps generating

Yeah, but the way I'm doing it currently isn't working when I'm trying to draw more tiles to make a room. Take a look and tell me what I'm doing wrong cause clearly this isn't working the way it's intended. function dungeongen() floor= {} for i=1, 26 do x = Randomnumber[i] y = Randomnumber[i+1] for ...
by Chaoselite
Fri Sep 02, 2011 8:33 pm
Forum: Support and Development
Topic: Random number keeps generating
Replies: 8
Views: 2829

Re: Random number keeps generating

Damnit... I was using {} instead of [] to get the number silly me. Thank you so much.

I got another question, how do I get the x, y position of a drawn graphic?
by Chaoselite
Fri Sep 02, 2011 8:13 pm
Forum: Support and Development
Topic: Random number keeps generating
Replies: 8
Views: 2829

Re: Random number keeps generating

I put it in a table but I'm not to sure how to call it as the random variable how would I do that? Sorry I'm a little noobish to lua.
by Chaoselite
Fri Sep 02, 2011 4:59 am
Forum: Support and Development
Topic: Random number keeps generating
Replies: 8
Views: 2829

Random number keeps generating

So I'm trying to make a procedural dungeon generator, but the problem is my number generator keeps generating new numbers and there for it keeps moving tiles. Is there anyway I can just make numbers that it generates static? I've tried storing them in a table then accessing the table but that didn't...