Our community gets into harness, we add chained behaviors, and LiveCode Community is set free
It's been a couple of months since our last edition of revUp. My apologies! We're back on track now, and you can expect your regular twice monthly dose of revUp to resume. We've been extremely busy in the interim, not least on producing LiveCode 6.1.
There are a number of exciting things about 6.1. Perhaps the most interesting and positive aspect of this release is that you, the community, have got involved. 7 features and 2 fixes incorporated in 6.1 were provided by dedicated community members working on the open source engine. Not perhaps earthshaking features in themselves, but handy if you need them, and a great omen for times to come. Just to pick out a couple, Monte Goulding among other items contributed Locking Group Updates, a featuer which speeds up custom controls composed of many objects, as well as the "effective visible", allowing you to determine which objects are genuinely visible on-screen at any given time. Jan Schenkel gave us "Getting the Page Ranges of a Field" as well as some additional statistical functions, and Mark Wieder fixed a bug with "is a color". We're very grateful to all of you!
If you want to get involved, there is a comprehensive guide here, and don't forget to drop by the forums, here.
Perhaps the biggest new feature in 6.1 is chained behaviors. I'm going to let Ben Beaumont explain to you why you should care about this in your apps.
We introduced behaviors to allow objects to share code. Take for example a platform game where you collect coins. Each of these coins requires the same script in order to function. You can define a 'behavior script' and all instances of the coin can use it. Making a change to the behavior script affects every coin.
Behaviors help developers to put more structure into their code and avoid repetition. Repetition is bad because if you need to change some code that is repeated throughout your project, you have to apply that change in many places. Imagine having 100 coins all with the same script. Changing the script means going through and updating the script for all 100 coins!
Chained behaviours takes this code structuring one step further. A behaviour script can now have a behavior of its own which in turn can have a behavior of its own and so on. Lets return to our game example. This time imagine your game involves collecting coins, stars and fruit while trying not to collect poison.
Each of these objects has lots in common:
- When a user interacts with the object it should be removed from the screen
- When a user collects the object their score should change
- When a user collects the object a sound should play
However, these objects also contain differences:
- Each object may move / animate in a different way
- Each object may have a different score associated to it, adding or subtracting
- Each object may have a different sound associated with it
Using chained behaviours you could structure your app as follows which would ensure that no code is repeated in more than one place.
LiveCode Community Activation Removed
In LiveCode 6.1 Community Edition, you no longer need to activate the program after downloading and installing it. This makes it more accessible, faster to install, and removes a barrier to users adopting it. You are still offered the opportunity to create an account if you wish to, but it is not required. Students can easily install in a school environment, making getting LiveCode into more and more of the educational establishment even easier.
You can get the full release notes for 6.1 here, with all the new features and fixes that have been added.
Heather Laine is Customer Services Manager for RunRev Ltd
Ben Beaumont is Product Manager for RunRev Ltd.