I’m in : Update

Posted by (twitter: @wademcgillis)
August 18th, 2011 4:15 pm

I have officially decided that I will be using AS3 to make my game.

Programming Language/Library: AS3/Flashpunk
Sound: SFXR (and maybe Autotracker-C & Schism)
Art: MsPaint & Paint.NET & Game Maker 8
Timelapse: Chronolapse

This is my “base code”, and like LD20, it’s basically just a main class:

package
{
    import flash.events.*;
    import net.flashpunk.Engine;
    import net.flashpunk.FP;

    public class Main extends Engine
    {
        //[Embed(source = 'FILENAME')]
        //public const VARIABLE:Class;

        private static var focused:Boolean;

        public function Main()
        {
            super(640, 480, 32, true);
        }

        private function mouseClick(e:Event):void
        {
            FP.stage.removeEventListener(MouseEvent.MOUSE_DOWN, mouseClick);
            FP.stage.addEventListener(Event.ACTIVATE, focusGain);
            FP.stage.addEventListener(Event.DEACTIVATE, focusLost);
            focusGain();
        }

        private function focusGain(e:Event = null):void
        {
            focused = true;
        }

        private function focusLost(e:Event = null):void
        {
            focused = false;
        }

        public static function isFocused():Boolean
        {
            return focused;
        }

        override public function init():void
        {
            super.init();
            FP.stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseClick);
        }
    }
}

Tags: , , ,


Leave a Reply

You must be logged in to post a comment.

[cache: storing page]