diff options
| author | realtradam <[email protected]> | 2022-01-20 05:35:21 -0500 |
|---|---|---|
| committer | realtradam <[email protected]> | 2022-01-20 05:35:21 -0500 |
| commit | e45a93074586de2babdc9761cb02e60f96065894 (patch) | |
| tree | 4442c431bd9a659a2004c8202883540c257b98a1 | |
| parent | 3b8a8399cb176f6e8bbd564384cb49e331699655 (diff) | |
| download | FelFlameEngine-e45a93074586de2babdc9761cb02e60f96065894.tar.gz FelFlameEngine-e45a93074586de2babdc9761cb02e60f96065894.zip | |
new input methods
| -rw-r--r-- | Rakefile | 2 | ||||
| -rw-r--r-- | game/assets/PauseChamp.png | bin | 0 -> 17196 bytes | |||
| -rw-r--r-- | game/main.rb | 94 | ||||
| m--------- | mruby | 0 | ||||
| -rw-r--r-- | vendor/lib/tux/mruby/libmruby.a | bin | 8029504 -> 8111320 bytes | |||
| -rw-r--r-- | vendor/lib/web/mruby/libmruby.a | bin | 1354972 -> 1354002 bytes |
6 files changed, 93 insertions, 3 deletions
@@ -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 Binary files differnew file mode 100644 index 0000000..a5675f8 --- /dev/null +++ b/game/assets/PauseChamp.png 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 Binary files differindex b73f5cd..253306d 100644 --- a/vendor/lib/tux/mruby/libmruby.a +++ b/vendor/lib/tux/mruby/libmruby.a diff --git a/vendor/lib/web/mruby/libmruby.a b/vendor/lib/web/mruby/libmruby.a Binary files differindex 4909ad4..fa743bf 100644 --- a/vendor/lib/web/mruby/libmruby.a +++ b/vendor/lib/web/mruby/libmruby.a |
