## inflЁxion - [snake/pacman with particles]

Show off your games, demos and other (playable) creations.
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

### Re: inflЁxion - [snake/pacman with particles]

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.

Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

### Re: inflЁxion - [snake/pacman with particles]

bartbes wrote:unless you've got a really short game.
You mean if the game is started twice in the same second?
Help us help you: attach a .love.

bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

### Re: inflЁxion - [snake/pacman with particles]

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.

thelinx
The Strongest
Posts: 847
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

### Re: inflЁxion - [snake/pacman with particles]

Trippy

CR4SH3D
Citizen
Posts: 67
Joined: Mon Mar 02, 2009 6:00 pm
Location: England
Contact:

### Re: inflЁxion - [snake/pacman with particles]

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
Attachments
snake beta - (array movement).love
[i]line 659 for the movement of the first wave[/i]

qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

### Re: inflЁxion - [snake/pacman with particles]

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?
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)

bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

### Re: inflЁxion - [snake/pacman with particles]

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.

CR4SH3D
Citizen
Posts: 67
Joined: Mon Mar 02, 2009 6:00 pm
Location: England
Contact:

### Re: inflЁxion - [snake/pacman with particles]

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

bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

### Re: inflЁxion - [snake/pacman with particles]

I can't do anything about it, it's the body you have to move.

CR4SH3D
Citizen
Posts: 67
Joined: Mon Mar 02, 2009 6:00 pm
Location: England
Contact:

### Re: inflЁxion - [snake/pacman with particles]

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

### Who is online

Users browsing this forum: Google [Bot] and 4 guests