Now have a basic sprite system that uses SFML's sprites, but the algorithm for determining how much of a sprite to display is wrong. Need to use the alternate algorithm from LODE's tutorial that draws sprites after rendering.
This commit is contained in:
parent
024d5b30e1
commit
da7075864b
6 changed files with 38 additions and 36 deletions
|
@ -28,6 +28,11 @@ void TexturePack::load_textures() {
|
|||
|
||||
floor = load_image(assets["floor"]);
|
||||
ceiling = load_image(assets["ceiling"]);
|
||||
|
||||
sf::Texture* sprite_texture = new sf::Texture("assets/undead_peasant-256.png");
|
||||
sf::Sprite* sf_sprite = new sf::Sprite(*sprite_texture);
|
||||
|
||||
sprites.push_back({4.0, 3.55, 6, sf_sprite, sprite_texture});
|
||||
}
|
||||
|
||||
Image& TexturePack::get_texture(size_t num) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue