As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/

How Do I Program a Halo Game? [Flash]

CognisseurCognisseur Registered User regular
edited June 2010 in Help / Advice Forum
So I decided that since my summer is going to involve way too much free time I could use it to learn something I've been meaning to for a while now -- Macromedia Flash!

Things I have:
Flash CS5
Some basic programming abilities (VB, Java, SPSS)

Things I lack:
Any clue what I'm doing in Flash

I've tried to find some good tutorials online to get me started but I've run into these problems:
  1. There are a million tutorials out there and I therefore have no clue which provide useful and high-quality information and which are pretty crappy.
  2. The majority of the tutorials are written for past versions of Flash and specifically for ActionScript 2.0, which apparently worked quite differently in a number of ways (I don't know what those ways specifically are but I just wasted an hour trying to learn Flash from a 2.0 guide and I'm just stuck with a ton of errors I can't resolve)
  3. Lots of official-looking tutorials focus a lot on animation, whereas I have interest primarily in games. From what I understand, there's a fairly big split in that one uses the timeline and such extensively whereas the other does almost all of the work in ActionScripts.

So does anyone know of any good tutorials for Flash, specifically for writing games (and using AS3.0)? I'd rather it be web-based rather than a book, for convenience and expense reasons.

Cognisseur on

Posts

  • Dead ComputerDead Computer __BANNED USERS regular
    edited May 2010
    You are way too late to the Flash thing. Flash will be completely dead in 1 or 2 years. Pick up a real programming language and learn some Open GL and make a real game.

    Dead Computer on
  • CognisseurCognisseur Registered User regular
    edited May 2010
    You are way too late to the Flash thing. Flash will be completely dead in 1 or 2 years. Pick up a real programming language and learn some Open GL and make a real game.

    Er... why will Flash be dead in 1 or 2 years? It seems like there are more flash game sites than ever before and they're more played than ever before. Is there some tech-related phenomena coming soon that will change how quick casual games are made? I don't understand.

    Cognisseur on
  • Dead ComputerDead Computer __BANNED USERS regular
    edited May 2010
    Cognisseur wrote: »
    You are way too late to the Flash thing. Flash will be completely dead in 1 or 2 years. Pick up a real programming language and learn some Open GL and make a real game.

    Er... why will Flash be dead in 1 or 2 years? It seems like there are more flash game sites than ever before and they're more played than ever before. Is there some tech-related phenomena coming soon that will change how quick casual games are made? I don't understand.

    It's time to wake up. The reason Flash is still used is mostly for displaying Web Video, which accounts for about 99.9% of the usage of Flash on the Internet. Flash websites are shitty, slow, can't be indexed and cause many browser crashes. Flash games are mere pitiful diversions for a time before ubiquitos mobile phones and portables. Cool in the 90's, but dated in the 10's.

    But now new technology is emerging. HTML5 will allow you to go beyond what we ever thought possible, and it's solution for displaying video is a mere video tag that works and loads faster than ever before.

    And the final nail in the coffin, is that no version of the Apple iPhone, iPod or iPad will ever support Flash. And Apple is such a big player, that everyone will agree with them and follow suit. It's time for progress.

    Don't bother learning Flash now, it's fuckall useless. Learn Javascript if you want to make web browser games, it is a full and powerful programming language.

    Dead Computer on
  • DarkewolfeDarkewolfe Registered User regular
    edited May 2010
    If nothing else, the fact that Apple is determined to murder Flash will hamstring Adobe enough to drag it down.

    Darkewolfe on
    What is this I don't even.
  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    edited June 2010
    Cognisseur wrote: »
    Er... why will Flash be dead in 1 or 2 years?

    It will be dead in 1 or 2 years because "Dead Computer" is retarded and woefully wrong.

    ANYWAY


    OP, it depends on if you want to do 3D or not. If you want a "Halo" type game then I assume you want 3D. There are Flash AS3 API's such as Papervision that provide a 3D programming interface that is comparable to a sort of abstracted OpenGL API. You can load in colladas, do basic lighting, and I think Papervision also supports basic physics and collision. If not, then there are plenty of other options, and you'll find most of them by going to Papervision and related sites via links.

    If you are doing multiplayer then you are in for agony. Flash multiplayer means digging into a bunch of high level open source shit that is not really designed to support the scale and load demanded by a multiplayer shooter.

    Using an API like Papervision, you essentially program the entire application, so you never have to deal with timelines or symbols, which will probably be more Java-esque and to your tastes. And frankly, that's the easier way to do it. Timelines and symbols are a mess for people not familiar with the Flash development environment, and are avoidable.

    I will advise you to very carefully plan the scope of your game. Flash can do 3D, and Papervision is pretty decently tuned, but the simple fact is that the graphics capabilities are limited, and relatively slow.

    Jasconius on
  • CognisseurCognisseur Registered User regular
    edited June 2010
    I'm sorry for the misleading headline -- I definitely have no plans to make Halo, I just thought people would think a poorly worded question drenched in ignorance would be amusing.

    I really just want to learn to make some fun platform, action, and puzzle games. I don't know if Flash will be dead in a year, but I recognize that even when something takes its place any Flash knowledge I possess will not be useless. I'll have to replace some formatting with how loops and such work but the basic skills and tricks I learn in game-making will be cross-language.

    My current problem is that I need some pretty basic tutorials to just get my feet under me. ActionScript 3 appears to be some bizarre half object oriented language and half not, and I can't really get a firm grasp for it. As a result, I can't even get a very basic program running like 'when I press W the text box moves up'.

    I found some really nice tutorials that start with precisely those simple types of programs and then add layers of complexity but unfortunately they're all written in Actionscript 2 and despite my continuing attempts to learn from them (out of desperation) it's really going nowhere.

    I've also tried just downloading the source code for flash games and trying to decipher what's going on but, again, until I understand the basic framework and structure of Flash and how various entities are related to one another it's kind of useless.

    Cognisseur on
  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    edited June 2010
    AS3 is a mostly fully featured object oriented language. It has some goofy rules related to statics, interfaces (the programming kind), etc, but that's nothing that isn't normal in some form or another to 3rd/4th gen languages.

    The thing about AS3 that can get confusing is that there are two object types, Object and MovieClip, which are dynamic objects, which you can think of as a a mutable dictionary in java, except slower.

    Bad Flash programmers tend to abuse those two objects because of their dynamic nature which can lead to "AS2-like" code and basically throws people who are used to strongly typed languages for a loop. But, at its core, AS3 is a strongly typed language with a couple of ugly dynamic features which are essentially a shadow of its forgotten ancestors.

    Now, the dynamicism does have some usages, especially in event driven code, but few people actually do it right.

    Because of the lack of coherent community dictated style, AS3 is one of the few languages where books are legitimately much better learning resources than internet tutorials. I recommend starting there. Essential Actionscript 3.0 is pretty much the field manual, and covers the basics. You are on your own for finding something more game-centric.

    Jasconius on
  • CognisseurCognisseur Registered User regular
    edited June 2010
    You know, I honestly think I can learn a lot from just looking at other people's video game source code since I seem to understand most of the actual code, but it's hard to say if it'll work because I'm currently stuck.

    There's something I'm not doing on the stage/form aspect of things that's stopping me from having my programs do anything.

    I found a nice little source code by Adobe demonstrating how they can make a bug move around the screen using the arrow keys. I've done my best to replicate what they did but when I run my little application pressing the keys does nothing. Since my code is just a simpler version of what the Adobe version is, I'm pretty sure I did something wrong on the stage/form side of things. Maybe you can help me figure it out?

    I get a new project. I import an image. Then I press F8 and convert it to a Movie Clip. I name the MovieClip 'Ship' and check off 'export it for ActionScript' which thereby creates the class Ship. I then select my original picture on the stage and give it the instanceName of 'myShip'.

    I tried running the code (which I'm pretty sure is accurate) by commanding 'myShip' specifically and by commanding 'Ship'-- neither caused it to move around. Then I tried to redo my converting the image into a MovieClip but this time not telling it to export for Actionscript. Once again I tried it with 'myShip' and 'Ship' and still no luck.

    What else do I need to do on the stage end of things to have the code link the MovieClip image on the stage with anything I can refer to in the code?

    Cognisseur on
  • Dead ComputerDead Computer __BANNED USERS regular
    edited June 2010
    You will learn a hell of a lot more by skipping all the Flash bullshit and learning how to build a game in a solid programming language.

    Otherwise, have fun having your Flash skills become suddenly irrelevant in 2 years.

    Maybe even less. Could be less.


    My advice, create Tetris in Javascript.

    Dead Computer on
  • CognisseurCognisseur Registered User regular
    edited June 2010
    You will learn a hell of a lot more by skipping all the Flash bullshit and learning how to build a game in a solid programming language.

    Otherwise, have fun having your Flash skills become suddenly irrelevant in 2 years.

    Maybe even less. Could be less.


    My advice, create Tetris in Javascript.

    Er... I'm having difficulty understanding why you think coding Tetris in Javascript is that much different from doing so in Flash. The timers work a little differently, and the names of the properties are different, and uh... yeah. I'm pretty sure if I learn to do it in one language I'd be able to pull it off in the other language 10x easier than if I hadn't. That would be the definition of 'relevant skills'.

    Cognisseur on
  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    edited June 2010
    Cognisseur wrote: »
    You know, I honestly think I can learn a lot from just looking at other people's video game source code since I seem to understand most of the actual code, but it's hard to say if it'll work because I'm currently stuck.

    There's something I'm not doing on the stage/form aspect of things that's stopping me from having my programs do anything.

    I found a nice little source code by Adobe demonstrating how they can make a bug move around the screen using the arrow keys. I've done my best to replicate what they did but when I run my little application pressing the keys does nothing. Since my code is just a simpler version of what the Adobe version is, I'm pretty sure I did something wrong on the stage/form side of things. Maybe you can help me figure it out?

    I get a new project. I import an image. Then I press F8 and convert it to a Movie Clip. I name the MovieClip 'Ship' and check off 'export it for ActionScript' which thereby creates the class Ship. I then select my original picture on the stage and give it the instanceName of 'myShip'.

    I tried running the code (which I'm pretty sure is accurate) by commanding 'myShip' specifically and by commanding 'Ship'-- neither caused it to move around. Then I tried to redo my converting the image into a MovieClip but this time not telling it to export for Actionscript. Once again I tried it with 'myShip' and 'Ship' and still no luck.

    What else do I need to do on the stage end of things to have the code link the MovieClip image on the stage with anything I can refer to in the code?

    Like I said, by surveying peoples source code you're going to be seeing a large variety of styles. Adobe samples in particular are what you might refer to as "demo quality" code. Compare to the Essential AS3 book I meantioned and you will see what I mean.

    I think your problem may be because your Ship class and Ship library symbol share the same name. It's a procedural quirk that, if done out of order, will cause a namespace conflict that Flash doesn't report very well on.

    Try deleting that symbol, doing it over again, and naming the library symbol something different than Ship, then manually set your Base Class to Ship... that should produce *something*.

    That's only relevant if you are actually using an external class file Ship.as ... if you aren't, then you are really just posturing.

    Jasconius on
  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    edited June 2010
    Actually Tetris in JS will teach you much less about ... well, anything, since JS is object oriented basically in name only and its rendering methodology is so far away from any real programming that it is quantitatively worse to learn on than Flash.

    But Dead Computer is a troll, and facts are irrelevant to that type of rhetoric.

    Jasconius on
  • JNighthawkJNighthawk Registered User regular
    edited June 2010
    Completely ignoring Dead Computer's unhelpful and spiteful advice, check out http://www.kongregate.com/. I believe they have some tutorials. I could be wrong, though.

    JNighthawk on
    Game programmer
  • PheezerPheezer Registered User, ClubPA regular
    edited June 2010
    You will learn a hell of a lot more by skipping all the Flash bullshit and learning how to build a game in a solid programming language.

    Otherwise, have fun having your Flash skills become suddenly irrelevant in 2 years.

    Maybe even less. Could be less.


    My advice, create Tetris in Javascript.

    Stop being a silly goose. This is hardly advice and barely on topic.

    Pheezer on
    IT'S GOT ME REACHING IN MY POCKET IT'S GOT ME FORKING OVER CASH
    CUZ THERE'S SOMETHING IN THE MIDDLE AND IT'S GIVING ME A RASH
  • kedinikkedinik Captain of Industry Registered User regular
    edited June 2010
    I can help you out with your specific linkage issue.


    1) Clear your stage of symbol instances.

    2) See the 'Class' field that reads 'Nautilus' in the below image? This is the name of your main class. Make sure that you fill this in with whatever name you desire for your main class.

    main_class.png

    3) Create a new ActionScript 3 file and give it the main class name.

    4) Make your file look like so:
    package  
    {
         import flash.display.MovieClip;
         import flash.events.KeyboardEvent;
    
         public class CLASS_NAME_YOU_CHOSE extends MovieClip 	
         {
    
              public function CLASS_NAME_YOU_CHOSE() 
              {
                   myShip.x = 100;
                   myShip.y = 100;
                   this.addChild(myShip);
    			
                   stage.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown);
              }
    		
              private var myShip:Ship = new Ship();
    
              private function handleKeyDown(event:KeyboardEvent):void
              {
                   if(event.keyCode == 37) myShip.x -= 3;
                   else if(event.keyCode == 38) myShip.y -= 3;
                   else if(event.keyCode == 39) myShip.x += 3;
                   else if(event.keyCode == 40) myShip.y += 3;
              }
         }
    }
    

    5) Make sure that your Ship symbol is clicked to "Export for Actionscript" and that the class name is "Ship".

    6) Compile and move your ship around with the arrow keys

    Let me know if anything is confusing or you're having trouble getting it to work.



    I wish I could point you towards some good tutorials, but I haven't come across a comprehensive game-oriented one.

    I recommend brushing up on event handling and dispatching, using the main display objects, embedding fonts, writing custom classes, and with managing your code using packages and sub-folders.

    kedinik on
    I made a game! Hotline Maui. Requires mouse and keyboard.
  • SeolSeol Registered User regular
    edited June 2010
    You will learn a hell of a lot more by skipping all the Flash bullshit and learning how to build a game in a solid programming language.

    Otherwise, have fun having your Flash skills become suddenly irrelevant in 2 years.

    Maybe even less. Could be less.


    My advice, create Tetris in Javascript.
    Nonsense. The vast majority of game programming skills are platform-agnostic, and those which aren't are either fairly easy to pick up or way beyond a beginner anyway. The most important thing for a beginner to game programming is ease of entry to get to the interesting bits of the programming and the quickest prototyping. Starting game programming in Flash isn't about Flash, it's about starting game programming.

    Seol on
Sign In or Register to comment.