summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2021-01-19 19:40:02 -0500
committerrealtradam <[email protected]>2021-01-19 19:40:02 -0500
commitba1392414af9c18779c386af4f67325c546d9025 (patch)
tree19e29b7f57367b5afcfb5d79bd28de09752c9c45
parent5f9ad4e95625e1152bd0ad8bda1a460b696a7d13 (diff)
downloadruby2d-camera-ba1392414af9c18779c386af4f67325c546d9025.tar.gz
ruby2d-camera-ba1392414af9c18779c386af4f67325c546d9025.zip
improved documentation
-rw-r--r--README.md10
-rw-r--r--run.rb6
2 files changed, 14 insertions, 2 deletions
diff --git a/README.md b/README.md
index 31a4f2a..80ab1ed 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,13 @@
# Ruby2D Camera Demo
+Controls:
+
+WASD to move character
+IJKL to switch camera into manual mode, and to move it around
+F to switch camera back into follow mode
+
+---
+
I wanted to make a proof of concept to see how feasible it is to implement a camera system in Ruby2D. Turns out it is very feasible :D
How it works:
@@ -9,3 +17,5 @@ If you want to use this little demo in your own projects feel free to do so! All
See the code as an example for how it is used.
Credit is appreciated but not required :)
+
+
diff --git a/run.rb b/run.rb
index 7ebb914..daca24e 100644
--- a/run.rb
+++ b/run.rb
@@ -10,7 +10,8 @@ require_relative 'animator'
Camera << @background
Camera.add @player
-# This controls how fast the camera will follow an object
+# This controls how slowly the camera will follow an object
+# Set to 1 to not have any elasticity
# it is not used by the .move_to or .move_by
Camera.elasticity = 10
@@ -80,7 +81,8 @@ update do
square.update Camera.camera_position
end
-
+
+ # Alternating between follow and manual control
if @is_follow
Camera.follow @player
else