McRogueFace/tests/unit/test_simple_callback.py

14 lines
341 B
Python

#!/usr/bin/env python3
"""Very simple callback test"""
import mcrfpy
import sys
def cb(a, t):
print("CB")
mcrfpy.createScene("test")
mcrfpy.setScene("test")
e = mcrfpy.Entity((0, 0), texture=None, sprite_index=0)
a = mcrfpy.Animation("x", 1.0, 0.1, "linear", callback=cb)
a.start(e)
mcrfpy.setTimer("exit", lambda r: sys.exit(0), 200)