summaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2021-05-12 07:28:04 -0400
committerrealtradam <[email protected]>2021-05-12 07:28:04 -0400
commit57bd7ec9da14b3e7e338184568a273ce602e1557 (patch)
treea3c1ae9cb6f9faf321e9e6d9b9a9b8b46a652ead /app
parent3c15753682b6d005e597fcbe9f7299d9abc1254d (diff)
downloadtypemon-code-57bd7ec9da14b3e7e338184568a273ce602e1557.tar.gz
typemon-code-57bd7ec9da14b3e7e338184568a273ce602e1557.zip
testing the waters
Diffstat (limited to 'app')
l---------app/dragonruby1
-rw-r--r--app/main.rb4
-rw-r--r--app/sprites.rb28
3 files changed, 33 insertions, 0 deletions
diff --git a/app/dragonruby b/app/dragonruby
new file mode 120000
index 0000000..2e5d301
--- /dev/null
+++ b/app/dragonruby
@@ -0,0 +1 @@
+/home/tradam/Documents/Ruby/dragon/dragonruby-linux-amd64/dragonruby \ No newline at end of file
diff --git a/app/main.rb b/app/main.rb
index 0ebdc6b..d797a3e 100644
--- a/app/main.rb
+++ b/app/main.rb
@@ -1,6 +1,10 @@
+require 'app/sprites.rb'
def tick args
args.outputs.labels << [640, 500, 'Hello World!', 5, 1]
args.outputs.labels << [640, 460, 'Go to docs/docs.html and read it!', 5, 1]
args.outputs.labels << [640, 420, 'Join the Discord! http://discord.dragonruby.org', 5, 1]
args.outputs.sprites << [576, 280, 128, 101, 'dragonruby.png']
+ @render = Sprite.objects[1] if args.inputs.keyboard.key_held.a
+ @render = Sprite.objects[0] if args.inputs.keyboard.key_held.s
+ args.outputs.sprites << @render
end
diff --git a/app/sprites.rb b/app/sprites.rb
new file mode 100644
index 0000000..0016436
--- /dev/null
+++ b/app/sprites.rb
@@ -0,0 +1,28 @@
+class Sprite
+ class <<self
+ attr_reader :objects
+ end
+ @objects = []
+ @objects << {
+ x: 100,
+ y: 100,
+ w: 48,
+ h: 96,
+ path: 'sprites/non-free/Modern_Interiors/test.png',
+ source_x: 0,
+ source_y: 288,
+ source_w: 48,
+ source_h: 96
+ }
+ @objects << {
+ x: 100,
+ y: 100,
+ w: 48,
+ h: 96,
+ path: 'sprites/non-free/Modern_Interiors/test.png',
+ source_x: 48,
+ source_y: 288,
+ source_w: 48,
+ source_h: 96
+ }
+end