コード例 #1
0
        /// <summary>
        /// Creates the scene.
        /// </summary>
        /// <remarks>
        /// This method is called before all <see cref="T:WaveEngine.Framework.Entity" /> instances in this instance are initialized.
        /// </remarks>
        protected override void CreateScene()
        {
            Entity camera = new Entity()
                            .AddComponent(new Camera2D());

            EntityManager.Add(camera);

            this.RenderManager.RegisterLayerAfter(new ObstaclesLayer(this.RenderManager), DefaultLayers.Alpha);

            // Game Entities
            this.CreateBackground();
            this.CreateKite();
            this.CreateObstacles();

            this.crashEffect = EntitiesFactory.CreateCrashEffect();
            this.EntityManager.Add(this.crashEffect);

            // UI
            this.currentScoreTB = EntitiesFactory.CreateCurrentScore(40);
            this.EntityManager.Add(this.currentScoreTB);

#if DEBUG
            this.AddSceneBehavior(new DebugSceneBehavior(), SceneBehavior.Order.PreUpdate);
#endif
        }