summaryrefslogtreecommitdiffhomepage
path: root/samples/22_trace_debugging_classes/app/main.rb
diff options
context:
space:
mode:
authorAmir Rajan <[email protected]>2020-09-11 02:02:01 -0500
committerAmir Rajan <[email protected]>2020-09-11 02:02:57 -0500
commit33ec37b141e896b47ed642923fd33b0c658ae9fb (patch)
treea40d3e5d41beeb06508200078f6f26b0ee57d6a4 /samples/22_trace_debugging_classes/app/main.rb
parent958cf43779d2bf528869e80511c4c4f2a433b2db (diff)
downloaddragonruby-game-toolkit-contrib-33ec37b141e896b47ed642923fd33b0c658ae9fb.tar.gz
dragonruby-game-toolkit-contrib-33ec37b141e896b47ed642923fd33b0c658ae9fb.zip
synced samples
Diffstat (limited to 'samples/22_trace_debugging_classes/app/main.rb')
-rw-r--r--samples/22_trace_debugging_classes/app/main.rb22
1 files changed, 0 insertions, 22 deletions
diff --git a/samples/22_trace_debugging_classes/app/main.rb b/samples/22_trace_debugging_classes/app/main.rb
deleted file mode 100644
index a6804ae..0000000
--- a/samples/22_trace_debugging_classes/app/main.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-class Foobar
- def initialize
- trace! # Trace is added to the constructor.
- end
-
- def clicky args
- return unless args.inputs.mouse.click
- try_rand rand
- end
-
- def try_rand num
- return if num < 0.9
- raise "Exception finally occurred. Take a look at logs/trace.txt #{num}."
- end
-end
-
-def tick args
- args.labels << [640, 360, "Start clicking. Eventually an exception will be thrown. Then look at logs/trace.txt.", 0, 1]
- args.state.foobar = Foobar.new if args.tick_count
- return unless args.state.foobar
- args.state.foobar.clicky args
-end