examplelevel.lua
u_execDependencyScript("ohvrvanilla", "base", "vittorio romeo", "utils.lua")
u_execDependencyScript("ohvrvanilla", "base", "vittorio romeo", "common.lua")
u_execDependencyScript("ohvrvanilla", "base", "vittorio romeo", "commonpatterns.lua")
u_execDependencyScript("library_pseudogame", "pseudogame", "Baum", "main.lua")
PseudoGame.hide_default_game()
game = PseudoGame.game.Game:new()
game:overwrite()
function onInput(frametime, movement, focus, swap)
game:update(frametime, movement, focus, swap)
game:draw_to_screen()
end
function onDeath()
game.death_effect:death()
end
function onPreDeath()
game.death_effect:invincible_death()
end
function onRenderStage(render_stage, frametime)
game.death_effect:ensure_tickrate(render_stage, frametime, function(new_frametime)
onInput(new_frametime, 0, false, false)
end)
end
function addPattern(mKey)
if mKey == 0 then
pAltBarrage(u_rndInt(3, 5), 2)
elseif mKey == 1 then
pMirrorSpiral(u_rndInt(2, 5), getHalfSides() - 3)
elseif mKey == 2 then
pBarrageSpiral(u_rndInt(0, 3), 1, 1)
elseif mKey == 3 then
pInverseBarrage(0)
elseif mKey == 4 then
pTunnel(u_rndInt(1, 3))
elseif mKey == 5 then
pSpiral(l_getSides() * u_rndInt(1, 2), 0)
end
end
keys = { 0, 0, 1, 1, 2, 2, 3, 3, 4, 5, 5 }
shuffle(keys)
index = 0
achievementUnlocked = false
function onInit()
l_setSpeedMult(1.55)
l_setSpeedInc(0.125)
l_setSpeedMax(3.5)
l_setRotationSpeed(0.07)
l_setRotationSpeedMax(0.75)
l_setRotationSpeedInc(0.04)
l_setDelayMult(1.0)
l_setDelayInc(-0.01)
l_setFastSpin(0.0)
l_setSides(6)
l_setSidesMin(5)
l_setSidesMax(6)
l_setIncTime(15)
l_setPulseMin(75)
l_setPulseMax(91)
l_setPulseSpeed(1.2)
l_setPulseSpeedR(1)
l_setPulseDelayMax(23.9)
l_setBeatPulseMax(17)
l_setBeatPulseDelayMax(24.8)
enableSwapIfDMGreaterThan(2.5)
disableIncIfDMGreaterThan(3)
end
function onLoad()
e_messageAdd("welcome to the first PseudoGame example level", 150)
e_messageAdd("This is just a copy of the workshop example\nbut completely rendered using custom walls!", 200)
e_messageAdd("Look at the next examples for seeing what can be done with this.", 200)
end
function onStep()
addPattern(keys[index])
index = index + 1
if index - 1 == #keys then
index = 1
shuffle(keys)
end
end
function onIncrement()
end
function onPreUnload()
game:restore()
end
function onUpdate(mFrameTime)
end