summaryrefslogtreecommitdiffhomepage
path: root/src/components/player.rb
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2022-01-22 06:43:20 -0500
committerrealtradam <[email protected]>2022-01-22 06:43:20 -0500
commit943bffc40953b95e9d07aeda0b4b87ac7be848fd (patch)
treeb255b8ead8b3892d47cb25d45f82df3a5a3c1a1e /src/components/player.rb
parent23c419f485532689b41fdbf67b5aa3eb4ae05b70 (diff)
downloadorc-arena-of-time-943bffc40953b95e9d07aeda0b4b87ac7be848fd.tar.gz
orc-arena-of-time-943bffc40953b95e9d07aeda0b4b87ac7be848fd.zip
init
Diffstat (limited to 'src/components/player.rb')
-rw-r--r--src/components/player.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/components/player.rb b/src/components/player.rb
new file mode 100644
index 0000000..1a6e9b6
--- /dev/null
+++ b/src/components/player.rb
@@ -0,0 +1,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)))
+
+
+