summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2022-01-20 05:35:21 -0500
committerrealtradam <[email protected]>2022-01-20 05:35:21 -0500
commite45a93074586de2babdc9761cb02e60f96065894 (patch)
tree4442c431bd9a659a2004c8202883540c257b98a1
parent3b8a8399cb176f6e8bbd564384cb49e331699655 (diff)
downloadFelFlameEngine-e45a93074586de2babdc9761cb02e60f96065894.tar.gz
FelFlameEngine-e45a93074586de2babdc9761cb02e60f96065894.zip
new input methods
-rw-r--r--Rakefile2
-rw-r--r--game/assets/PauseChamp.pngbin0 -> 17196 bytes
-rw-r--r--game/main.rb94
m---------mruby0
-rw-r--r--vendor/lib/tux/mruby/libmruby.abin8029504 -> 8111320 bytes
-rw-r--r--vendor/lib/web/mruby/libmruby.abin1354972 -> 1354002 bytes
6 files changed, 93 insertions, 3 deletions
diff --git a/Rakefile b/Rakefile
index cad455f..0922c64 100644
--- a/Rakefile
+++ b/Rakefile
@@ -18,7 +18,7 @@ namespace :build do
system('env MRUBY_CONFIG=build_config/felflame_linux.rb rake')
FileUtils.cp("build/web/lib/libmruby.a", "../vendor/lib/web/mruby/")
FileUtils.cp("build/host/lib/libmruby.a", "../vendor/lib/tux/mruby/")
- FileUtils.cp("build/win/lib/libmruby.a", "../vendor/lib/win/mruby/")
+ #FileUtils.cp("build/win/lib/libmruby.a", "../vendor/lib/win/mruby/")
end
end
#desc 'Export to single file'
diff --git a/game/assets/PauseChamp.png b/game/assets/PauseChamp.png
new file mode 100644
index 0000000..a5675f8
--- /dev/null
+++ b/game/assets/PauseChamp.png
Binary files differ
diff --git a/game/main.rb b/game/main.rb
index 37c8207..0ea5d7c 100644
--- a/game/main.rb
+++ b/game/main.rb
@@ -1,2 +1,92 @@
-require 'lib/hello.rb'
-Raylib.init_window(1000, 300, "poggies")
+text = "Our poggies game engine :^)"
+
+Rl.init_window(600, 600, text)
+
+Rl.target_fps = 60
+color = Rl::Color.new(200,50,50,255)
+white = Rl::Color.new(255,255,255,255)
+
+pause_champ = Rl::Texture.new("./assets/PauseChamp.png")
+
+y = 10
+spaceing = 25
+font_size = 30
+
+Rl.while_window_open do
+ result_x = (Math.cos(Rl.time*2) * 100) + 250
+ result_y = (Math.sin(Rl.time*2) * 100) + 250
+
+ unless Rl.keys_pressed.empty?
+ puts Rl.keys_pressed.to_s
+ end
+
+ Rl.begin_drawing
+ Rl.clear_background
+
+ if Rl.is_key_up? 87
+ # Draw moving pausechamp face
+ Rl.draw_texture(
+ texture: pause_champ,
+ x: result_x - 100,
+ y: result_y + 200 - 140
+ )
+ end
+
+ Rl.draw_text(
+ text: "mouse wheel:#{Rl.mouse_wheel}",
+ x: 350,
+ y: y + (spaceing*2),
+ font_size: font_size,
+ color: color
+ )
+
+ Rl.draw_text(
+ text: "mouse x: #{Rl.mouse_x}",
+ x: 350,
+ y: y,
+ font_size: font_size,
+ color: color
+ )
+
+ Rl.draw_text(
+ text: "mouse y: #{Rl.mouse_y}",
+ x: 350,
+ y: y + spaceing,
+ font_size: font_size,
+ color: color
+ )
+
+ # Draw moving text
+ Rl.draw_text(
+ text: text,
+ x: result_x - 120,
+ y: result_y + 200,
+ font_size: 25,
+ color: color
+ )
+
+ # Draw Fps
+ Rl.draw_text(
+ text: "FPS: #{Rl.fps.to_s}",
+ x: 10,
+ y: y,
+ font_size: font_size,
+ color: color
+ )
+
+ # Draw Frametime
+ Rl.draw_text(
+ text: "Frametime: #{"%.4f" % Rl.frame_time}",
+ x: 10,
+ y: y + spaceing,
+ font_size: font_size,
+ color: color
+ )
+
+ # Draw Elapse Time
+ Rl.draw_text(
+ text: "Elapsed Time: #{"%.2f" % Rl.time}",
+ x: 10, y: y + (spaceing * 2), font_size: font_size, color: color)
+
+ Rl.end_drawing
+end
diff --git a/mruby b/mruby
-Subproject ba4a056d9b45154937fd2455b5d2579abbbdc50
+Subproject 0dd88eedbe1fca776c14c7cd6ef9503c7700b0c
diff --git a/vendor/lib/tux/mruby/libmruby.a b/vendor/lib/tux/mruby/libmruby.a
index b73f5cd..253306d 100644
--- a/vendor/lib/tux/mruby/libmruby.a
+++ b/vendor/lib/tux/mruby/libmruby.a
Binary files differ
diff --git a/vendor/lib/web/mruby/libmruby.a b/vendor/lib/web/mruby/libmruby.a
index 4909ad4..fa743bf 100644
--- a/vendor/lib/web/mruby/libmruby.a
+++ b/vendor/lib/web/mruby/libmruby.a
Binary files differ