diff options
Diffstat (limited to 'docs/docs.txt')
| -rw-r--r-- | docs/docs.txt | 79 |
1 files changed, 75 insertions, 4 deletions
diff --git a/docs/docs.txt b/docs/docs.txt index c07fbcd..d6f5def 100644 --- a/docs/docs.txt +++ b/docs/docs.txt @@ -6800,7 +6800,7 @@ Follows is a source code listing for all files that have been open sourced. This def calc_below return unless player.dy <= 0 - tiles_below = find_tiles { |t| t.rect.top <= player.y } + tiles_below = find_tiles { |t| t.rect.top <= player.prev_rect.y } collision = find_colliding_tile tiles_below, (player.rect.merge y: player.next_rect.y) return unless collision if collision.neighbors.b == :none && player.jumped_down_at.elapsed_time < 10 @@ -6831,7 +6831,7 @@ Follows is a source code listing for all files that have been open sourced. This def calc_above return unless player.dy > 0 - tiles_above = find_tiles { |t| t.rect.y >= player.y } + tiles_above = find_tiles { |t| t.rect.y >= player.prev_rect.y } collision = find_colliding_tile tiles_above, (player.rect.merge y: player.next_rect.y) return unless collision return if collision.neighbors.t == :none @@ -13755,6 +13755,59 @@ Follows is a source code listing for all files that have been open sourced. This #+end_src +*** Advanced Rendering - Render Target Noclear - main.rb +#+begin_src ruby + # ./samples/07_advanced_rendering/11_render_target_noclear/app/main.rb + def tick args + args.state.x ||= 500 + args.state.y ||= 350 + args.state.xinc ||= 7 + args.state.yinc ||= 7 + args.state.bgcolor ||= 1 + args.state.bginc ||= 1 + + # clear the render target on the first tick, and then never again. Draw + # another box to it every tick, accumulating over time. + clear_target = (args.state.tick_count == 0) || (args.inputs.keyboard.key_down.space) + args.render_target(:accumulation).background_color = [ 0, 0, 0, 0 ]; + args.render_target(:accumulation).clear_before_render = clear_target + args.render_target(:accumulation).solids << [args.state.x, args.state.y, 25, 25, 255, 0, 0, 255]; + args.state.x += args.state.xinc + args.state.y += args.state.yinc + args.state.bgcolor += args.state.bginc + + # animation upkeep...change where we draw the next box and what color the + # window background will be. + if args.state.xinc > 0 && args.state.x >= 1280 + args.state.xinc = -7 + elsif args.state.xinc < 0 && args.state.x < 0 + args.state.xinc = 7 + end + + if args.state.yinc > 0 && args.state.y >= 720 + args.state.yinc = -7 + elsif args.state.yinc < 0 && args.state.y < 0 + args.state.yinc = 7 + end + + if args.state.bginc > 0 && args.state.bgcolor >= 255 + args.state.bginc = -1 + elsif args.state.bginc < 0 && args.state.bgcolor <= 0 + args.state.bginc = 1 + end + + # clear the screen to a shade of blue and draw the render target, which + # is not clearing every frame, on top of it. Note that you can NOT opt to + # skip clearing the screen, only render targets. The screen clears every + # frame; double-buffering would prevent correct updates between frames. + args.outputs.background_color = [ 0, 0, args.state.bgcolor, 255 ] + args.outputs.sprites << [ 0, 0, 1280, 720, :accumulation ] + end + + $gtk.reset + +#+end_src + *** Tweening Lerping Easing Functions - Easing Functions - main.rb #+begin_src ruby # ./samples/08_tweening_lerping_easing_functions/01_easing_functions/app/main.rb @@ -37561,6 +37614,7 @@ Follows is a source code listing for all files that have been open sourced. This *** attr_sprite.rb #+begin_src ruby # ./dragon/attr_sprite.rb + # coding: utf-8 # Copyright 2019 DragonRuby LLC # MIT License # attr_sprite.rb has been released under MIT (*only this file*). @@ -37624,6 +37678,7 @@ Follows is a source code listing for all files that have been open sourced. This *** console.rb #+begin_src ruby # ./dragon/console.rb + # coding: utf-8 # Copyright 2019 DragonRuby LLC # MIT License # console.rb has been released under MIT (*only this file*). @@ -38439,6 +38494,7 @@ Follows is a source code listing for all files that have been open sourced. This *** console_color.rb #+begin_src ruby # ./dragon/console_color.rb + # coding: utf-8 # Copyright 2019 DragonRuby LLC # MIT License # console_color.rb has been released under MIT (*only this file*). @@ -38479,6 +38535,7 @@ Follows is a source code listing for all files that have been open sourced. This *** console_font_style.rb #+begin_src ruby # ./dragon/console_font_style.rb + # coding: utf-8 # Copyright 2019 DragonRuby LLC # MIT License # console_font_style.rb has been released under MIT (*only this file*). @@ -38525,6 +38582,7 @@ Follows is a source code listing for all files that have been open sourced. This *** console_menu.rb #+begin_src ruby # ./dragon/console_menu.rb + # coding: utf-8 # Copyright 2019 DragonRuby LLC # MIT License # console_menu.rb has been released under MIT (*only this file*). @@ -38691,6 +38749,7 @@ Follows is a source code listing for all files that have been open sourced. This *** console_prompt.rb #+begin_src ruby # ./dragon/console_prompt.rb + # coding: utf-8 # Copyright 2019 DragonRuby LLC # MIT License # console_prompt.rb has been released under MIT (*only this file*). @@ -41338,11 +41397,13 @@ Follows is a source code listing for all files that have been open sourced. This *** ios_wizard.rb #+begin_src ruby # ./dragon/ios_wizard.rb - # Contributors outside of DragonRuby who also hold Copyright: Michał Dudziński + # coding: utf-8 # Copyright 2019 DragonRuby LLC # MIT License # ios_wizard.rb has been released under MIT (*only this file*). + # Contributors outside of DragonRuby who also hold Copyright: Michał Dudziński + class IOSWizard < Wizard def initialize @doctor_executed_at = 0 @@ -42451,6 +42512,7 @@ Follows is a source code listing for all files that have been open sourced. This *** itch_wizard.rb #+begin_src ruby # ./dragon/itch_wizard.rb + # coding: utf-8 # Copyright 2019 DragonRuby LLC # MIT License # itch_wizard.rb has been released under MIT (*only this file*). @@ -42713,6 +42775,7 @@ Follows is a source code listing for all files that have been open sourced. This *** layout.rb #+begin_src ruby # ./dragon/layout.rb + # coding: utf-8 # Copyright 2019 DragonRuby LLC # MIT License # layout.rb has been released under MIT (*only this file*). @@ -43636,11 +43699,13 @@ Follows is a source code listing for all files that have been open sourced. This *** metadata.rb #+begin_src ruby # ./dragon/metadata.rb - # Contributors outside of DragonRuby who also hold Copyright: Michał Dudziński + # coding: utf-8 # Copyright 2021 DragonRuby LLC # MIT License # metadata.rb has been released under MIT (*only this file*). + # Contributors outside of DragonRuby who also hold Copyright: Michał Dudziński + module Metadata def metadata_file_path "metadata/game_metadata.txt" @@ -44706,6 +44771,7 @@ Follows is a source code listing for all files that have been open sourced. This *** runtime/autocomplete.rb #+begin_src ruby # ./dragon/runtime/autocomplete.rb + # coding: utf-8 # Copyright 2019 DragonRuby LLC # MIT License # autocomplete.rb has been released under MIT (*only this file*). @@ -44862,6 +44928,7 @@ Follows is a source code listing for all files that have been open sourced. This *** runtime/benchmark.rb #+begin_src ruby # ./dragon/runtime/benchmark.rb + # coding: utf-8 # Copyright 2019 DragonRuby LLC # MIT License # benchmark.rb has been released under MIT (*only this file*). @@ -44979,6 +45046,7 @@ Follows is a source code listing for all files that have been open sourced. This *** runtime/draw.rb #+begin_src ruby # ./dragon/runtime/draw.rb + # coding: utf-8 # Copyright 2019 DragonRuby LLC # MIT License # draw.rb has been released under MIT (*only this file*). @@ -45144,6 +45212,7 @@ Follows is a source code listing for all files that have been open sourced. This *** runtime/framerate.rb #+begin_src ruby # ./dragon/runtime/framerate.rb + # coding: utf-8 # Copyright 2019 DragonRuby LLC # MIT License # framerate.rb has been released under MIT (*only this file*). @@ -45233,6 +45302,7 @@ Follows is a source code listing for all files that have been open sourced. This *** runtime/framerate_diagnostics.rb #+begin_src ruby # ./dragon/runtime/framerate_diagnostics.rb + # coding: utf-8 # Copyright 2019 DragonRuby LLC # MIT License # framerate_diagnostics.rb has been released under MIT (*only this file*). @@ -46063,6 +46133,7 @@ Follows is a source code listing for all files that have been open sourced. This *** wizards.rb #+begin_src ruby # ./dragon/wizards.rb + # coding: utf-8 # Copyright 2019 DragonRuby LLC # MIT License # wizards.rb has been released under MIT (*only this file*). |
