Flex dev, end of day 1.

Discussion in 'Game Development (Technical)' started by zoombapup, Jun 18, 2008.

  1. zoombapup

    Moderator Original Member

    Joined:
    Nov 25, 2004
    Messages:
    2,890
    Likes Received:
    0
    Ok, so I got a few hours in on my flex based "serious game" style prototype this week and thought I'd share.

    Man flex is cool! Its sort of a gui-designer come .net style data manager come.. scripting thingy.

    I've got a basic UI in place right now, with a bunch transitions, some nice sliding menu's and drag and drop lists and whatnot. At this rate, I should have a working "game" done within a week (thats not a real-time week, I'm averaging about 3 hours a week of spare time right now).

    Plus this is all skinnable, has a website based backend and will (eventually) have an autoupdater, an authentication system and all of the fun social networking stuff in. I'd highly recommend prototyping any games which arent particularly speed critical. My particular game is a turn based game about purchasing choices and manipulating variables, so its easy to develop on this platform. You'd not do a shooter that way :)

    I'll post a badge installer once the basics of the gameplay are apparent. I could use feedback on the install+update experience.
     
  2. lennard

    Moderator Original Member Indie Author

    Joined:
    Jan 12, 2006
    Messages:
    2,382
    Likes Received:
    11
    Would be happy to hear more about your study of flex as you progress through your project. I'm interested in having a tool that allows me to have web based versions of my games and have been contemplating learning Java for this purpose when my current slate is cleared.
     
  3. AlexWeldon

    AlexWeldon New Member

    Joined:
    Feb 6, 2008
    Messages:
    1,256
    Likes Received:
    0
    As I've mentioned in other threads, I'm also using Flex to make turn-based games. I also think it's a great match for such things!

    I think the only hurdle I'll have is figuring out how properly to write a server in Java and get Flex to interact with it once I start on my next game, which will be multiplayer.

    Anyway, I just wanted to second the recommendation... I've found it surprisingly easy to get into.
     
  4. Jack Norton

    Indie Author

    Joined:
    Jul 28, 2004
    Messages:
    5,130
    Likes Received:
    0
    Well I did few experiments with it too and is very cool to make simulation/turn based games indeed. Looking forward to see your "prototype" :)
     
  5. Applewood

    Moderator Original Member Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    3,859
    Likes Received:
    2
    Are you in a position yet to explain to me what flex actually is ?

    I've asked this before but have never had a sensible answer. Ideally I'd like a glossary of;

    Flash
    Shockwave
    Action Script
    Flex
    Anything else along similar lines

    I downloaded FlashDevelop and got some shit bouncing around the screen, but I couldn't begin to tell you which of those 4 words describes best what I was typing in. LOL :eek:
     
  6. Devman115

    Devman115 New Member

    Joined:
    Feb 19, 2008
    Messages:
    23
    Likes Received:
    0
    Well, I can't tell you what the difference between shockwave and flash is, and I've often wondered what it is. However, I can tell you that actionscript is the language used by flash to create scenes et al. There's also haxe, which is similar to actionscript, but without the visual part that flash gives you. Actionscript can be written outside of Flash, but flash helps in the visual aspect of things.
     
  7. zoombapup

    Moderator Original Member

    Joined:
    Nov 25, 2004
    Messages:
    2,890
    Likes Received:
    0
    Flash

    Flash is adobe's 2D vector/bitmap toolset. It is both a tool (flash MX) and a runtime (flash player) to run the output of the tool. It uses actionscript as its scripting language.

    Shockwave

    Same deal really. It used to be called Shockwave flash I believe (when it was owned by macromedia, now its all owned by Adobe). I might be wrong on this one as I've never used it.

    Action Script

    This is the scripting language behind flash/flex.

    Flex

    Flex is basically a sort of framework built on top of flash. It does all sorts of data and GUI stuff. It has its own toolset (flex builder) which I'd recommend getting the 60 day trial of. It allows you to code in actionscript (because underneath it runs in flash) OR it allows you to use flex sort of meta script (lots of MX tags), the MX stuff gets converted down to flash/actionscript stuff anyway. Think of flex as a way to "program" flash based apps. Flash isnt really meant for apps so its kind of a funky UI for developing code with, hence the need for flex.

    Anything else along similar lines

    AIR - Now this is the interesting part. Take the "application" developed in Flex (which runs via the flash player) and turn it into a runtime based system (essentially removing the need for a browser) and you have AIR. So you .AIR file is basically a standalone app, based on a flash runtime, written using flex and running outside of a browser :)

    Confused? yep, so was I :)

    Trust me, its worth a peek.
     
  8. Applewood

    Moderator Original Member Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    3,859
    Likes Received:
    2
    Yeah, most of my past explanations have sounded like that tbh. But, your's is the clearest so far, thanks. :)

    I almost understand stuff now. So what I did in flashdevelop was use pure AS3, whereas flex has some other stuff that would be handy (tools? libs?). I think. Maybe.

    I'll stick with C++ a while longer, I know what I'm coding in then :) Good luck though, I did enjoy programming in whatever it was knowing it would just run in a browser like java's meant to...
     
  9. Viktor

    Viktor New Member

    Joined:
    Aug 14, 2007
    Messages:
    50
    Likes Received:
    0
    Have you tried Google Web Toolkit? KDice uses it. Integrating a Java server would be a non-issue.
     
  10. Backov

    Original Member

    Joined:
    Oct 23, 2005
    Messages:
    812
    Likes Received:
    0
    I am still using Flex, although the day job is taking most of my time. Still love it.

    Actually, what I've been struggling with for a couple weeks now is getting Flex to talk to an EE-style Java backend. I was using Ruby on Rails for my backend, but as cool as it is, a good game backend it does not make, for many reasons.

    Anyway, so now I'm in the big boys world of Java, using JBoss and Seam and such, and it's taken me to just tonight to finally get all of the pieces working together.

    If one of you is curious, I decided on JBoss seam as my backend (it's a nice framework built on top of EJB 3 and Hibernate) and GraniteDS as the interface between Flex and Seam- it makes it quite easy once you get the learning cliff and setup out of the way. It's purpose built for interfacing between Flex and Seam, among a couple of others.

    I'm hoping to get my little Flex game out sometime soon, now that I've sorted the backend again.
     
  11. AlexWeldon

    AlexWeldon New Member

    Joined:
    Feb 6, 2008
    Messages:
    1,256
    Likes Received:
    0
    I'll look into it, thanks. Haven't gotten that far yet, but anything that would make it easier to get a multiplayer web game up and running should be useful.

    Maybe it's easier to understand by means of an example. Here's what a little bit of Flex code might look like. In the example below, the stuff between the <mx:Script> tags is ActionScript and would be the same if you were working with Flash (that's my understanding, anyway... have never used Flash), whereas everything else is what makes Flex Flex.

    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="0xFFFFFF">

    <mx:Canvas width="500" height ="500">

    <mx:Button label="Show Text" x="50" y="50" click="showText();" />
    <mx:Text id="my_text" text="If you see this, there's a problem." visible="false" x="50" y="100" />

    <mx:Script>
    <![CDATA[

    public var helloText:String = "Hello World!";

    public function showText():void {
    my_text.text = helloText;
    my_text.visible = true;
    }

    ]]>
    </mx:Script>

    </mx:Application>
     
  12. Drake

    Indie Author

    Joined:
    Mar 28, 2005
    Messages:
    263
    Likes Received:
    0
    You are wrong. :) It's not your fault though; Macromedia's inept marketing created this confusion many years ago, and I fear the mess will never be untangled.

    It is true that, back when Shockwave was a stronger brand than Flash, the Flash plug-in was called "Shockwave Flash" (as evidenced by the MIME type description, and the .SWF extension). However, the "real" Shockwave plug-in has always played content created in Director (not Flash). Further confusing the matter is the fact that Director content can contain Flash content (but not vice versa).

    These days, the Shockwave 3D engine is the only real reason to choose Director/Shockwave over Flash for web content. For 2D, I'd agree that Flex/AS3/AIR is looking pretty sweet. It will be even more so with the hardware acceleration of the 10.0 player.
     
  13. chanon

    Indie Author

    Joined:
    Jul 28, 2004
    Messages:
    468
    Likes Received:
    0
    zoombapup, Do you use Flex Builder? Or FlashDevelop?
    I've used FlashDevelop before but I'm wondering if I should use Flex Builder for my next projects.
     
  14. bengarney

    bengarney New Member

    Joined:
    Jun 10, 2008
    Messages:
    20
    Likes Received:
    0
    I've used Flex on a few projects (fulltime but unreleased) and it's basically awesome.

    The IDE that you get with Flash CS3 is terrible for coding; Flex Builder is built on Eclipse and although it's a little bit limited compared to, say, Visual Studio, it's quite usable. You can't do art in Builder, however - you have to use Flash for that.

    The Flash technology is good. You have some great 2d capabilities, and 3d capabilities I'd compare to a DS with pixel shaders. Flash 10 is pushing the graphics capabilities further. ActionScript is a pretty reasonable language, definitely easy to be productive in.

    I think for most games - especially ones where you're focusing more on gameplay and fun than hardcore graphics and gigs of content - Flash is a serious contender.
     
  15. bengarney

    bengarney New Member

    Joined:
    Jun 10, 2008
    Messages:
    20
    Likes Received:
    0
    PS - Flex Builder is the only tool I'd recommend for serious dev work; FlashDevelop is OK (we used it for several months) but the lack of a debugger makes it hard to bring a project to completion.
     
  16. zoombapup

    Moderator Original Member

    Joined:
    Nov 25, 2004
    Messages:
    2,890
    Likes Received:
    0
    I'm with Ben there. I tried flashdevelop, but Flex Builder 3 is pretty damn good. It has all the refactor sweetness from eclipse, alongside a GUI builder thats pretty damn neat. Some CSS style interface skinning stuff makes reworking GUI's pretty easy too.

    Its not perfect by any means. There are obviously performance issues if you want to do high speed blitting stuff. But for interfaces and internet integrated data stuff, its very neat.

    I'm probably going to use WebOrb locally for a while, then move to a BlazeDS server once I've got the wrinkles ironed out.

    There are so many examples of Flex + backend usage out there, that it doesnt really matter which flavour of backend tech you use, PHP, Java, Ruby or whatever.

    The proof of the pudding though, is in the eating. Hopefully I'll have a nice coconut macaroon for you to try this weekend.
     
  17. zoombapup

    Moderator Original Member

    Joined:
    Nov 25, 2004
    Messages:
    2,890
    Likes Received:
    0
    chanon: definitely get Flex Builder. Its so productive, plus it has all the AIR sdk and things fully integrated (its like a proper IDE in that it just works out of the box). There's a 60 day trial, so you can try it out to compare.

    If you have anyone you know in education, you can get a free copy (just need thier educational details and have to send it to adobe).
     
  18. Oaf

    Oaf
    Original Member

    Joined:
    Jul 30, 2004
    Messages:
    136
    Likes Received:
    0
    Flex builder is essentially an Eclipse plugin - it comes in two versions, the plugin on its own and a full eclipse install, reskinned.

    The good thing about that is, you can just use Eclipse to build your flex, flash, j2se, j2me and C projects, all from one doobry, and even have different views/layouts for each.

    So you can make Flex apps - with all the widgets and stuff - or you can build a straight Flash app. I usually lump all my assets together in a Flash file, then include that in my flex builder flash project and reference them directly from the code.

    It has its faults (like it randomly disables the Project->Build menu item, forcing you to right click on the project name instead), but it's miles better than using the Actions window in Flash :D

    Flex is good for sending and receiving data from servers too - it's quite straightforward to talk to php pages (and I'd imagine jsp too), and you can point a listbox at a remote xml file and it'll populate it with the contents (pics from filenames, text, whatever).

    Flash 10 seems very fast, too - I did a quick test with gridrunner with it - on my laptop it manages more than 320x240 individual pixel plots and a 2x scale with antialiasing at between 70 and 150fps.
     
  19. Jack Norton

    Indie Author

    Joined:
    Jul 28, 2004
    Messages:
    5,130
    Likes Received:
    0
    It may be a stupid question, but there is a sort of template for games? I didn't write "library" because from what I saw seems that Flex/Actionscript is really the library itself (has GUI, sounds, sprites, input, etc).
    What I mean is a ready-made solution that let me just do the design and logic... well is a bit hard to explain :p maybe just a few good source-code examples of full games (for example some simulation or strategy games)? maybe is too early for that though, I don't see many flex source codes for full projects around...
    For example I tried to customize mouse pointer, and managed it, then wanted to have user press ESCAPE key to switch to fullscreen from the web app, but wasn't able to figure this out... surely I'm a new AS3 programmer but shouldn't be so hard to make that... :eek: (I know the command I need to use, I can't associate it with pressing ESC though)
     
  20. Oaf

    Oaf
    Original Member

    Joined:
    Jul 30, 2004
    Messages:
    136
    Likes Received:
    0
    There's some games on http://www.flashcomponents.net.

    I suppose, like when learning any new language, the best place to start is the forums: board.flashkit.com and actionscript.org are the best ones for that sort of thing :)
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer