Exemplo n.º 1
0
        public Player(Vector2i spawnPos)
        {
            name = "Sara";
            visible = true;
            solid = true;
            trigger = false;
            this.spawnPos = spawnPos;

            position.X = (float)spawnPos.X * 16;
            position.Y = (float)spawnPos.Y * 16;

            health = 100;
            texture = new Texture("./assets/sara.png");
            playerSprite = new AnimatedSprite(texture, 100);
            playerSprite.Position = position;
            
            
            base.Initialize();

            playerSprite.setAnimation(walkingRight);
        }
Exemplo n.º 2
0
        public void Initialize(Vector2i spawnPos)
        {
            name = "npc";
            visible = true;
            solid = true;
            trigger = false;

            position.X = (float)spawnPos.X * 16;
            position.Y = (float)spawnPos.Y * 16;
            clock = new Stopwatch();
            clock.Start();

            talkCooldown = 1000;
            takesDamage = true;

            base.Initialize();

            npcSprite = new AnimatedSprite(texture, 100);
            npcSprite.Position = position;
            npcSprite.setAnimation(walkingRight);
            
            orientation = Direction.Down;
        }