summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTom Black <[email protected]>2015-11-12 01:31:59 -0500
committerTom Black <[email protected]>2015-11-12 01:31:59 -0500
commitdfe8e70159a3f2f47baceead173e55e9e29f91f7 (patch)
tree859be859d4cac6fc6d6a98148ae4091b260dbfee
parent4de778f34dd64b9f9580c683c6cc468cb888ef7c (diff)
downloadruby2d-dfe8e70159a3f2f47baceead173e55e9e29f91f7.tar.gz
ruby2d-dfe8e70159a3f2f47baceead173e55e9e29f91f7.zip
Moving examples to separate repo
-rw-r--r--examples/simple.rb13
-rw-r--r--examples/triangle.rb10
-rw-r--r--tests/input.rb (renamed from examples/input.rb)6
3 files changed, 5 insertions, 24 deletions
diff --git a/examples/simple.rb b/examples/simple.rb
deleted file mode 100644
index ca8e99f..0000000
--- a/examples/simple.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require 'ruby2d'
-
-# Set the window size
-set width: 300, height: 200
-
-# Create a new shape
-s = Square.new
-
-# Give it some color
-s.color = 'red'
-
-# Show the window
-show
diff --git a/examples/triangle.rb b/examples/triangle.rb
deleted file mode 100644
index 71f0bbf..0000000
--- a/examples/triangle.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require 'ruby2d'
-
-Triangle.new(320, 50, 540, 430, 100, 430,
-[
- [1.0, 0, 0, 1.0],
- [0, 1.0, 0, 1.0],
- [0, 0, 1.0, 1.0]
-])
-
-show
diff --git a/examples/input.rb b/tests/input.rb
index a39a29c..66de596 100644
--- a/examples/input.rb
+++ b/tests/input.rb
@@ -3,7 +3,11 @@ require 'ruby2d'
set width: 200, height: 100
on key: 'a' do
- puts "a pressed!"
+ puts "a key"
+end
+
+on key_down: 'p' do
+ puts "p key down"
end
show