function loadAssets() icons = {} icons[32] = { chat = love.graphics.newImage("assets/icon_32_chat.png"), internet = love.graphics.newImage("assets/icon_32_internet.png"), files = love.graphics.newImage("assets/icon_32_files.png"), file = love.graphics.newImage("assets/icon_32_file.png"), help = love.graphics.newImage("assets/icon_32_help.png"), antivirus = love.graphics.newImage("assets/icon_32_antivirus.png"), settings = love.graphics.newImage("assets/icon_32_settings.png") } icons[16] = { chat = love.graphics.newImage("assets/icon_16_chat.png"), internet = love.graphics.newImage("assets/icon_16_internet.png"), files = love.graphics.newImage("assets/icon_16_files.png"), help = love.graphics.newImage("assets/icon_16_help.png"), settings = love.graphics.newImage("assets/icon_16_settings.png"), antivirus = love.graphics.newImage("assets/icon_16_antivirus.png") } desktop = {} desktop.bg = { hills = love.graphics.newImage("assets/bg_hills.jpg"), coast = love.graphics.newImage("assets/bg_coast.jpg"), cloud = love.graphics.newImage("assets/bg_cloud.jpg"), flower = love.graphics.newImage("assets/bg_flower.jpg"), city = love.graphics.newImage("assets/bg_city.jpg") } st = {} st[1] = {} st[1].title = "Default" st[1].hl = false st[2] = {} st[2].title = "Hills" st[2].hl = false st[3] = {} st[3].title = "Clouds" st[3].hl = false st[4] = {} st[4].title = "City" st[4].hl = false st[5] = {} st[5].title = "Flower" st[5].hl = false st[6] = {} st[6].title = "Coast" st[6].hl = false music = { battle1 = love.audio.newSource("assets/music/Thrills And Spills.ogg"), battleNSA = love.audio.newSource("assets/music/Less Than Three.ogg"), battleUndertale = love.audio.newSource("assets/music/Alphys Takes Action.ogg"), battle2 = love.audio.newSource("assets/music/Skyscraper Party.ogg"), sad1 = love.audio.newSource("assets/music/Startup Ambiance.ogg"), battle3 = love.audio.newSource("assets/music/Without Silence.ogg"), fox = love.audio.newSource("assets/music/FOX.ogg"), tension1 = love.audio.newSource("assets/music/Storm Chasers.ogg") } sound = { boot = love.audio.newSource("assets/boot.ogg") } sound.boot:setLooping(false) music.battle1:setLooping(true) music.battle2:setLooping(true) music.battleNSA:setLooping(true) music.battleUndertale:setLooping(true) window = { bar = love.graphics.newImage("assets/win_bar.png"), barGrey = love.graphics.newImage("assets/win_bar_grey.png") } settings = { comp = love.graphics.newImage("assets/computer.png") } chat = { online = love.graphics.newImage("assets/chat_status_online.png"), offline = love.graphics.newImage("assets/chat_status_offline.png"), profile = love.graphics.newImage("assets/chat_profile.png") } internet = { back = love.graphics.newImage("assets/internet_back.png"), freedownloads1 = love.graphics.newImage("assets/internet_freedownloads.png"), freedownloads2 = love.graphics.newImage("assets/internet_freedownloads2.png"), welcome = love.graphics.newImage("assets/internet_welcome.png"), error = love.graphics.newImage("assets/internet_error.png") } antivirus = { gun = love.graphics.newImage("assets/antivirus_turret_gun.png"), body = love.graphics.newImage("assets/antivirus_turret_body.png"), left = love.graphics.newImage("assets/antivirus_turret_leftwing.png"), right = love.graphics.newImage("assets/antivirus_turret_rightwing.png"), open = love.audio.newSource("assets/antivirus_open.ogg"), opengun = love.audio.newSource("assets/antivirus_open_gun.ogg"), laser = love.audio.newSource("assets/antivirus_laser.ogg"), bullet = love.graphics.newImage("assets/bullet_blue.png"), hit = love.audio.newSource("assets/antivirus_hit.ogg"), charge = love.graphics.newImage("assets/antivirus_charge.png") } notification = { bubble = love.graphics.newImage("assets/notification.png"), sound1 = love.audio.newSource("assets/notification1.ogg"), sound2 = love.audio.newSource("assets/notification2.ogg") } v1 = { intro = love.audio.newSource("assets/virus1intro.ogg"), shine = love.audio.newSource("assets/shine.ogg"), scorch = love.graphics.newImage("assets/virus_scorch.png"), scorchMask = love.graphics.newImage("assets/virus_scorch_mask.png"), shineplay = false, corner = love.graphics.newImage("assets/chat_bubble_corner.png"), cornerSpike = love.graphics.newImage("assets/chat_bubble_cornerspike.png"), turret1 = love.graphics.newImage("assets/virus1_turret.png"), turret2 = love.graphics.newImage("assets/virus1_turret2.png"), turret2Held = love.graphics.newImage("assets/virus1_turret2_held.png"), shipFront = love.graphics.newImage("assets/virus1_ship_front.png"), shipBack = love.graphics.newImage("assets/virus1_ship_back.png") } v1.msgs = {} v1.c = {} v1.c.chat = {} v1.c.chat.next = false v1.c.chat.msgs = 1 v1.c.chat.msg = "" v1.c.chat.sp = 0.5 v1.c.chat.char = 0 v1.turret = {} v1.turret[1] = {r=math.rad(30),x=0,y=0,rt=math.rad(30),t=0,tl=1} v1.turret[2] = {r=math.rad(15),x=0,y=0,rt=math.rad(15),t=0,tl=2} v1.turret[3] = {r=math.rad(-15),x=0,y=0,rt=math.rad(-15),t=0,tl=3} v1.turret[4] = {r=math.rad(-30),x=0,y=0,rt=math.rad(-30),t=0,tl=4} v1.laserSound = love.audio.newSource("assets/virus1_laser.ogg") v1.laserSound:setVolume(0.6) v1.explosionSound = love.audio.newSource("assets/explosion.ogg") v1.bullets = {} v1.bullet = love.graphics.newImage("assets/bullet_green.png") v1.bulletRed = love.graphics.newImage("assets/bullet_red.png") v1.bulletYellow = love.graphics.newImage("assets/bullet_yellow.png") v1.c.idle = {} v1.c.idle.fs = {} v1.c.idle.pic = love.graphics.newImage("assets/virus1_idle_noeye.png") v1.c.pupil = love.graphics.newImage("assets/virus1_pupil.png") v1.c.eye = love.graphics.newImage("assets/eye_thing.png") v1.c.idle.f = 1 loadAnimation(v1.c.idle.pic, v1.c.idle.fs, 98, 10, 200, 200) v1.c.monitorspin = {} v1.c.monitorspin.fs = {} v1.c.monitorspin.pic = love.graphics.newImage("assets/virus1_monitorspin.png") v1.c.monitorspin.f = 1 v1.c.monitorspin.x = 330 v1.c.monitorspin.y = -200 v1.c.monitorspin.sp = 0.4 loadAnimation(v1.c.monitorspin.pic, v1.c.monitorspin.fs, 59, 6, 200, 200) v1.c.slime = {} v1.c.slime.fs = {} v1.c.slime.pic = love.graphics.newImage("assets/virus1_slime.png") v1.c.slime.f = 1 v1.c.slime.x = 330 v1.c.slime.y = 350 loadAnimation(v1.c.slime.pic, v1.c.slime.fs, 26, 3, 50, 50) v1.c.shine = {} v1.c.shine.f1 = love.graphics.newImage("assets/shine1.png") v1.c.shine.f2 = love.graphics.newImage("assets/shine2.png") v1.c.shine.r1 = 0 v1.c.shine.r2 = 0 v1.c.shine.s1 = 0 v1.c.shine.s2 = 0 v1.c.shine.s = -25 v1.c.shine.sm1 = true v1.c.shine.sm2 = true v1.c.shine.ct = 0 v1.c.shine.opa = 255 v1.c.x = 0 v1.c.y = 0 v1.c.s = 1 v1.c.r = 0 v1.c.xd = 0 v1.c.yd = 0 v1.c.spx = 0 v1.c.spy = 0 v1.c.sp = 1 v1.c.angle = 0 v1.c.load = false v1.c.eyex = 0 v1.c.eyey = 0 v1.c.eyetx = 0 v1.c.eyety = 0 v1.c.chat.time = 0 v1.c.health = 100 expl = {} expl.frames = {} expl.pic = love.graphics.newImage("assets/explosion.png") loadAnimation(expl.pic, expl.frames, 89, 9, 320, 240) expl.frame = 1 expl.deb = {} expl.deb[1] = {} expl.deb[2] = {} expl.deb[3] = {} expl.deb[1].pic = love.graphics.newImage("assets/debris1.png") expl.deb[2].pic = love.graphics.newImage("assets/debris2.png") expl.deb[3].pic = love.graphics.newImage("assets/debris3.png") end function loadAnimation(pic, quad, frames, limit, w, h) local frame = 1 for i=1,limit do local y = i for i=1,10 do if frame <= frames then quad[frame] = love.graphics.newQuad(i*w-w, y*h-h, w, h, pic:getDimensions()) frame = frame + 1 end end end end function playAnimation(ani, loop, x, y, r, s, xo, yo, sp) love.graphics.draw(ani.pic, ani.fs[math.floor(ani.f)], x, y, r, s, s, xo, yo) speed = (60/love.timer.getFPS())*sp if loop == true and #ani.fs <= ani.f then ani.f = 1 elseif loop == false and ani.f >= #ani.fs then else ani.f = ani.f + speed end end