Ejemplo n.º 1
0
        public TestObstacle(World manager, GameObject parent) : base(manager, parent)
        {
            Texture2D         multiTexture = ResourceLoader.LoadTexture2D(manager.GraphicsDevice, "character", "Content/character.png");
            SpiriteComponent  spirite      = new SpiriteComponent(multiTexture, this, new Rectangle(112, 0, 16, 16));
            ColliderComponent collider     = new ColliderComponent(this, new Vector2(0, 0), new Vector2(16, 16));

            collider.Collider.IsRigid = true;
        }
Ejemplo n.º 2
0
        public Bullet(World manager, GameObject parent, Vector2 direction, Vector2 position, float rotation) : base(manager, parent)
        {
            MoveDirectScript moveDirectScript = new MoveDirectScript(this, 1000, direction, rotation, 1);
            Texture2D        texture          = ResourceLoader.LoadTexture2D(manager.GraphicsDevice, "bullet", "Content/bullet.png");
            SpiriteComponent spirite          = new SpiriteComponent(texture, this);

            ColliderComponent collider = new ColliderComponent(this, new Vector2(0, 0), new Vector2(16, 16));

            collider.Collider.IsRigid = true;
            Scale    = new Vector2(0.1f, 0.1f);
            Position = position;
            Rotation = rotation;
        }