aboutsummaryrefslogtreecommitdiff
path: root/loading.lua
blob: d88f4c9877565b023bf80ff44c3f3f5cd3e7fc3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function drawLoading()
  love.graphics.setBackgroundColor(0, 0, 0)
  love.graphics.setLineWidth(4)
  love.graphics.setColor(255, 255, 255)
  love.graphics.rectangle("line", sys.w/2-125, sys.h/2-15, 250, 30)
  love.graphics.print("Don't Get a Virus", sys.w/2-102, sys.h/2-30)
  love.graphics.setColor(0,0,120)
  love.graphics.rectangle("fill", sys.w/2-125+5, sys.h/2-10, loading, 20)
  if loading < 240 then
    loading = loading + math.random(0.1,2)
  elseif loading >= 240 then
    loading = 240
    fade = 1
  end
  love.graphics.setColor(0, 0, 0, fadeOpacity)
  love.graphics.rectangle("fill", 0, 0, sys.w, sys.h)
  if fadeOpacity == 255 and loading == 240 then
    scene = 1
    fade = 0
    sound.boot:play()
  end
end