Check out my Tutorials on Flash Game Design!

Tom-as3-gotchi (Flash Game Tutorial) Part 4

06/11/2010

For the fourth part to this tutorial, as promised, I will start introducing some graphics.  I started by sketching out a very rough example of the room our virtual character will live in, then I sketched out a gui - which for now is really just a rectangular frame.

After a bit of time using my Wacom in the Flash IDE, I recreated the sketches in vector format, and then separated them into MovieClips and Graphic symbols.

read more...

comments

SlotMas3chine (Slot Machine AS3 Tutorial)

05/27/2010

I put together a quick example of a slot machine in AS3 in about 15 minutes, and under 100 lines.  It can still be optimized a great deal, and I will probably make some updates to this in the near future.  One of the requests of the example, was an ability to hold matching reels.  So in this example, once 2 of the reels in the slot machine match, those will not respond to the spin() function anymore.  This will be changed around a bit future updates, to act more like a typical slot machine that does not have this feature.

here it is in action on wonderfl

The explanation (or tutorial) part of this post will be complete soon.  I will also optimize the code in the next couple of posts.  Until then, take a look at the code and try to understand what's going on. read more...

comments

Tom-as3-gotchi (Flash Game Tutorial) Part 3

05/21/2010

If you haven't been following along, make sure to check out part 1 and part 2 of this tutorial first.  In the third part of this tutorial, I will cover the whole concept of getter/setter functions, along with the benefits of doing so, instead of using public variables.  A new class will be created too, Food.as.  Keep in mind that any or all of this code can change, move around or get scrapped completely, since this is somewhat of an "organic" tutorial.

To get started, let's have a look at what's changed in the Tom.as class. First, look at the getter function:

public function get weight():Number {
	// when returning weight, round to 1 decimal
	// this way "weight" getter function will return 201.5
	// while private variable _weight will still be accurate
	return Math.round(_weight * 10) / 10;
}

read more...

comments

Tom-as3-gotchi (Flash Game Tutorial) Part 2

05/20/2010

Continuing with our game from part 1, we will now start adding some code to our 2 classes, Tom.as and TomAS3Gotchi.as.  When we left off, the Tom class was basically an empty shell to store various information (health, food, hunger, boredom, etc.) and it had a simple constructor function (when a new Tom class is created, it traces "Hello, I'm Tom!").

Logically, when a new Tom is created, he should have default values set (for example, weight, height, mood and more).  As the project gets bigger and more complex, I may create a class just to store default values, but for now we'll just add them all to the top of Tom.as.  There are 3 main changes: read more...

comments

Tom-as3-gotchi (Flash Game Tutorial) Part 1

05/19/2010

Welcome to my first tutorial of many.  As I mentioned in an earlier post, I believe game programming to be a great way of learning any language, since it can force you to think a little more than a simple form-based application.  For this series, I want to create a variation of the traditional Tamagotchi virtual pet, which will allow me to cover a few different topics and programs in the process.  I've playfully named this a "Tom-as3-gotchi," which should be obvious to most (for the rest, consider it a free riddle).

Game Concept

Before writing a single line of code, I want to have a solid concept to design my game around.  The Tamagotchi page on Wikipedia, which was surprisingly sparse on information, states the core functions.  I'll be using those as a reference, specifically the functions for:

I've omitted the ability to connect with friends for now, but may decide to introduce that later down the line. read more...

comments

Hello World

05/18/2010

I won't bore you with the Wikipedia entry on "Hello World," which is pretty dry anyways (even for Wikipedia).  For just about every programmer on the face of the planet, Hello World represents their first approach to a new language.  For me, blogging is sort of a new language, along with writing tutorials.  I've constantly follow lots of flash blogs, including TheFlashBlog, tink, ByteArray, Bit-101, AnttiKupila, Kevin Hoyt, Actionscript 3.0 Design Patterns, Emanuele Feronato, Lost in Actionscript, Seb Lee-Delisle, Jesse Warden, and plenty others that I will list as time goes on.  I can also attribute most of my learning to following tutorials, although I haven't written many yet.

My goal is to write something new everyday, although realistically I'll manage about 3-4 posts per week.  Hopefully someone out there will get some use to these tutorials - but in line with one of my personal mantras (experience - expectation = happiness), I'll be writing for my own personal benefit at first... and if others can learn from this as well, all the better.

That being said, you can see the tutorials section here.

