Bacon and Games

Date: 29.04.2010

Learn How to Make Flash Games

If you’re looking to learn how to make a Flash game, Adam ‘Atomic’ Saltsman and Chevy Ray Johnston are coming to your rescue. They’ve recently launched a joint venture, Flash Game Dojo, which is a site dedicated to helping ease people into the world of creating Flash games. Their site aims to answer questions like “How do I add gravity to an object?”, “How do I get keyboard input?” and “Who shot Mr. Burns?”. OK, I made that last one up, plus we all know that it was Maggie. Anyway… Granted the information they’re providing is specific to using their respective frameworks, but a lot of the key concepts and programming models you’ll learn working with Flixel and FlashPunk are still relevant when building a game completely from scratch. And they’re open source frameworks, so if you’re uncomfortable using formulas without deriving them first (remember high school math?), you can open up the guts and see what’s going on under the hood of something as eerily simple as this:

1
2
3
// adding gravity to the player
var player:FlxSprite = new FlxSprite();
player.acceleration.y = 600;

What’s really neat about what Adam and Chevy are doing is that they’re aiming to usher people into the world of creating games. They’re NOT trying to push their respective frameworks, which as products in a marketplace would be competitors. Instead they’ve chosen to offer their work up as free open source options, a space in which they can support each other rather than compete. They’re working together toward a common goal: Get people making great games. I applaud them for that.

I have an upcoming series of articles entitled “Actionscript for Artists” which will focus on providing tools to help artists and programmers work more easily together to make games. It’ll be a mix of code samples, tutorials aimed at teaching artists the basics of Actionscript and tips on how to communicate and collaborate. I come from a more traditional Flash gaming background that uses vector art, movieClips and other techniques more native to Flash, so my focus will be on that style of Flash game development. Flixel and FlashPunk are Flash frameworks that turn Flash into an environment similar to the way old NES games were built, using sprite sheets and raster images. Though our approaches to Flash game development are different, we’re all trying to do the same thing: get people making great games. And besides, variety is a good thing. I’ve only dabbled in Flixel and though it’s a very foreign approach for me (I’m used to building everything on my own, so adhering to a framework is tough for me to get used to) I intend to learn Flixel and FlashPunk. I don’t think I’ll ever abandon the way I’ve always made Flash games, but I do like to try new things, evolve and add new things to my bag of tricks.

Flash Dojo offers a bunch of handy services:

  • A wiki with documentation on both frameworks
  • Q&A style explanations for how to build common game elements
  • Free swf hosting for people who want to quickly test and share a game… likely to be used by people who want to share a work in progress that isn’t ready to go on Newgrounds. You upload a swf and the site gives you a link to share it. It’s that simple. I’ve got webspace coming out of my ears but this is so simple I will undoubtedly use it from time to tim.
  • Articles about game design
  • Software recommendations
  • Tutorials
  • Completed game source for your learning/tinkering pleasure
  • And the bulk of their site’s updates are broadcast via RSS so you can stay abreast of what’s new

If you’re interested in game design I strongly recommend you comb through Flash Game Dojo. Spend some time playing with their frameworks, see what they can do and how they work. But remember that Adam and Chevy don’t have all the answers and they haven’t thought of everything. They will be the first to tell you that their framworks aren’t the ways to build games, they’re just two ways to build games. Learn from what they’ve done, add your own flair and if you think you have found a better way to do something you may well have. I’m sure Adam and Chevy are interested in being the starting point from which people can learn how to make games. What they’re probably NOT interested in is creating a legion of game designers who rely so heavily on Flixel or FlashPunk that the frameworks speak louder than the game experiences created with them. The idea is for people to play your game and remark, “That’s a great game!”, rather than “That’s a great Flixel game!”.

Create. Learn. Play. Question. Invent. Share.

Adam is known for games such as Gravity Hook and Canabalt which he built using the Flixel Framework, for which he is also responsible. Chevy Ray Johnston is behind Flash Punk, another Flash game framework. Both frameworks are designed to handle a lot of the heavy lifting, collision detections, ui, asset management, etc., so that you can focus on game design.

Super Mario Crossover

One of the articles I’ve got queued up to write is “The Physics of Mario”, which will be a look at the the way Mario moves, because there’s something about it that’s really unique and charming. He can perform a shallow jump, run into a long high jump and then parlay that momentum into a duck-slide to avoid an enemy. He can change direction in mid air or bounce nimbly from enemy to enemy without ever touching the ground. Mario’s variety of abilities truly makes you feel like you’re in control of a superhero. How great does it feel when you put on the air brakes and narrowly avoid that Koopa Troopa and grab the mushroom, all in one fell swoop?

