Esempio n. 1
0
        public Character(GameScreen screen, float width, float height)
            : base(screen, width, height)
        {
            PhysicsBody.Body.BodyType = BodyType.Dynamic;

            PhysicsBody.OnCollision += onCollision;
            PhysicsBody.OnSeparation += onSeperation;

            //initialize the particle effect
            dustKickUpParticle = new ParticleEntity(screen, "Dust");
            screen.addObject(dustKickUpParticle);
            timeTillEndJumpAnim = 0;
            timeTillEndJumpPrep = 0;
        }
Esempio n. 2
0
        public GameScreen(AbyssGame game)
        {
            Game = game;
            world = new World(new Vector2(0, GRAVITY));
            UnitConverter.SetDisplayUnitToSimUnitRatio(PIXELS_PER_METER);
            Camera = new FarseerCamera(ref AbyssGame.spriteBatch, AbyssGame.Assets, Game.GraphicsDevice,
                AbyssGame.ScreenWidth, AbyssGame.ScreenHeight, ref world, PIXELS_PER_METER);
            Camera.viewMode = FarseerCamera.ViewMode.Scroll;

            GameObjects = new List<GameObject>(5); //probably a good starting number

            SpawnController = new SpawnController(this);

            Camera.subjetDistanceToScreenEdge = 700;

            explosionParticleEffect = new ParticleEntity(this, "BasicFireball");
            addObject(explosionParticleEffect);

            osd = new OSD();
            osd.LoadContent();

            rt = new RenderTarget2D(Game.GraphicsDevice, Game.GraphicsDevice.PresentationParameters.BackBufferWidth,
                Game.GraphicsDevice.PresentationParameters.BackBufferHeight);
        }