Page 1 of 2
Heavy newb questions I need to get off my chest..
Posted: Sun Feb 07, 2010 4:57 am
by Xoria
1. With the new 6.1 update, can someone please explain how to play the music in the file, and after song1 is finished move to song2?
2. To the particle demo, there's a list of systems that goes something like this:
Code: Select all
------1
local p = love.graphics.newParticleSystem(part1, 1000)
p:setEmissionRate(100)
p:setSpeed(300, 400)
p:setGravity(0)
p:setSize(2, 1)
p:setColor(255, 255, 255, 255, 58, 128, 255, 0)
p:setPosition(400, 300)
p:setLifetime(1)
p:setParticleLife(1)
p:setDirection(0)
p:setSpread(360)
p:setRadialAcceleration(-2000)
p:setTangentialAcceleration(1000)
p:stop()
table.insert(systems, p)
-------2
p = love.graphics.newParticleSystem(part1, 1000)
p:setEmissionRate(200)
p:setSpeed(0.001, 0.005)
p:setSize(0.11, 0.13)
p:setColor(255, 255, 255, 5, 255, 128, 128, 220)
p:setPosition(400, 300)
p:setLifetime(1)
p:setParticleLife(2)
p:setDirection(0)
p:setSpread(360)
p:setTangentialAcceleration(2000)
p:setRadialAcceleration(-10)
p:stop()
table.insert(systems, p)
I have trouble adding love.physics things to the list. Like a ball with gravity. The full lua file is attached. Is there ANY way to draw like, a ball with an image texture from love.physics?
Tia
Re: Heavy newb questions I need to get off my chest..
Posted: Sun Feb 07, 2010 9:35 am
by laconix
For #1 you could always do:
and check every update:
Code: Select all
function love.update(dt)
if love.time.getTime() - starttime >= tracktime then
love.audio.play(nexttrack)
starttime = love.timer.getTime()
end
end
Remember
getTime() retreives the time in seconds (since the application started?).
For #2, you're trying to add a physics object to a particle system. You can only add physics object to a physics
world.
Check out my post
here for little more detail on how to use
love.physics.
Re: Heavy newb questions I need to get off my chest..
Posted: Sun Feb 07, 2010 10:19 pm
by TechnoCat
I made a music queue that will play through the source files in order. It will start the next one when the current one finished playing.
Re: Heavy newb questions I need to get off my chest..
Posted: Mon Feb 08, 2010 7:53 am
by laconix
TechnoCat wrote:...Not being able to attach files is getting mighty annoying.
Get a
dropbox account. Quite a handy thing to have, it lets you have a folder and any files in the folder while be synced onto their server. And you can choose which files to share publicly or keep private (I haven't had a need to use it recently, but I believe it still has these features).
Re: Heavy newb questions I need to get off my chest..
Posted: Mon Feb 08, 2010 2:15 pm
by TechnoCat
I have used Dropbox for over a year now. I still want to attach files to the forum because eventually, I will delete these files I have linked to.
Re: Heavy newb questions I need to get off my chest..
Posted: Mon Feb 08, 2010 4:54 pm
by Xoria
Very nice. I learned a lot from that. Also, how can any one make it so that if a type of particle touches nothing, "something" happens?
Re: Heavy newb questions I need to get off my chest..
Posted: Thu Feb 11, 2010 3:38 am
by matty
Great example.
Is there anyway to tell the position you are at in the song? For example, if you wanted to queue and event to happen 20 seconds into the track? I've looked through the love.audio functions, and it looks like there isn't a way - other than maybe starting a timer or grabbing getTime() when you start the track and then subtracting this from the current time in a love.update loop?
Thanks
Matty
Re: Heavy newb questions I need to get off my chest..
Posted: Fri Feb 12, 2010 10:18 pm
by osuf oboys
Not sure the questions were fully answered so let me add a few comments..
1. How about Source.isStopped
2. I don't understand the question. What is the connection relation particle systems and physics? You use one without the other and properties from one does not carry to the other.
If you want a particle system to use images, you can use setSprite.
If you use love.physics and wishes to draw images for the shapes, go ahead. love.physics only says where things are and what physical properties they have. It says nothing about how they look. If you want a ball to look like a ball, then find the position of the ball and put an image of the right size and rotation there.
Hope it helps somewhat at least
Re: Heavy newb questions I need to get off my chest..
Posted: Sun Feb 14, 2010 2:57 pm
by Xoria
It does, but how can one make it so that the exe file won't get too large? I have 35+ songs to put on my game
Re: Heavy newb questions I need to get off my chest..
Posted: Sun Feb 14, 2010 6:43 pm
by Robin
Xoria wrote:It does, but how can one make it so that the exe file won't get too large? I have 35+ songs to put on my game
You mean the code? The harddisk space used by 35+ songs is enough for the source code of several operating systems.