diff options
| author | 1029chris <1029chris@gmail.com> | 2016-06-06 14:20:00 -0700 |
|---|---|---|
| committer | 1029chris <1029chris@gmail.com> | 2016-06-06 14:20:00 -0700 |
| commit | 0c3a6ca6190ad47e5fbe1dfaa45c45aa07b4ced9 (patch) | |
| tree | 479397f6f1b1e150ece5720669f68d184c4fcacf /viewer.lua | |
| parent | 2804461a5a44997f240ba769e0ac9e2d86080fff (diff) | |
Finished Music player, added new songs
Music player buttons work
Music player has bouncing green bars
Music player shows actual title of song
New songs that can be played
Diffstat (limited to 'viewer.lua')
| -rw-r--r-- | viewer.lua | 50 |
1 files changed, 49 insertions, 1 deletions
@@ -13,18 +13,66 @@ function drawMusic() drawControls(8+38,win[9].h-34-8) drawDownBox(10+38+38+38,win[9].h-34+5,118,5,2) drawUpBox(mplay.volx,mplay.voly,10,25,2) + love.graphics.setColor(0,256,0) + love.graphics.setFont(pixeloperators) + love.graphics.print(mplay.title, 10,82) + if mplay.p == true then + for i=1,10 do + if mplay.bar[i] == nil then + mplay.bar[i] = {} + mplay.bar[i].h = 20 + mplay.bar[i].ht = 20 + else + if mplay.bar[i].h > mplay.bar[i].ht then + mplay.bar[i].h = mplay.bar[i].h - 1 + elseif mplay.bar[i].h < mplay.bar[i].ht then + mplay.bar[i].h = mplay.bar[i].h + 1 + elseif mplay.bar[i].h == mplay.bar[i].ht then + mplay.bar[i].ht = math.random(0,40) + end + love.graphics.rectangle("fill",(23*i)-13,33,21,mplay.bar[i].h) + end + end + end + love.graphics.setFont(pressstart) end function drawControls(x,y) love.graphics.setColor(256,256,256) drawUpBox(x,y,32,32,2) - love.graphics.draw(but.play, x, y) + love.graphics.draw(but.but, x, y) drawUpBox(x+38,y,32,32,2) love.graphics.draw(but.stop, x+38, y) drawUpBox(x-38,y,32,32,2) love.graphics.draw(but.back, x-38, y) end function updateMusic() + if mouseClick(win[9].x+8+38,win[9].y+win[9].h-34-8,32,32) == true and mplay.m ~= 0 and mplay.pr == false then + if but.but == but.pause then + mplay.m:pause() + mplay.p = false + but.but = but.play + win[9].update = true + elseif but.but == but.play then + mplay.p = true + but.but = but.pause + win[9].update = true + end + mplay.pr = true + elseif mouseClick(win[9].x+8+38-38,win[9].y+win[9].h-34-8,32,32) == true and mplay.m ~= 0 and mplay.pr == false then + mplay.m:rewind() + mplay.p = true + but.but = but.pause + win[9].update = true + mplay.pr = true + elseif mouseClick(win[9].x+8+38+38,win[9].y+win[9].h-34-8,32,32) == true and mplay.m ~= 0 and mplay.pr == false then + mplay.m:stop() + mplay.p = false + but.but = but.play + win[9].update = true + mplay.pr = true + end if mplay.p == true and mplay.m ~= 0 then + win[9].update = true mplay.m:play() end if win[9].ex == true and mplay.m ~= 0 then |
