Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Balloonatroid - A PureMVC AS2/FlashLite Demo  (Read 11537 times)
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« on: January 01, 2008, 01:08:44 »

This demo illustrates the use of PureMVC with FlashLite 2.0 to implement an complete interactive mobile game.

The demo has historically been located here: http://trac.puremvc.org/Demo_AS2_FlashLite_Balloonatroid.
It has been moved here: https://github.com/PureMVC/puremvc-as2-demo-flashlite-balloonatroid/wiki

The authors are Cliff Hall and Chandima Cumaranatunge.
« Last Edit: August 03, 2012, 01:45:56 by puremvc » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: January 01, 2008, 02:04:11 »

I began working on this shortly after being delivered an AS2 Port of the framework by Pedr Browne. After getting the game concept, assets and initial working model up, the demo went on the back burner while other ports of the framework began showing up.

Enter Chandima. Co-author of ActionScript 3.0 Design Patterns by Oreilly Media, he also teaches at Hartford University and has an interest in game design. Chandima stepped up to take over the enormous remaining hurdles, not only in gameplay, but also in communication with the primitive MovieClips of FlashLite 2.0.

Here is a description of the state of the game as it was presented to Chandima:

This is done in FlashLite, 2.0, specifically for the mobile platform, but I also wanted to be able to embed it in a web page so you could play it there as well. So, the softkey labels are also buttons you can click, that broadcast the same notifications that softkeys on phone.

I'm not a big fan of killing things, so you could call this a 'low impact' shoot-em up. :)

The premise is that the big colorful rotating balloon at the bottom is your 'Shield'. Also you have a smaller 'Volley' balloon. You can move it left to right and volley it with the phone's left, right and center soft keys or by clicking corresponding buttons. You can still steer the Volley balloon after you've volleyed, just not as much as you could before.
 
Terrain scrolls underneath you and from the top of the screen 'Defenders' will come at you (this is sort of where I left off). These are tiny balloons of various shapes (all of them taken from actual photographs of hot air balloons).

When a Defender gets to the bottom of the screen and hits your shield, they should both realistically 'jiggle' and the defender bounces off screen, while your shield is nudged down ever so slightly. Maybe you get points for this since the defender was repelled, or maybe it takes away points since they drove you back. But your volley balloon is not shielded. You loose big points if they hit it before you volley. (Point strategy to be worked out...)

Eventually the 'Boss' who has been off screen emitting these defenders comes into view. He requires several direct hits on the balloon's basket to repel, and quite a few more if hit in other areas. In each case there is a jiggle and the Volley balloon bounces offscreen, unless the Boss was defeated, and they both do so and you've completed the level.

The Defenders and Bosses should both have either evasive motion, or at least dynamic motion ala Galaga to make it hard to hit them. Also, they are assets of the loaded level swf. Shooting for a mobile platform I was shooting to have the main game and the loaded level combined to be no more than 300k. In Flash CS3 the Nokia N95 simulator seems like the most likely to keep up with it in the real world. A lot of detailed graphics moving around is compute intensive. I could posterize everything, but the real look of the graphics are a big part of the feel of the game I believe.

Also, for quick play, the game would come up playing the first level by default, or last level you were on each time rather than choosing a level first. When you complete a level, you'd see a level/score screen and be able to choose to play the next level or any level you've been to before.

So as you can see there is a solid framework for the game in place already, but quite a lot of interesting bits to work out. I have some collision detection strategies worked out and actually tracing out good stuff to the console, but that's where I left off.

-=Cliff>
« Last Edit: January 01, 2008, 02:54:45 by puremvc » Logged
chandima
Port to AS2
Newbie
*
Posts: 4


View Profile Email
« Reply #2 on: March 20, 2008, 07:58:25 »

Just committed version 0.5. Game agent behavior is implemented using Finite State Machines (FSM). Functionality is the same as version 0.4 ( where Cliff left off ) with the addition of  boss and defender balloons.

FSM implementation is based on  Chapter 2 of the excellent book by Mat Buckland called  "Programming Game AI by Example". Excerpts here: http://www.ai-junkie.com/books/toc_pgaibe.html  The game, boss, volley and defender behavior logic is encapsulated within state objects.

Shield behavior is not implemented yet. Several states for the primary game agents are still not implemented. 

The dynamic heap memory footprint  is over the 2MB max on the target phone
(Nokia N95) and is currently at  about 2.6MB. You must increase the heap memory to at least this value in Adobe Device Central when testing the game on the N95 device profile.

Code is extensively documented. Lots left to do in terms of level design and gameplay. Ideas and suggestions are welcome.

- CC

« Last Edit: March 24, 2008, 09:08:45 by chandima » Logged
Bob
Newbie
*
Posts: 1


View Profile Email
« Reply #3 on: April 16, 2008, 12:34:42 »

FLA for the Balloonatroid demo should be saved with backward compatibility in mind.

The FLA project file was saved in Flash CS3. There are still many Flash users who haven't made the jump (and spent the $$$) to CS3.

Recommend saving to the lowest common denominator which is Flash 8 FLA project file.

Also, I believe that Flash 8 Professional is required to develop for Flash Lite 2. It might be useful to add this in the notes.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #4 on: April 16, 2008, 01:21:16 »

Not sure if the FLA will go backwards. We'll see.

-=Cliff>
Logged
Pages: [1]
Print