Page 4 of 5
Re: inflЁxion - [snake/pacman with particles]
Posted: Fri May 22, 2009 10:13 am
by bartbes
No, that's not the seed, do you ever set the seed? (math.randomseed) If you don't, a good place to start is using math.randomseed(os.time()), which should not be the same, unless you've got a really short game.
Re: inflЁxion - [snake/pacman with particles]
Posted: Fri May 22, 2009 10:31 am
by Robin
bartbes wrote:unless you've got a really short game.
You mean if the game is started twice in the same second?
Re: inflЁxion - [snake/pacman with particles]
Posted: Fri May 22, 2009 10:46 am
by bartbes
Somewhere floating around the forums is a post stating that the difference between a certain number of seconds is negligible, we're talking about 2<x<10 seconds.
EDIT: Made a nice math expression from it, looks a lot better.
Re: inflЁxion - [snake/pacman with particles]
Posted: Fri May 22, 2009 11:44 am
by thelinx
Trippy
Re: inflЁxion - [snake/pacman with particles]
Posted: Sat May 23, 2009 5:51 pm
by CR4SH3D
ive created waves of enemies with arrays (kill the original enemy to cycle waves) but ive found that the mousejoints
don't follow the same coordinates as the original one
as a test ive set the first wave of enemies to set the target of the original (with particles) and they dont follow it at all
whats up with that? :S cant really get any further with it if they dont follow the coordinates of the actual game
line 659 for the movement of the first wave
//edit
they seem to think 0,0 is where ever they spawn not the top left
Re: inflЁxion - [snake/pacman with particles]
Posted: Sat May 23, 2009 11:27 pm
by qubodup
Have a vid!
http://www.youtube.com/watch?v=aHmdXeUgQXQ
Read video description if you have questions!
Sorry to ask, but did you pick some license for this flashy snake game?
Re: inflЁxion - [snake/pacman with particles]
Posted: Sun May 24, 2009 6:09 am
by bartbes
CR4SH3D wrote://edit
they seem to think 0,0 is where ever they spawn not the top left
Yes, that sounds correct when you're moving the joints, as they are relative to the body, you should be moving the body.
Re: inflЁxion - [snake/pacman with particles]
Posted: Sun May 24, 2009 8:30 am
by CR4SH3D
bartbes wrote:CR4SH3D wrote://edit
they seem to think 0,0 is where ever they spawn not the top left
Yes, that sounds correct when you're moving the joints, as they are relative to the body, you should be moving the body.
im moving them using setTarget though? and it works for the other one
Re: inflЁxion - [snake/pacman with particles]
Posted: Sun May 24, 2009 8:42 am
by bartbes
I can't do anything about it, it's the body you have to move.
Re: inflЁxion - [snake/pacman with particles]
Posted: Sun May 24, 2009 10:56 am
by CR4SH3D
found a solution
Code: Select all
for i,v in ipairs(wavesaj) do --Loop through each wave
wv = 1
for i2 = 1,wavesizes[i] do
wavesaj[i][i2]:setTarget(math.random(0,gamewidth)-wavesax[i][i2],math.random(0,gameheight)-wavesay[i][i2])
wv = wv + 1
end
end
so store the original random coordinates in another array and minus them from teh coordinates when setting a new target, just have to sort out the indexing a nil value error though