Heavy newb questions I need to get off my chest..

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Xoria
Citizen
Posts: 61
Joined: Sun Jan 31, 2010 1:24 am

Heavy newb questions I need to get off my chest..

Post 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
Attachments
main.lua
(6.11 KiB) Downloaded 235 times
laconix
Prole
Posts: 4
Joined: Fri Feb 05, 2010 6:19 am

Re: Heavy newb questions I need to get off my chest..

Post by laconix »

For #1 you could always do:

Code: Select all

starttime = love.timer.getTime()
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.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: Heavy newb questions I need to get off my chest..

Post 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.
MusicQueue.love
0.6.1
(220.53 KiB) Downloaded 249 times
Last edited by TechnoCat on Mon Feb 08, 2010 3:03 pm, edited 1 time in total.
laconix
Prole
Posts: 4
Joined: Fri Feb 05, 2010 6:19 am

Re: Heavy newb questions I need to get off my chest..

Post 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).
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: Heavy newb questions I need to get off my chest..

Post 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.
Xoria
Citizen
Posts: 61
Joined: Sun Jan 31, 2010 1:24 am

Re: Heavy newb questions I need to get off my chest..

Post 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?
matty
Prole
Posts: 3
Joined: Mon Feb 08, 2010 3:35 am

Re: Heavy newb questions I need to get off my chest..

Post 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
osuf oboys
Party member
Posts: 215
Joined: Sun Jan 18, 2009 8:03 pm

Re: Heavy newb questions I need to get off my chest..

Post 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 :)
If I haven't written anything else, you may assume that my work is released under the LPC License - the LÖVE Community. See http://love2d.org/wiki/index.php?title=LPC_License.
Xoria
Citizen
Posts: 61
Joined: Sun Jan 31, 2010 1:24 am

Re: Heavy newb questions I need to get off my chest..

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

Re: Heavy newb questions I need to get off my chest..

Post 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.
Help us help you: attach a .love.
Post Reply

Who is online

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