forked from LeenkxTeam/Leenkx_Examples
update
This commit is contained in:
2
tilesheet_walkcycle/README.md
Normal file
2
tilesheet_walkcycle/README.md
Normal file
@ -0,0 +1,2 @@
|
||||
The level is built using [SpryTile blender add-on](https://chemikhazi.itch.io/sprytile).
|
||||
https://github.com/leenkx3d/leenkx/wiki/Tilesheets
|
||||
22
tilesheet_walkcycle/Sources/lnx/AnimControl.hx
Normal file
22
tilesheet_walkcycle/Sources/lnx/AnimControl.hx
Normal file
@ -0,0 +1,22 @@
|
||||
package lnx;
|
||||
|
||||
class AnimControl extends iron.Trait {
|
||||
|
||||
var tilesheet:iron.object.Tilesheet;
|
||||
|
||||
public function new() {
|
||||
super();
|
||||
|
||||
notifyOnInit(function() {
|
||||
tilesheet = cast(object, iron.object.MeshObject).tilesheet;
|
||||
iron.system.Tween.timer(Std.random(8), playAnim);
|
||||
});
|
||||
}
|
||||
|
||||
function playAnim() {
|
||||
tilesheet.play("rest", function() {
|
||||
tilesheet.play("idle");
|
||||
iron.system.Tween.timer(Std.random(8), playAnim);
|
||||
});
|
||||
}
|
||||
}
|
||||
BIN
tilesheet_walkcycle/sprite_tux.png
Normal file
BIN
tilesheet_walkcycle/sprite_tux.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
BIN
tilesheet_walkcycle/tilesheet_walkcycle.blend
Normal file
BIN
tilesheet_walkcycle/tilesheet_walkcycle.blend
Normal file
Binary file not shown.
Reference in New Issue
Block a user