aboutsummaryrefslogtreecommitdiff
path: root/loading.lua
blob: db36706963f62c909d0bf52b33db243d6ccb716e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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 + 5
    if loading > loadingId*10 and loaded == false then
      loadAssets(loadingId)
      loadingId = loadingId + 1
    end
  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
function drawBSOD()
  love.audio.stop()
  love.graphics.setBackgroundColor(0,0,120)
  love.graphics.setColor(256,256,256)
  love.graphics.draw(bsod.pic, sys.w/2, sys.h/2, 0, 1, 1, 320, 200)
  if love.keyboard.isDown("return") == true then
    loadRe()
  end
end
function drawPause()
  love.graphics.setBackgroundColor(0,0,120)
  love.graphics.setColor(256,256,256)
  love.graphics.draw(pause.pic, sys.w/2, sys.h/2, 0, 1, 1, 320, 200)
  if love.keyboard.isDown("return") == true then
    love.event.quit()
  end
  if love.keyboard.isDown("escape") == true and pause.esc == false then
    love.audio.resume()
    pause.esc = true
    pause.p = false
    love.graphics.setBackgroundColor(0, 128, 128)
  end
end