Archive for May, 2013

Oh… Starling does that too? And better?

So after spending the past couple of months building a blitting tile & game engine, I was almost finished last night with my Part 4 – Towers code. I had checked out Starling last year and remembered watching Lee Brimlow’s Introducing the Starling Framework video. Now that I had slogged through a lot of the heavy lifting myself in my own ZFEngine, I thought I’d go back through some tutorials and check out the Starling community as it is now. Aaaaaand that was the end of ZFEngine. It was both demoralizing and exciting to see how I could use Starling to do exactly the same things I had done by-hand, except Starling does them cross-platform, and takes advantage of GPU-acceleration. I think I’m going to leave the other tutorials up, but I will be rebooting the series from the beginning using Starling. And the posts might actually be more polished this time

Read More…
FacebookTwitterGoogle+Share

AS3 Experiments – MVC in AS3 Tutorial

I’ve been using Backbone.js and jQuery quite extensively for the past year or so and I’ve only recently gotten back into AS3 dev. And I’ve never actually ever used any MVC framework in AS3/Flex, so I wanted to take a quick break away from my AS3 game engine series to have fun and mess around with MVC in AS3. As I didn’t want to stray too far from my game engine, I decided I wanted to whip up some base Model/View/Controller classes, and then extend those to an EnemyModel/EnemyView/EnemyController class. The reason this is in “AS3 Experiments” is because this isn’t just straightforward MVC. I’ve added an expandable Model. Imagine you’re loading in JSON from a file or endpoint and you pass the data straight in to the Model’s constructor or some “setPropertiesFromJSON()” type function. I wanted to play around with the idea of, “what happens if that JSON file has properties inside that you don’t have hardcoded class variables for?” In JavaScript, this wouldn’t even be a conversation. But in AS3, while you do have Dynamic classes, I didn’t want to go that route. So, as we’ll see, if the model doesn’t find the specific class property you’re trying to set, it saves the data anyways in an _attributes Object so you don’t lose it. More on that later. So, I’ve been reading through Rex van der Spuy’s book, AdvancED Game Design with Flash and right from the start, the book just jumps right into MVC… fantastic! I’ve found it’s tough to find “advanced” books and especially “advanced” tutorials online, so this book was very refreshing. There are no sections titled “Data Types in AS3”, or “What is a Function?” I’m really enjoying this book. In the online tutorial front, I came across a couple good sites worth mentioning […]

Read More…