about summary refs log tree commit diff stats
path: root/data/maps/the_great/rooms/Jubilant Entrance.txtpb
blob: b254cc09e923925b34efcb54a6a11a6a7b46ad5e (plain) (blame)
1
2
3
4
5
6
7
8
9
name: "Jubilant Entrance"
panel_display_name: "West Side"
ports {
  name: "JUBILANT"
  display_name: "Jubilant Entrance"
  path: "Meshes/Blocks/Warps/worldport12"
  destination { x: -62 y: 0 z: -19 }
  rotation: 90
}
lly Rauchenberger <fefferburbia@gmail.com> 2021-01-30 09:41:31 -0500 Encapsulated some player movement stuff' href='/tanetane/commit/src/sprite.h?id=410f971972bde37fb852420ea2ca0e2f69f27256'>410f971 ^
0334d39 ^
f316670 ^









0334d39 ^

f316670 ^

0334d39 ^
410f971 ^
de0ac29 ^
f316670 ^






0334d39 ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54


                         
              
                      

                      
                     
                   



              
                                                        




                            
                                           
 
                               
 
                                             
 
                                 
 









                                                                   

        

                         
                 
                      
              






                                            


                                                    
#ifndef SPRITE_H_70503825
#define SPRITE_H_70503825

#include <map>
#include <string_view>
#include <vector>
#include "direction.h"
#include "renderer.h"
#include "vector.h"

class Sprite {
public:

  Sprite(std::string_view filename, Renderer& renderer);

  int getTextureId() const {
    return textureId_;
  }

  const vec2i& loc() const { return loc_; }

  vec2i& loc() { return loc_; }

  const vec2i& size() const { return size_; }

  vec2i& size() { return size_; }

  int getFrame() const { return animations_[curAnim_][curFrame_]; }

  void setDirection(Direction dir);

  Direction getDirection() const { return curDir_; }

  void setWalking(bool walking);

  void tickAnim();

private:

  void updateAnimation();

  int textureId_;
  vec2i loc_ { 0, 0 };
  vec2i size_;
  Direction curDir_ = Direction::down;
  bool isWalking_ = false;
  int curAnim_ = 0;
  int curFrame_ = 0;
  std::vector<std::vector<int>> animations_;
  std::map<Direction, int> stillAnims_;
  std::map<Direction, int> walkingAnims_;
};

#endif /* end of include guard: SPRITE_H_70503825 */