Initial flame_lua_runtime package
This commit is contained in:
37
example/assets/games/ludo/scripts/animation.lua
Normal file
37
example/assets/games/ludo/scripts/animation.lua
Normal file
@@ -0,0 +1,37 @@
|
||||
---@type RuntimeCommands
|
||||
local commands = runtime.import("runtime_commands")
|
||||
|
||||
local animation = {}
|
||||
|
||||
function animation.move_piece(piece_id, path)
|
||||
return commands.move_path(piece_id, path, {
|
||||
duration = 0.7,
|
||||
onComplete = "piece_move_done"
|
||||
})
|
||||
end
|
||||
|
||||
function animation.toast(text)
|
||||
return commands.toast(text)
|
||||
end
|
||||
|
||||
function animation.play_sound(name)
|
||||
return commands.play_sound(name)
|
||||
end
|
||||
|
||||
function animation.play_bgm(name, channel)
|
||||
return commands.play_bgm(name, { channel = channel or "bgm" })
|
||||
end
|
||||
|
||||
function animation.pause_bgm(channel)
|
||||
return commands.pause_bgm(channel)
|
||||
end
|
||||
|
||||
function animation.resume_bgm(channel)
|
||||
return commands.resume_bgm(channel)
|
||||
end
|
||||
|
||||
function animation.stop_bgm(channel)
|
||||
return commands.stop_bgm(channel)
|
||||
end
|
||||
|
||||
return animation
|
||||
Reference in New Issue
Block a user