Пример #1
0
        public Gameworld(ContentHolder contentHolder)
        {
            this.contentHolder = contentHolder;
            risseObject = new Gameobject(contentHolder.texture_risse, new Vector2(100, 0), Vector2.Zero, 100, 192, 192);

            backgrounds.Add(new Gameobject(contentHolder.texture_background4, Vector2.Zero, new Vector2(-1, 0)));
            backgrounds.Add(new Gameobject(contentHolder.texture_background3, Vector2.Zero, new Vector2(-3, 0)));
            backgrounds.Add(new Gameobject(contentHolder.texture_background1, Vector2.Zero, new Vector2(-6, 0)));
            backgrounds.Add(new Gameobject(contentHolder.texture_background2, new Vector2(0,15), new Vector2(-8, 0)));

            //platforms.Add(new Gameobject(contentHolder.texture_platform, new Vector2(900, 500), new Vector2(-6,0)));

            background_fluff.Add(new Gameobject(contentHolder.texture_checkpoint, new Vector2(checkpointInterval, 560), new Vector2(-10, 0), 256, 256));
            platforms.Add(makePlatformSection(new Vector2(checkpointInterval, GROUNDHEIGHT), 0, 0));

            background_fluff[0].incrementCheckpoint += new Gameobject.EventHandler(increment);

            generateMap();
            generateObstacles();
            generatePlatforms();

            //ground = makePlatformSection(new Vector2(0, 670));

            //int platformWidth = contentHolder.texture_platform.Width;
            //for (int i = 0; i < NUMBEROFPLATFORMS; i++)
            //{
            //    ground.Add(new Gameobject(contentHolder.texture_platform, new Vector2(- contentHolder.texture_platform.Width + platformWidth, 688), new Vector2(-3, 0)));
            //    platformWidth += contentHolder.texture_platform.Width;
            //}

            //ground.Add(new Gameobject(contentHolder.texture_platform, new Vector2(1, 688), new Vector2(-3, 0)));
        }
Пример #2
0
        public Controller(Input input, SoundManager soundManager, ContentHolder contentHolder)
        {
            physicsEngine = new PhysicsEngine();

            this.contentHolder = contentHolder;

            this.soundManager = soundManager;
            input.jump += new Input.EventHandler(jump);
            input.duck += new Input.EventHandler(duck);

            soundManager.playSoundtrack();
        }
Пример #3
0
        public void updateFluff(Gameobject risse, ContentHolder contentHolder)
        {
            position += velocity;
            if (BoundingBox.Intersects(risse.BoundingBox))
            {

                if (!checkpointActivated)
                {
                    currentFrame = 1;
                    incrementCheckpoint((int)position.X);
                    contentHolder.sound_checkpoint.Play();
                    checkpointActivated = true;
                }
            }
            if (Position.X < -SpriteWidth)
            {
                Checkpoints = Checkpoints + 1;
                position.X += 4000;
                currentFrame = 0;
                checkpointActivated = false;
            }
            sourceRect = new Rectangle(currentFrame * spriteWidth, 0, spriteWidth, spriteHeight);
            origin = new Vector2(sourceRect.Width / 2, sourceRect.Height / 2);
        }
Пример #4
0
 protected override void Initialize()
 {
     // TODO: Add your initialization logic here
     input = new Input();
     contentHolder = new ContentHolder(Content);
     soundManager = new SoundManager(contentHolder);
     gameWorld = new Gameworld(contentHolder);
     controller = new Controller(input, soundManager, contentHolder);
     this.IsMouseVisible = true;
     base.Initialize();
 }
Пример #5
0
 public SoundManager(ContentHolder soundContent)
 {
     this.soundContent = soundContent;
 }