Last active
April 9, 2017 19:47
-
-
Save blenderdeluxe/bb806d285e09756b3dcce5945dce15a6 to your computer and use it in GitHub Desktop.
2D Sprites BGE
This file contains hidden or 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
import bge | |
cont = bge.logic.getCurrentController() | |
own = cont.owner | |
if own['currentFrame'] <= own['maxFrame']: | |
own.replaceMesh(own['meshName'] + str(own['currentFrame']), 1, 0) | |
own['name'] = own['meshName'] + str(own['currentFrame']) | |
own['currentFrame'] += 1 | |
if own['currentFrame'] > own['maxFrame']: | |
own['currentFrame'] = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment