2023-08-27 12:32:38 +00:00
|
|
|
div=0.2
|
|
|
|
curtime=0.
|
|
|
|
lastdiv=0
|
|
|
|
calib=false
|
|
|
|
|
|
|
|
|
|
|
|
function love.load()
|
|
|
|
tts=require "love2talk"
|
|
|
|
object=require "classic"
|
|
|
|
local tick=require "tick"
|
|
|
|
tick.rate=.001
|
|
|
|
require "soundgroups"
|
|
|
|
require "ticker"
|
|
|
|
require "track"
|
|
|
|
require "utils"
|
|
|
|
|
|
|
|
require "player"
|
|
|
|
require "game"
|
|
|
|
require "enemy"
|
|
|
|
require "enemies/basic"
|
2023-08-27 23:00:22 +00:00
|
|
|
love.audio.setDistanceModel("exponent")
|
2023-08-27 12:32:38 +00:00
|
|
|
aud=group("audio")
|
2023-08-27 23:00:22 +00:00
|
|
|
aud.meh:setRelative(true)
|
2023-08-27 12:32:38 +00:00
|
|
|
c=require "tracks/gourmet"
|
|
|
|
love.timer.sleep(1)
|
|
|
|
game.loadTrack(c)
|
|
|
|
game.init()
|
|
|
|
game.currentTrack.music:play()
|
|
|
|
end -- load
|
|
|
|
|
|
|
|
|
|
|
|
function love.update(dt)
|
|
|
|
game.update()
|
|
|
|
end -- update
|
|
|
|
|
|
|
|
function love.keypressed(key)
|
|
|
|
if key=="right" then
|
|
|
|
player.direction=1
|
|
|
|
elseif key=="left" then
|
|
|
|
player.direction=-1
|
|
|
|
elseif key=="c" then
|
|
|
|
tts.say(player.x)
|
|
|
|
elseif key=="d" then
|
2023-08-27 23:00:22 +00:00
|
|
|
tts.say(game.meh.y)
|
2023-08-27 12:32:38 +00:00
|
|
|
end
|
|
|
|
end -- keyPressed
|
|
|
|
|
|
|
|
function love.keyreleased(key)
|
|
|
|
if key=="left" or key=="right" then
|
|
|
|
player.direction=0
|
|
|
|
end
|
|
|
|
end -- keyReleased
|