Merge pull request #40 from tacigar/fix-pause-infotext

[FIX] Fix on_punch callback
This commit is contained in:
tacigar 2016-09-18 08:46:32 +09:00 committed by GitHub
commit 008ead10f4
2 changed files with 5 additions and 2 deletions

View File

@ -361,15 +361,17 @@ function maidroid.register_maidroid(product_name, def)
self.pause = false
if self.core_name ~= "" then
local core = maidroid.registered_cores[self.core_name]
core.on_pause(self)
core.on_resume(self)
end
else
self.pause = true
if self.core_name ~= "" then
local core = maidroid.registered_cores[self.core_name]
core.on_resume(self)
core.on_pause(self)
end
end
update_infotext(self)
end
-- register a definition of a new maidroid.

View File

@ -6,6 +6,7 @@
local state = {IDLE = 0, ACCOMPANY = 1}
local function on_start(self)
print("KOKO")
self.state = state.IDLE
self.object:setacceleration{x = 0, y = -10, z = 0}
self.object:setvelocity{x = 0, y = 0, z = 0}