summaryrefslogtreecommitdiffhomepage
path: root/src/components/player.rb
blob: 1a6e9b63b2ed7bf2ec07deb35c9a631c431e4d6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FECS::Cmp.new('Player')
FECS::Cmp.new('Velocity', x: 0, y: 0)
FECS::Cmp.new('Position', x: 0, y: 0)
FECS::Cmp.new('Sprite',
              :texture,
              :origin,
              :source_rect,
              :dest_rect,
              :rotation)
FECS::Cmp.new('Hp', value: 0)

@player = FECS::Ent.new(FECS::Cmp::Player.new,
                        FECS::Cmp::Position.new,
                        FECS::Cmp::Velocity.new,
                        FECS::Cmp::Sprite.new(
                          texture: Rl::Texture.new('./assets/lancelot_.png'),
                          source_rect: Rl::Rectangle.new(0,0,24,24),
                          dest_rect: Rl::Rectangle.new(0,0,48,48)))