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 » Fri May 22, 2009 10:13 am

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 » Fri May 22, 2009 10:31 am

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 » Fri May 22, 2009 10:46 am

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: 847
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

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

Post by thelinx » Fri May 22, 2009 11:44 am

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 » Sat May 23, 2009 5:51 pm

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 75 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 » Sat May 23, 2009 11:27 pm

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 » Sun May 24, 2009 6:09 am

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 » Sun May 24, 2009 8:30 am

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 » Sun May 24, 2009 8:42 am

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 » Sun May 24, 2009 10:56 am

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: Google [Bot] and 4 guests