Skip to content

Commit

Permalink
Add animation example
Browse files Browse the repository at this point in the history
  • Loading branch information
polldo committed Mar 29, 2022
1 parent bb31f4a commit a6ec93c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions examples/micropython/animation/animation.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import dolp

arduinoImg = bytearray(b'\x0F\x08\x3c\x66\xc2\x92\xd2\x46\x6c\x38\x6c\x46\xd2\x92\xc2\x66\x3c')
maskImg = bytearray(b'\x08\x08\xf7\xbe\xff\xf7\x5f\xfe\xf7\xbd')
explosion1 = bytearray(b'\x10\x10\x00\x00\x00\x00\x90\x40\x40\x20\x40\x40\x84\x00\x10\x00\x00\x00\x00\x00\x04\x00\x00\x05\x01\x02\x01\x21\x00\x04\x00\x00\x00\x00')
explosion2 = bytearray(b'\x10\x10\x00\x00\x00\x00\x88\x60\x24\x10\x20\x60\x80\x00\x12\x00\x00\x00\x00\x40\x02\x00\x00\x03\x02\x24\x02\x03\x00\x00\x00\x44\x00\x00')
explosion3 = bytearray(b'\x10\x10\x00\x00\x60\x44\x84\x40\xa6\x14\x10\x20\x42\x82\x00\x08\x40\x00\x00\x08\x00\x08\x01\x22\x04\x4b\x48\x05\x02\x01\x00\x60\x06\x00')
explosion4 = bytearray(b'\x10\x10\x00\x00\x00\x18\xa8\xc8\xf0\xf0\xf0\xe0\xe8\xb8\x08\x00\x00\x00\x00\x00\x00\x30\x39\x17\x17\x1f\x0f\x17\x13\x21\x78\x20\x00\x00')
explosion = dolp.Animation([explosion1, explosion2, explosion3, explosion4], [150, 200, 200, 300])

dolp.begin()

ani = dolp.Animation([maskImg, arduinoImg], [200,200])
o = dolp.new_entity()
o.set_animation(ani)
o.set_animation(explosion)
o.configure(30,30,8,8)

while True:
dolp.loop()

0 comments on commit a6ec93c

Please sign in to comment.