Esempio n. 1
0
        // Constructor
        public HUD(AssetPack assets)
        {
            // Get bitmaps
            bmpFont  = assets.GetBitmap("font");
            bmpGuide = assets.GetBitmap("guide");

            guideTimer = GUIDE_TIME;
        }
Esempio n. 2
0
        // Initialize global content
        static public void Init(AssetPack assets)
        {
            bmpFont = assets.GetBitmap("font");

            sSelect = assets.GetSample("select");
            sAccept = assets.GetSample("accept");
        }
Esempio n. 3
0
        // Initialize global content
        static public void Init(AssetPack assets, AudioManager audio)
        {
            // Bitmaps
            bmpEnemy = assets.GetBitmap("enemy");
            // Samples
            sThwomp = assets.GetSample("thwomp");

            Enemy.audio = audio;
        }
        // Constructor
        public Spiral(AssetPack assets)
        {
            bmpSpiral = assets.GetBitmap("spiral");

            exist = false;
            scale = 1.0f;
            angle = 0.0f;
            pos   = Vector2.Zero;
        }
        // Initialize
        public override void Init()
        {
            // Get global components
            Global    gs     = (Global)globalScene;
            AssetPack assets = gs.GetAssets();

            trans = gs.GetTransition();

            // Get assets
            bmpFont = assets.GetBitmap("font");
            sAccept = assets.GetSample("accept");

            timeString = "";
        }
Esempio n. 6
0
        // Constructor
        public Stage(AssetPack assets, bool shallow = false)
        {
            if (!shallow)
            {
                // Get maps
                Tilemap m;
                maps = new List <Tilemap>();
                int index = 0;
                while ((m = assets.GetTilemap((index++).ToString())) != null)
                {
                    maps.Add(m);
                    mapHeight += m.GetHeight() * TILE_SIZE;
                }
                checkpoints = new List <Vector2>();

                // Compute y translation
                transY = -maps[0].GetHeight() * TILE_SIZE;

                // Get bitmaps
                bmpTileset = assets.GetBitmap("tileset");
                bmpWater   = assets.GetBitmap("water");
            }

            // Get background bitmaps
            bmpCloud = assets.GetBitmap("cloud");
            bmpSky   = assets.GetBitmap("sky");


            // Create cloud positions
            cloudPos = new float[3];
            int xoff = CLOUD_WIDTH / 3;

            for (int i = 0; i < 3; ++i)
            {
                cloudPos[i] += i * xoff;
            }
        }
 // Initialize global content
 static public void Init(AssetPack assets)
 {
     bmpBody = assets.GetBitmap("body");
 }
Esempio n. 8
0
 // Initialize global content
 public static void Init(AssetPack assets)
 {
     bmpStar = assets.GetBitmap("star");
 }
Esempio n. 9
0
        // Initialize
        public override void Init()
        {
            const float FADE_SPEED = 1.0f;

            // Get global components
            Global    gs     = (Global)globalScene;
            AssetPack assets = gs.GetAssets();

            trans = gs.GetTransition();

            // Get assets
            bmpFont    = assets.GetBitmap("font");
            bmpLogo    = assets.GetBitmap("logo");
            bmpIntro   = assets.GetBitmap("intro");
            sPause     = assets.GetSample("pause");
            sMenuMusic = assets.GetSample("menu");

            // Create a "shallow" stage
            stage = new Stage(assets, true);

            // Create menu
            menu = new Menu(
                new String[]
            {
                "Play Game",
                "Settings",
                "Quit"
            },
                new Menu.Callback[]
            {
                // Resume
                delegate(Object self)
                {
                    changingToGame = true;

                    // Fade out music
                    audio.FadeCurrentLoopedSample(500, 0.0f);

                    // Change to game
                    trans.Activate(Transition.Mode.In, 2.0f, delegate {
                        sceneMan.ChangeScene("game");
                    });
                },
                // Settings
                delegate(Object self)
                {
                    settings.Activate(true);
                },
                // Quit
                delegate(Object self)
                {
                    changingToGame = false;
                    // Quit
                    trans.Activate(Transition.Mode.In, 2.0f, eventMan.Terminate);
                },
            }
                );

            // Create "settings"
            settings = new Pause(this);

            // Set some default values
            scale      = 1.0f;
            phase      = -1;
            alphaTimer = (float)Math.PI / 2.0f;

            // Fade out
            trans.Activate(Transition.Mode.Out, FADE_SPEED, null);
        }
Esempio n. 10
0
 // Initialize global content
 static public void Init(AssetPack assets)
 {
     bmpTongue = assets.GetBitmap("tongue");
 }