summaryrefslogtreecommitdiffhomepage
path: root/run.rb
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2021-05-04 01:10:27 -0400
committerrealtradam <[email protected]>2021-05-04 01:10:27 -0400
commite99176e14a5a5b8c46bba0591010f7e55c535981 (patch)
tree538f21932b9e7e898907943d404dd46fed999905 /run.rb
downloadtileset-map-editor-e99176e14a5a5b8c46bba0591010f7e55c535981.tar.gz
tileset-map-editor-e99176e14a5a5b8c46bba0591010f7e55c535981.zip
init
Diffstat (limited to 'run.rb')
-rw-r--r--run.rb51
1 files changed, 51 insertions, 0 deletions
diff --git a/run.rb b/run.rb
new file mode 100644
index 0000000..2c30699
--- /dev/null
+++ b/run.rb
@@ -0,0 +1,51 @@
+# frozen_string_literal: true
+
+require 'ruby2d'
+require_relative 'lib/camera/camera'
+require_relative 'tileset'
+
+@eks = 0
+@why = 0
+
+on :key_down do |event|
+ if event.key == 'w'
+ @why -= 1
+ @why %= 13
+ end
+ if event.key == 's'
+ @why += 1
+ @why %= 13
+ end
+ if event.key == 'a'
+ @eks -= 1
+ @eks %= 23
+ end
+ if event.key == 'd'
+ @eks += 1
+ @eks %= 23
+ end
+end
+@test = Sprite.new('./Monster02.png',
+ clip_width: 48,
+ clip_height: 48,
+ width: 100,
+ height: 100,
+ x: 0,
+ y: 0,
+ loop: true)
+@test2 = Sprite.new('./Monster02-RGB.png',
+ clip_width: 48,
+ clip_height: 48,
+ width: 100,
+ height: 100,
+ x: 100,
+ y: 0,
+ loop: true)
+update do
+ #Camera << Image.new(Tileset.get[@eks][@why])
+ #Camera.redraw
+end
+
+show