inflЁxion - [snake/pacman with particles]

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

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

Post 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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

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

Post by Robin »

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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post 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.
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

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

Post by thelinx »

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

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

Post 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 :x
Attachments
snake beta - (array movement).love
[i]line 659 for the movement of the first wave[/i]
(214.44 KiB) Downloaded 149 times
User avatar
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]

Post 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?
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)
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post by bartbes »

CR4SH3D wrote://edit
they seem to think 0,0 is where ever they spawn not the top left :x
Yes, that sounds correct when you're moving the joints, as they are relative to the body, you should be moving the body.
User avatar
CR4SH3D
Citizen
Posts: 67
Joined: Mon Mar 02, 2009 6:00 pm
Location: England
Contact:

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

Post by CR4SH3D »

bartbes wrote:
CR4SH3D wrote://edit
they seem to think 0,0 is where ever they spawn not the top left :x
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
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post by bartbes »

I can't do anything about it, it's the body you have to move.
User avatar
CR4SH3D
Citizen
Posts: 67
Joined: Mon Mar 02, 2009 6:00 pm
Location: England
Contact:

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

Post 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
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Bing [Bot] and 3 guests