TraceRacer.WorldObject.addLine C# (CSharp) Method

addLine() public method

Adds a specific line to the end of the world.
public addLine ( int height ) : void
height int
return void
        public void addLine(int height)
        {
            lineQueue.Add(new WorldLine(height));
        }

Same methods

WorldObject::addLine ( int pos, int height ) : void

Usage Example

Esempio n. 1
0
        /// <summary>
        /// Load graphics content for the game.
        /// </summary>
        public override void Activate(bool instancePreserved)
        {
            if (!instancePreserved)
            {
                if (content == null)
                    content = new ContentManager(ScreenManager.Game.Services, "Content");

                List<Texture2D> textures = new List<Texture2D>();
                textures.Add(content.Load<Texture2D>("tex/star"));
                part = new ParticleEngine(textures, new Vector2(400, 240));

                world = new WorldObject(ScreenManager.Game, ScreenManager.SpriteBatch);

                // create worldline queue
                for (int i = 0; i < 800; i++)
                {
                    world.addLine(-1);
                }

                spriteManager = new SpriteManager(ScreenManager.Game, touchPosition, isPressed, world, part);
                ScreenManager.Game.Components.Add(spriteManager);
                Thread.Sleep(1000);

                ScreenManager.Game.ResetElapsedTime();
            }

#if WINDOWS_PHONE
            if (Microsoft.Phone.Shell.PhoneApplicationService.Current.State.ContainsKey("PlayerPosition"))
            {
                // playerPosition = (Vector2)Microsoft.Phone.Shell.PhoneApplicationService.Current.State["PlayerPosition"];
                // enemyPosition = (Vector2)Microsoft.Phone.Shell.PhoneApplicationService.Current.State["EnemyPosition"];
            }
        }