PDA

View Full Version : Should Flex Be Used For Games?


Cerin
03-02-2008, 03:07 AM
I'm trying to write a simple game in Flash. Originally it started out as a strict AS3 project, but I decided to try and use Flex, since I wanted to take advantage of all it's pre-made widgets for creating menus, panels, etc. However, I'm finding that Flex introduces a lot of changes in how certain classes function, and it's requiring a lot of refactoring. Is it wise to use Flex when writing a game, or is it more trouble than it's worth? I've Googled for Flex game tutorials, and I haven't found a single one, which doesn't seem like a good sign...

Aleco
03-02-2008, 05:53 AM
Flex is used to built Rich Internet Applications. In this case, a game does not fall in that category. It is unreasonable to make a game in flex.

Jim Freer
03-02-2008, 03:21 PM
It would depend on the type of game. Some games could probably make good use of the the Rich components There are some traits of Flex that should be considered for any application. Even with the new Flex 3 feature, persistent framework caching, the resulting SWF file size can be very large. Also, depending on your requirements, the learning curve for Flex can be steep. It is true, simple things can be put together very quickly. You maybe able to find examples that match your needs to reduce the effort. However, once you step off the “path” be prepared to spend some time in areas that don't seem to be related to the logic of the game. As I said this is true for any application.

Jim Freer
http://freerpad.blogspot.com/

Cerin
03-02-2008, 04:09 PM
Flex is used to built Rich Internet Applications. In this case, a game does not fall in that category. It is unreasonable to make a game in flex.

How are you defining Rich Internet Application, and what about Flex makes it unsuitable for games? Something like a game, which has no page refreshes, sophisticated widgets, and real-time graphics, seems like the richest type of internet application.

Cerin
03-02-2008, 04:13 PM
It would depend on the type of game. Some games could probably make good use of the the Rich components There are some traits of Flex that should be considered for any application. Even with the new Flex 3 feature, persistent framework caching, the resulting SWF file size can be very large. Also, depending on your requirements, the learning curve for Flex can be steep. It is true, simple things can be put together very quickly. You maybe able to find examples that match your needs to reduce the effort. However, once you step off the “path” be prepared to spend some time in areas that don't seem to be related to the logic of the game. As I said this is true for any application.

Jim Freer
http://freerpad.blogspot.com/

My main interest in using Flex is to take advantage of the declarative nature of MXML. I've used XML-like markup (HTML, XUL, XAML, etc) to design user interfaces in the past and it's a huge productivity boost over creating the interface in a language like Actionscript. Is it possible to use MXML without Flex's other baggage?

Jim Freer
03-02-2008, 04:39 PM
Is it possible to use MXML without Flex's other baggage?

No and if you are concerned about the SWF file size, MXML produces a lot of code compared to using the Flex framework with pure ActionsScript.

Still this may not be a problem. I might consider developing a game in Flex just to quickly get the concept working. Then after that decide to use ActionScript without Flex or use Flash if necessary. This assumes you feel confident in Flex.

I left out another consideration that certain games may be more vulnerable to than other RIA apps. That is memory leak especially with the Flex components.

Jim Freer
http://freerpad.blogspot.com/

fnx
03-02-2008, 11:08 PM
My answer: YES :)

http://www.fnxgames.com/flash/soccernoid/soccernoid.html
http://www.fnxgames.com/flash/Copter/Copter.html

Well it depends on which kind of games you actually code but for casual
games it's a real killer!

dr_zeus
03-04-2008, 05:56 PM
Small Worlds (http://www.smallworlds.com/) was built in Flex. Take the tour to see some screenshots. It's currently in private beta, so not everyone can get in.

Cerin
04-14-2008, 06:26 AM
My answer: YES :)

http://www.fnxgames.com/flash/soccernoid/soccernoid.html
http://www.fnxgames.com/flash/Copter/Copter.html

Well it depends on which kind of games you actually code but for casual
games it's a real killer!

Wow, nice examples. Do you know of any examples that come with source code?

kahuja
04-14-2008, 09:09 AM
It is a personal choice, but Flex was built for developers coming from OO world who find Flash's timelive view a road-block. Now, what you do with the technology should not be a constraint.

I have not worked on Flash, but from my observations, you can use Flash and Flex interchangeably for any kind of application.