Week 3: Coding in Lua

After last week’s terrible experience, I had some time to rest over the 4th of July weekend. I was not looking forward to coming into the office, but it ended up I got to start coding this week. This brought about a new set of problems: how in the world does coding work???

I ended up hanging out with friends on Monday and didn’t come into the office until Tuesday (flexible work hours—intern perk!). Since we couldn’t figure out how to make the Marmalade Hub work on the VM last week, I decided I’ll just have to download the Marmalade Hub onto the HP computer.

Once downloaded, the Marmalade Hub worked great! It was a little confusing to work with at first, but after about 30 minutes and with the help of the online tutorials I was able to navigate it well enough to suit my purposes. The tricky thing is that in order to access your IDE, you have to find a certain option in the drop-down menu and then follow a specific path through downloaded files. It’s kind of hidden, and without the tutorial I would have never figured it out. The most prominent feature is the simulator, which displays as a big green button when you open a project. This just runs the program, and  does nothing to help you if you haven’t written any code yet.

Once I got to where you open up the code, I realized that there was no good IDE installed on the computer. I had assumed it would already have VisualStudio or something similar on it since it was an old computer lying around the office, but it didn’t have an obvious one. There were no programmers in the office on Tuesday. I was lost at what to do. I wanted to get the same tools as the other programmers in the office had so they could teach me how to work them, but I didn’t know what tools to get or where to get them.

I almost quit again. It seemed like a repeat of last week. I was so close to being able to code but just didn’t have the right tools.

But I closed my eyes, took a deep breath, and then got to work again. After some fiddling around, I somehow got the code open in a source code editor previously installed on the computer called Notepad++.

And that was it! I could code. A new surge of enthusiasm came to me and I started figuring my way around in Lua. Previously, my only coding experience was in the Khan Academy Computer Programming course with the language JavaScript. This proved to help a lot with basic understanding of how the mechanics of Lua worked, but I had trouble learning the new terms and functions in Lua. Also, it was difficult finding ways to make what I’d learned in JavaScript work in Lua.

I made extensive use of the Marmalade Quick tutorials and the online Lua tutorials during this time. This first week was mostly a guess and check. The Marmalade Quick comes with a simulator that you can run side by side with your code editor and a read.me window that helps with debugging. I’d write some code in Notepad++, run the simulator to see if it worked, and if needed looked at the read.me window to see what went wrong.

Through this slow process, I created a simple program by the end of the week. It looked much like how I’m imagining the end game to be. In landscape orientation, we have a wood-colored background with a orange piece of salmon and green square of seaweed peeking out from the top of the screen. Later, I’ll work with our design intern and we’ll create more complex images that can be pulled into the program as “sprites” instead of just colored rectangles.

Marmalade Quick has a “tweening” feature that is very useful. It simplifies manual animation. The tween allows you to take an object and change several parts of it with a specified time all within one set of parentheses. To me, it was very similar in structure to the For loops in JavaScript.

Using tweening, I made the program move the seaweed from the side to the center of the screen, and then following move the salmon on top of the seaweed. This may seem pretty lame, but it was exciting to me that I made code that did something! After the previous week of getting nowhere, this was a nice achievement to have.

The one thing I couldn’t figure out was how to make the objects respond to touch. You see, right when you opened the program the animations would automatically start. What I had in mind was for the player to press the salmon or the seaweed before it would move. I could not figure out how to make it work on Friday, but I wasn’t worried. At least I had figured out how to code. I could spend time on it next week.

So, not too shabby of a week. I actually got some things done and can now start working on the development of the game. My next step is to incorporate touch events from the user to manipulate the game.


Again, sorry with all the late posting. This post refers to the immediate week after Week 2, July 7th – 11th. 

Aurora Kesler

Intern working at VenForma. Starting a blog documenting my first summer as an intern and working on creating a mobile game.

Leave a Reply