Recent posts by EcoWarrior on Kongregate

Flag Post

Topic: Game Programming / What architecture for a menu screen with graphical buttons?

Thanks for the tips DeepClaw.
I may do as you advise, especially for the XML: it’ll be a much more comfortable to have all data in just one single file.
My point about not extending SimpleButton is that it’s not a DisplayObject itself, but as it handles DisplayObjects transparently I understand there would be no prob to extend it and upgrade (if necessary) the way it uses DisplayObjects.
As for reading an XML, I never did that, but it will be a good opportunity to learn. :)

 
Flag Post

Topic: Game Programming / What architecture for a menu screen with graphical buttons?

Hello game developers,

I am coding my first Flash game in AS3, thus I sometimes feel like I face some rookie-exclusive issues… And the current one is about making menu screens with buttons: more specifically, a “shop” pannel with several choosable power-ups, represented by different-looking buttons the player can click (or highlight-select with keyboad, if I have the time to implement it). All buttons will have specific visuals for each standard button state (default, focus, clicked) and will behave similarly: mouse-over will display a description of the power-up, and click will choose this power-up. Then a confirmation dialog-box displays and if the player validates her choice, the game exits the shop.

My concern is how to organise all this, in terms of classes, communication between objects, and clip creations. I have searched in this forum and a few other places but haven’t chanced on something useful (so, sorry if I missed something I should have read before posting).

My plan so far is to make a base ‘PowerupButton’ class (extending MovieClip) for buttons that would hold most of button behavior. To ease setting up the visual layout, I would create the shop pannel and every button in CS3: the pannel symbol would contain buttons symbols (MovieClip). The pannel would be of class ‘Shop’ extending Sprite, and I’d give a specific class name to each button, which would be a subclass of ‘PowerupButton’. These specific subclasses would be very simple, with no methods and only a few properties, like the description text and the power-up value. ‘Shop’ object would listen to MouseEvents on buttons (MOUSE_OVER, CLICK), get properties from the button highlighted or selected, and display text or confirmation box…

As you can see, I don’t plan on making much use of events; nor creating ‘Button’ symbols in CS3 and using flash.display.SimpleButton, since I would need to override it – but I am still reticent to override classes from standard packages. I would not extend fl.controls.Button class either: indeed, as interactive buttons are basic entities, I think building it from scratch would spare me time and issues. But maybe I’m wrong… And all these specific subclasses I will need to handle bug me.

What do you think of this plan? Would you consider/recommend alternatives?
According to your experience on the subject or knowledge in AS3, is there a ‘best practice’/universally spread way for creating menu screens in Flash?

Many thanx

 
Flag Post

Topic: Kongregate / Argue Beta Testers

Sign me in as well! :)