-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added hashes caching and fixed the camera following delay
- Loading branch information
1 parent
56f58c0
commit 92e99e4
Showing
14 changed files
with
429 additions
and
241 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--[[ | ||
main.script | ||
github.com/astrochili/defold-kinematic-walker | ||
Copyright (c) 2023 Roman Silin | ||
MIT license. See LICENSE for details. | ||
--]] | ||
|
||
local hashes = require 'walker.hashes' | ||
|
||
-- | ||
-- Lifecycle | ||
|
||
function init(self) | ||
self.urls = { | ||
go = msg.url('.'), | ||
gui = msg.url('gui'), | ||
operator = msg.url('/player/operator/operator') | ||
} | ||
|
||
self.is_gui_enabled = true | ||
msg.post(self.urls.go, hashes.acquire_input_focus) | ||
end | ||
|
||
function on_input(self, action_id, action) | ||
if action_id == hash 'key_esc' and action.released then | ||
msg.post(self.urls.operator, hashes.internal_control, { is_enabled = false }) | ||
elseif action_id == hash 'touch' and action.pressed then | ||
msg.post(self.urls.operator, hashes.internal_control, { is_enabled = true }) | ||
elseif action_id == hash 'key_h' and action.released then | ||
self.is_gui_enabled = not self.is_gui_enabled | ||
msg.post(self.urls.gui, self.is_gui_enabled and hash 'enable' or hash 'disable') | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.