Showing posts with label make. Show all posts
Showing posts with label make. Show all posts

Monday, November 10, 2014

Memory Game Built Using LiveCode



How good is your memory?

Here is a little LiveCode example project based on the old memory game that requires that you repeat a specific pattern. The game begins by clicking the start button and will continue incrementing up until you make a mistake. How high can you go? I pretty much bomb out at 7 or 8 steps.

This LiveCode example works both as a desktop application or as a iOS mobile application. The scripts/code for this project live in the “Start” button, the Card script, and the colorful game buttons: one, two, three, and four. The card script contains the CheckProgress command which determines whether the player is correct or incorrect. It also contains, essentially, a matching series of code that the desktop version of the Start button uses, but incorporates the iOS specific commands for mobile. If you compare the iOS code in the Card script, and the desktop app code within the Start button, you will notice some similarities.

The musical notes were created in Apple’s Garageband and saved as mp3 and wav files. The mp3 files are referenced from within the iOS package (they are included as individual files in the apps sandbox) in order to play and the wav files are imbedded into the application for playback in the desktop version. (MP3 files were converted to wav files using the OSX terminial application afconvert.) You will notice differences between the desktop code and the iOS mobile code.

Finally, to address different screen resolutions on both an iPad and an iPhone, it uses the “fullScreenMode function within LiveCode, a relatively new addition to the development tool, to make adjusting screen resolutions automatic. The application will automatically resize itself to fit within the devices screen resolution. It is one line of code within a preOpenStack call: set the fullScreenMode of this stack to “ExactFit.” That’s it.

The Memory Game project file is available here: Download .

Here is a short YouTube video explaining more about the process of creating the memory game example with LiveCode and a peak at the code:



Monday, November 3, 2014

Puzzle Pullooza App With LiveCode

This little puzzle example started out as a little Sunday evening mental exercise. How to create a simple puzzle activity that would work well as a desktop application and as a mobile application. As a result of that effort, I think this little project does a great job of showcasing some of the great features of creating mobile and desktop apps with LiveCode. There is actually a great little book by Colin Holgate, LiveCode Mobile Development, https://www.packtpub.com/application-development/livecode-mobile-development-beginners-guide, that I would recommend that gives another puzzle app example and much more. It’s an easy read and great way to introduce yourself to LiveCode.



Now, back to Puzzle Pullooza. The app is pretty basic in appearance and in its code. To begin, the majority of the code is in the stack script. Here is a Google Docs link where I have shared the code: Puzzle Pullooza Code . You can see from the Google Doc, the code is pretty easy to understand. I have attempted to comment each section of the code to explain what it does. But, you may be able to decipher what the code does without even understanding much programming.

In order to begin poking around the app and discovering how it works, I would recommend you download the free LiveCode Community version of the software, http://livecode.com/download/. This is the full version of LiveCode, but the OpenSource version. You can create apps, compile apps, and do everything you can with the commercial version, you just can’t sell what you create in the Apple App Store.

Once you have downloaded and installed the Community Version of LiveCode, you can download the Puzzle Pullooza app here: Download Puzzle Pullooza

Open it up and have a loop around!

The Puzzle Pullooza app showcased many of the nice feature built into the development tool. First is the ease at which code is written in the development tool, as I shared earlier. The coding features mirror many other development tools, but the plain language, and effort to create with LiveCode far outshine other development tools, in my humble opinion.

As with most applications under development, Puzzle Pullooza suffered from “feature creep.” It was very easy to take components others had shared in their projects and incorporate them into my app.

For example, I added a timer another LiveCode developers had shared online. There’s nothing like adding a stopwatch/timer to increase your level of urgency when solving a puzzle. There is also a very active LiveCode developer list, http://livecode.com/community/, and great Developer resources here: http://livecode.com/developers/.

I thought it would be neat to have folks share out on Twitter when they completed a puzzle. This component demonstrates how easy it is to build a custom web browser directly in your app. In this case, the web browser’s only purpose is to provide the twitter interface for posting to Twitter.

I’d encourage you to take a look at LiveCode. It is a great tool for students and those learning to code. The free Community Edition makes it a “no (cost) brainer.”