At work (IDEAS in Orlando, FL) I've been introducing my coworkers/friends to AS3, and recently figured out that the best way to teach, is through practical example.  I guess I should have just started with the obvious!  After reviewing a few other websites that teach Flash Programming, I've been inspired by the good and the bad.  Lee Brimelow's gotoAndLearn was inspiring in that I've personally watched it start from a simple tutorial site, into the Flash Blog of an Adobe Platform Evangelist.  I was also inspired by some very popular, but not-so-impressive sites, which got me thinking, "if they are teaching flash successfully to thousands, with ugly code..."

I also believe game programming is a good way of learning - since it often involves lots of different moving parts.  I'll leave my philosophy on game design to another post, but the tl;dr version is that before programming a game, the concept and gameplay should be fleshed out in detail, without any regards to technology.  Meaning, the concept of the game should be fun and exciting even if it were text-based, or a board-game, or a first-person shooter, and so on.  Of course, not all games are created this way, but it's how I like to approach them, as opposed to finding some game-engine and just working on the gameplay and fun as you code.

So... while you may not have learned anything yet, I promise to give it my best shot!  If you ever have any comments, questions or suggestions for new topics, please comment!  And of course, check out the tutorial section!

comments

Another Developer on Apple vs Adobe (Flash)

05/01/2010

It's only been one day since Steve Jobs posted his Thoughts on Flash, and mobile developer blogs are already at full-swing. In fact, this drama has become such a major issue, that there is even a discussion on Flash dying as a whole, not just in terms of the mobile market. This is a bit different from the typical technodrama of trademark infringements and patents for a few reasons. Adobe and Apple have a history, and in the past have relied on each other to evolve - and while that's true of many conflicts in technology, this one is very personal to many different people from developers and creative professionals to end-users. Even some of the official (and especially unofficial) statements have been personal, passive-aggressive and sarcastic. And I find it all fascinating, in a reality-tv-tabloid-celebrity-leaked-video kind of way.  With all of that said, I'd really like to analyze (read: think out loud about) all of this from a few different perspectives:
read more...

comments

Sid Meier Builds a Game in 48 Hours

04/16/2010

Ryan Meier hosted a game competition at Michigan State University called the "Wolverine Soft 48 hour Game Design Contest." His father, Sid Meier, was not only a judge, but also entered for fun. Ever since I was a kid, games like SimAnt and the original SimCity really influenced the way I look at games. It was before impressive graphics or 3d textures, yet the actual gameplay was impressively complex.

This video documents the entire process, and captures the excitement and passion of game programming. As I dive more and more into programming games in flash, iphone and more, it's become obvious that programming the actual game is the "easy" part. The real magic is making the game playable - but more importantly, fun.

http://ca.kotaku.com/5517715/watch-civilizations-creator-build-a-game-in-48-hours

comments

New Website Design!

03/28/2010

It started to seem like the old site design was a bit dated.  Dated to around 2006 to be exact.  Lots has changed since then, and it was about time for an update.  After spending lots of time gathering up assets and screenshots, I realized how much I've actually done over the last few years.  I hope you enjoy looking through the site, as I've enjoyed making everything on here.  Please check back for updates, tutorials, reviews and rants on Flash, Flex, Air, Actionscript, PHP, amfphp, smf (simple machines forum), wordpress, javascript, jquery, mootools, box2d, mysql, arduino, phidgets, photoshop, illustrator, after effects, cinema 4d, audio production and so much more.

comments

smf2amfphp

03/29/2009

I have been bouncing between wordpress, joomla and expression engine for the past couple years trying to figure out a decent way to integrate a streaming audio player into my forums, without altering the database, or intruding on SMF at all.

Anyways, long story short, I ditched all the “bridges” and just made a non-intrusive package (well, started to make it at least) that feeds data into flash using a series of php functions, that connect directly to the smf database.

I’ve put together a practical example of using this class here:

HipHopProduction.com Beat Meet Player

It will load a given topic (in this case, each drop-down item is associated with a topic that has lots of replies with attachments), search that topic for mp3 attachments, and add them to the list. Then by clicking on any of the names in the list, that user’s mp3 will begin to stream.

The functions that I’ve got working so far are getNews, getMembers, getMemberGroups, getPollEntries, getPoll, getBoards, getBoardCategories, getBoardModerators, getMemberInfo, validateMember, and getTopicAttachments.

Read on for the source code and a functional example.
read more...

comments