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

Show Posts

| * |

  Show Posts
Pages: [1]
1  Announcements and General Discussion / Getting Started / Making a Flash Game using PureMVC on: August 14, 2007, 04:51:23
Hi, I'm trying to turn the HelloFlash demo into a game demo, but I'm not sure about the best way to go about things.

What would be the proper way to make it so the sprites in the HelloFlash demo collide into one another?
How about making it so they have a life span and destroy themselves and free up their used memory?

I'd like to change a tank game demo that I have so it fits into the PureMVC framework.  How would I make the tank's turret follow the mouse and the base move based on keyboard commands?

What about when the tank fires a bullet?  My guess is it would send a notification to a command object that would create the appropriate bullet model and view.  Then, when the bullet collides with something, it would send a notification to another command to have it destroyed?  Or would it be better to have a bullet manager that handles the bullet creation/destruction internally?

For basic AI, I guess there would be a macro command that controls basic commands to do things like move, aim and fire at the player?

As I think of more things to add, I realize I will need to add other design patterns to handle creating complex objects and manipulating complex display objects.  How would you incorporate factories or builders and composite views?

Also, I can see the stage mediator getting connected to many parts of the system.  How would I abstract it?  Maybe turn some commands into a strategy pattern so the stage mediator only adds and removes objects and sends out keyboard and mouse events to a small collection of macro commands that pass them on to handlers that modify the proper proxies?

I want to do these things the right way now so when my tank has a dozen different weapons and walks on 6 legs and can climb over some things but not others, but it can use a rocket pack to fly or jump over walls or whatever, my new game engine will be able to create a totally different type of game while reusing most of the code.

Any help is most appreciated.

Thanks,
David Cabiness
Pages: [1]