This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # TeenyTiny DragonRuby MiniGameJam SimpleSample | |
| # This is a simple sample game that takes 20 seconds to win. | |
| SMALL_SHAPE_SIZE = 200 | |
| LARGE_SHAPE_SIZE = 300 | |
| VIEW_WIDTH = $args.grid.w | |
| VIEW_HEIGHT = $args.grid.h | |
| H_CENTRE = VIEW_WIDTH / 2 | |
| V_CENTRE = VIEW_HEIGHT / 2 | |
| WIN_SCORE = 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $gtk.reset | |
| def tick args | |
| args.state.rt_symbols_recycle_bin = [] | |
| args.state.rt_symbol_counter = 0 | |
| if args.state.tick_count == 0 | |
| # get a couple of fresh symbols | |
| symbol1 = get_rt_symbol(args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # brief demonstration of Bresenham's line algorithm in DragonRuby | |
| BRUSH_SIZE = 16 | |
| def tick(args) | |
| args.state.last_mouse_x ||= args.inputs.mouse.x | |
| args.state.last_mouse_y ||= args.inputs.mouse.y | |
| # set the start of the line | |
| x0 = args.state.last_mouse_x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $gtk.reset seed: Time.now.to_i | |
| #puts "++++++++++++++++++ RESET +++++++++++++++++++++" | |
| =begin | |
| Creates a few different effects using particles | |
| explode: fly apart dramatically and burn with flaming colours | |
| melt: fall apart in a downward direction while turning toxic green | |
| disintegrate: break apart less dramatically without burning colours |
NewerOlder