love.audio help[PLEASE D:

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.
Post Reply
User avatar
baconhawka7x
Party member
Posts: 491
Joined: Mon Nov 21, 2011 7:05 am
Location: Oregon, USA
Contact:

love.audio help[PLEASE D:

Post by baconhawka7x »

Well, I've figured out how to play random songs. But I want to change the song selection while the player is in horde mode. So.
When the player is in camp(not fighting zombies) the music selection is a normal set of minecraft music.
But when he goes into horde mode(smokin' zombehs!!!) I want the music selection to be a set of minecraft music dubstep remix's I've made.

My songs are in tables..

Code: Select all

song = {love.audio.newSource("songs/song1.mp3"), love.audio.newSource("songs/song2.mp3"), love.audio.newSource("songs/song3.mp3"), love.audio.newSource("songs/song4.mp3"), love.audio.newSource("songs/song5.mp3"), love.audio.newSource("songs/song6.mp3")}
remix = {love.audio.newSource("songs/remix1.wav")}
I only have one song so far.
and...

Code: Select all

if steve.x > groundWidth * 5 - 43 and
	camp == true and
	horde_locked == false and
	awesome_timer == 3 then
		wave = wave + 1
		spawnweight = spawnweight + 0.001
		camp = false
		horde = true
		steve.x = 5
		camera.x = 0
		kill_limit = kill_limit + 5
		zombie_health = zombie_health + 0.5
		kills = 0
	
^Transitions the player into horde mode, and..
|
|

Code: Select all

if kills > kill_limit then
		awesome_timer = awesome_timer - dt
		party_modeActive = true
		table.remove(zombie)
		
	end
	if awesome_timer < 0 then
		
		camp_alpha = 0
		party_modeActive = false
		red = 232
		blue = 255
		green = 232
		rednight = 10
		greennight = 10
		bluenight= 35
		colorred = 255
		colorblue = 255
		colorgreen = 255
		housecolorred = 150
		housecolorblue = 150
		housecolorgreen = 150
		stevecolor_red = 255
		stevecolor_green = 255
		stevecolor_blue = 255
		horde = false
		steve.x = 5
		camera.x = 0
		camp = true
		awesome_timer = 3
	end
^ transitions the player back to camp, party_modeActive is basically a seizure of flashing colors that lasts until the awesome_timer < 0 so how would I change the song playing?(Without taking up too much space, for example, playing a song every single frame).

I play my songs with..

Code: Select all

songplaying = pickOne(song)
	love.audio.setVolume(0.4)
	love.audio.play(songplaying)
pick one, selects a random song out of the table "song"
Post Reply

Who is online

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