improvement(cbs): handle better when the character haven't moved
This commit is contained in:
parent
daac217c6c
commit
d097552298
1 changed files with 13 additions and 7 deletions
|
@ -252,9 +252,14 @@ function Hero:receiveSignal(action_type, id)
|
|||
self.world.cursor:unset( )
|
||||
self:useSkill(id, self.world.cursor.x, self.world.cursor.y)
|
||||
elseif (action_type == "cursorMove") then
|
||||
if (self.x ~= self.world.cursor.x) or (self.y ~= self.world.cursor.y) then
|
||||
self:changeAnimation("walk", true)
|
||||
self:goTo(self.world.cursor.x, self.world.cursor.y, 'cursorMove', 1)
|
||||
self.assets.sfx["woosh"]:play()
|
||||
else
|
||||
self.world:resetActiveGrid()
|
||||
self.scene.menu:set( self )
|
||||
end
|
||||
self.world.cursor:unset( )
|
||||
else
|
||||
self:switchActiveBattler( )
|
||||
|
@ -263,10 +268,11 @@ end
|
|||
|
||||
function Hero:receiveBackSignal()
|
||||
self.world.cursor:set(self.x, self.y, "cursorMove")
|
||||
self:goTo(self.startx, self.starty, 'backMove', 1)
|
||||
if (self.x ~= self.startx) or (self.y ~= self.starty) then
|
||||
self.world.cursor:set(self.x, self.y, "cursorMove")
|
||||
self.assets.sfx["woosh"]:play()
|
||||
|
||||
self:changeAnimation("walk")
|
||||
end
|
||||
end
|
||||
|
||||
function Hero:timerResponse(timer)
|
||||
|
|
Loading…
Reference in a new issue