From 874d934606ec24a5f3dae0b5f5a83e4ca5e563cf Mon Sep 17 00:00:00 2001 From: Cyberarm Date: Sun, 17 Feb 2019 21:22:40 -0600 Subject: [PATCH] Added README, rescue from missing demo file, add .gitignore. --- .gitignore | 1 + README.md | 15 +++++++++++++++ lib/states/game_states/game.rb | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e4b8799 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.dat \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..a8b0200 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# I-MIC FPS +An endeavor to create a multiplayer first-person-shooter in pure Ruby; Using C extensions only for Rendering, Sound, and Input. ([Gosu](https://libgosu.org) and [opengl-bindings](https://github.com/vaiorabbit/ruby-opengl/)) + +## Using +Requires a Ruby runtime that supports the gosu and opengl-bindings C-extensions (truffleruby 1.0.0-rc12 did not work when tested. Rubinus was not tested.) +* Clone or download this repo +* `bundle install` +* `bundle exec ruby i-mic-fps.rb [options]` + +### Options +* `--native` - Launch in fullscreen using primary displays resolution +* `--debug` - Set $debug variable to true (defaults to false) +* `--profile` - Run ruby-prof profiler +* `--savedemo` - Record camera movement and key events to playback later *(alpha-quality feature)* +* `--playdemo` - Plays the previously recorded demo *(alpha-quality feature)* \ No newline at end of file diff --git a/lib/states/game_states/game.rb b/lib/states/game_states/game.rb index 496f6fa..9aedc0e 100644 --- a/lib/states/game_states/game.rb +++ b/lib/states/game_states/game.rb @@ -31,7 +31,7 @@ class IMICFPS Light.new(x: 0, y: 100, z: 0, diffuse: Color.new(1.0, 0.5, 0.1), game_state: self) if ARGV.join.include?("--playdemo") - @demo_data = File.read("./demo.dat").lines + @demo_data = File.exist?("./demo.dat") ? File.read("./demo.dat").lines : "" @demo_index= 0 @demo_tick = 0