Skip to content

Ulydev/lovemi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lovemi

Integrate the konami code and customised patterns into your game!

This library lets you call functions using customised patterns, so that you can add secret cheats!

Usage

local lovemi = require "lovemi"

function love.load()
  local pattern = lovemi.add(attributes)
end

function love.update(dt)
  lovemi.update(dt)
end

function love.keypressed(key, isrepeat)
  lovemi.keypressed(key, isrepeat)
end

Attributes

The majority of them are optional. You can set these attributes when creating a new pattern.

pattern = lovemi.add({

  pattern = {"a", "b", "c", "d"},

  onStart = function()
    --pattern executed
  end
  
})

Attributes

pattern --table containing keys (required)

duration --if not set, onEnd will never be called

Callbacks

onStart --pattern executed
onEnd --pattern execution ended

onSuccess --right key
onFail --wrong key, pattern resets

Methods

pattern:getActive() --is pattern being executed?

pattern:getLength() --returns pattern length
pattern:getPosition() --returns current pattern position (useful for combo systems)

pattern:remove() --removes the pattern from lovemi

lovemi.clear() --removes every pattern from lovemi

About

Integrate the konami code into your game!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages