Exemplo n.º 1
0
Arquivo: Shot.cpp Projeto: Zylann/Grid
    Shot::Shot(int shooterID, int ID) : Entity(ID)
    {
        name = "shot";
        m_shooterID = shooterID;

        Physics * phys = new Physics();
        phys->setNoClip(true);
        phys->setNotifyCollisions(true);
        addComponent(phys);

        const sf::Image & shotImg = resources::getImage("shot");

        RenderImage * r = new RenderImage(RP_EFFECTS, shotImg);
        r->setBlendMode(sf::Blend::Add);
        r->setColor(sf::Color(255, 255, 32));

        setBoundingBox(new AxisAlignedBB(-0.01, -0.01, 0.01, 0.01));

        setRenderer(r);

        scale = 0.5;
    }