CAS Community   >   Resources   >  

Animation, blendLevel and flushEvents

A LiveCode stack demonstrating important facets of programming

Richmond Mathewson

Created by Richmond Mathewson
last edited Apr 14 2018 by Richmond Mathewson

To run this code you will need LiveCode Community:

I recommend version 8.1.9.

Here is a “bog basic” LiveCode stack using pre-made images to simulate a boy running across a desert scene.

ALL the code is contained in the cardScript.

This contains a pair of repeat loops to “flash up” images to simulate motion.

This uses blendLevel to effect a change from daylight to nighttime.

This uses flushEvents to ensure that, if the end-user keeps pressing an arrow key, the repeat loops do NOT keep “firing” until the first repeat loops have finished.

ALL action is controlled using the Right and Left arrow keys on the keyboard.

Level: Intermediate

Duration: As long as you, your teacher or your best friend thinks is necessary

Teaches: repeat loops, blendLevel and flushEvents

Credit where credit is due: imagery is from here:

Downloaded 207 times.


This resource has attached files: to access these files, please tick the box below to assent to the license terms
License: The resources on CAS website are under Creative Commons Attribution-Share Alike 3.0 licence unless otherwise specified by the resource creators.

You must confirm that you have read and agree the licence's ToS before you can download the attachments of this resource.

I have read the licence agreement of this resource and agree to abide by its terms and conditions.

Feedback and Comments

Available when logged in (join via the front page, for free):
  • View 0 comments on this resource.
  • View resource history, links to related resources.
  • Leave feedback for the author(s), or help by editing the resource.