A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: good class structure?

  1. #1
    Senior Member
    Join Date
    Jan 2005
    Posts
    107

    good class structure?

    i need some advice on good class structure and planning for an as3 game.

    my attempts at programming are very unorganized and messy.

  2. #2
    The Cheeze to Your Macaroni ColbyCheeze's Avatar
    Join Date
    Dec 2007
    Location
    Texas
    Posts
    244
    Head First Design Patterns...Best book ever. It's written in Java, which looks just like AS3 anyways. Haven't found, or heard of a better book to teach you good design philosophies etc.

  3. #3
    Professional Flash Developer
    Join Date
    Aug 2007
    Location
    California
    Posts
    105
    Hey Colby! How have you been? It's nice to see you around these parts.

    How about your structure of a game series?

    Not that it isn't already in your sig.

  4. #4
    The Cheeze to Your Macaroni ColbyCheeze's Avatar
    Join Date
    Dec 2007
    Location
    Texas
    Posts
    244
    Doing great man! I've been on hiatus for a while but recently decided to get back into Flash. Hopefully I'll have another article released soon as well and I am working on a little game idea that I came up with too.

    How about you?

  5. #5
    Professional Flash Developer
    Join Date
    Aug 2007
    Location
    California
    Posts
    105
    The funny thing is, I'm working on a book right now that is basically exactly what icezizim wants. That has been taking up most of my game related time right now. I have to make about 10 games for the book, so I am doing those instead of my own ad and license based ones for now. The book starts with a basic framework, and then chapter by chapter we create games and add the reusable code to an simple OOP framework and a set of re-usable code packages.
    I wish it was complete so could help ice out, but I am building everything chapter by chapter (I've only finished 3 so far). I have to build all of the code for both Flash and Flex (Flash Develop), so there is a lot of replacing library items with embeds and tedious stuff like that.

  6. #6
    The Cheeze to Your Macaroni ColbyCheeze's Avatar
    Join Date
    Dec 2007
    Location
    Texas
    Posts
    244
    Oh wow writing an entire book is a lot of work! You have my respect on that. Did you get a publisher deal or?

  7. #7
    Professional Flash Developer
    Join Date
    Aug 2007
    Location
    California
    Posts
    105
    Yep, that's all in the works right now. We have shipped three chapters off to the editor and hope that it isn't total **** so they will keep moving along with it. I am keeping my fingers crossed and don't want to jinx it, but so far I am happy with the way things are going.

    I'd love to see that game you have in the works.

  8. #8
    Wait- what now? tidenburg's Avatar
    Join Date
    Dec 2005
    Posts
    1,471
    I don't know if my methods of using classes is strange or not, but anything I create I use a series of 'director' classes. Basically the main class loaded is in the same folder as my .fla and called gameDirector. That then imports the first director from the directors folder. That director will do all the loading and, when complete, the gameDirector will unload it and create another director called menuDirector and such. This just repeats for all stages of the game such as gameplay and the end-screen. Basically, what would have been a frame in AS2 is now a class.

    For similar objects, like a tile, I create a base class which all the varients will inherit, and the folder structure for those is basically just plain categorisation. "tiles", "enemies", "objects" and the like, all contained within a 'classes' folder.

    That may not be answering your question at all, and it may be a messy way of doing it in comparison to other methods, but it all feels very tidy. When I started I didn't have one constant class like a gameDirector, my games always got real messy, real fast.
    Last edited by tidenburg; 08-03-2009 at 04:59 PM.
    "I'd only told them the truth. Was that so selfish? Our integrity sells for so little, but it is all we really have. It is the very last inch of us, but within that inch, we are free."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center