<———————— this great, that’s how ————————>

Besides giving you a quality range of motion, the slightly slippery physics of Mario entice you to play the game with bravado, instead of the heavy-footed careful stepping you have to do as Simon in Castlevania. Don’t get me wrong, Castlevania is a great game but for very different reasons than Super Mario Bros.

Great, Nintendo ass-kissing…what good is this article going to do me?
Well, as I discussed in my first article The Difference Between Tetris and “tetris” and then revisited in Tips for Making a Successful Game Clone it’s very difficult to clone something as well known as Super Mario Bros., Tetris and other staples from video gaming history. You’re working with a well known property and thus expectations are high and opinions can run hot. This article is about someone who got it right.

Where most Mario clones fall short is Mario’s movement system, the physics of Mario. Mario has been copied dozens of times by the Flash gaming community (here are a few Flash Mario clones) but most of them just don’t feel right. Most of them don’t give you the ability to vary the height of Mario’s jump, because it’s easier to set a constant jump height than worry about tracking how long the user holds down the jump key. Many Mario clones will jump again if you land while still holding the jump key, which can be really annoying. This can have you hopping around like a rabbit against your will… and that’s no good. And rarer still is the Mario clone that allows you to vary your jump height based on Mario’s run speed.

Besides the physics of Mario, there are other little touches that can be easily missed:

  • The speed at which Mario rebounds off the top of an enemy or the bottom of a coin block
  • Piranha plants won’t come out of a pipe while Mario is standing next to it
  • At the right speed, Mario can run over small gaps without falling.
  • The game “pauses” when mario collects a mushroom

There are many things that have to be there in order for the clone to feel like the classic we all know and love. Sure, I ran into a few bugs…the floor was missing from one level leaving me to fall immediately to my doom, I had a few shells pass through Mario without killing him and I found it extremely odd that the run and jump buttons were reversed…but all in all Super Mario Crossover is an EXTREMELY well done clone of Mario.

The jumping, sliding and acceleration of Mario feel almost perfect. As far as I could tell the secret mushrooms and warps were all there. I even saw a mushroom jump over a small gap as they sometimes did in the original. It’s just really great to see a clone of Mario that does justice to the original. I was able to enjoy this game because I didn’t find myself yanked out of a familiar experience by something that just felt “off”. That came out snobby…I wish I was writing this with a tool that allowed me to edit my words before sending them out into the world…*sigh*.

What’s really neat about this clone, is that it’s not a clone at all. I used the term “clone” in Tips for Making a Successful Game Clone and caught a little flack for it…but in a constructive way. It was suggested to me by I-smel of Newgrounds that the term “clone” was misleading. He and others, like Luis, went into the article expecting that I was advocating unoriginality, when in fact I was exploring the challenges and benefits of having to work from an existing and familiar concept. Two of the tips I gave in that article were:

  • Play the original…ie know every detail of what you’re building
  • Have a hook…make your game different enough that users aren’t just left wishing they were playing the original

Super Mario Crossover lets you play through Super Mario Bros. in its entirety, with the option to play as Mario, Bill R. (Contra), Samus (Metroid), Mega Man (um…Mega Man), Simon (Castlevania) and Link (if you don’t know this one I’m not going to tell you…also I hate you). Each brings his (or her…sorry Samus) own control scheme, weapons and powerup hierarchy to the experience. And in most cases, each new character moves and feels much like they did in their original game, with the exception of Simon who learned how to double jump since we first saw him. This is a great addition, which falls under one of my other tips: take the opportunity to fix things from the original that frustrated you…let’s be honest, Castlevania was great but the movement was a bit irritating in that game.

It’s never been my intention for this site to be a game review site, there’s enough game review sites and users on them that there’s no shortage of opinion on the net. It’s been my intention to get people to think more deeply about creating great games and what it takes to do that. I’m not the greatest game designer nor the greatest programmer in the world, but I do feel that I’m entrenched in that world enough that I’ve got something useful to pump back into the community, be it tips, code snippets or just articles that spurn discussion and thought. I hope that some of what I put up on this site is useful to aspiring and seasoned game developers alike.

Super Mario Crossover and this article can do a bit to help people think about how difficult it really is to nail a clone of a classic game. But mostly I just wanted to take a moment to appreciate what an amazing job Jay Pavlina did with Super Mario Crossover. He had a great concept, he nailed the mechanics and as a result the glowing reviews are pouring in. Congratulations, Jay, on your success. I’m very excited to see what you do in the future.

Copyright © 2024 Bacon and Games

Theme by Anders NorenUp ↑