I don't use Unity. Developing games that target multiple platforms is unsustainable using this game engine. Especially so for studios/indies that lack the means to "just throw money at a problem".
Amir Rajan,
| class Element | |
| attr :x_ordinal, :y_ordinal | |
| def initialize x_ordinal, y_ordinal, grain_size, r, g, b | |
| @x_ordinal = x_ordinal | |
| @y_ordinal = y_ordinal | |
| @grain_size = grain_size | |
| @x = x_ordinal * grain_size | |
| @y = y_ordinal * grain_size | |
| @w = grain_size |
| class Game | |
| attr_dr | |
| def initialize | |
| @cells = 32.flat_map do |x_ordinal| | |
| 18.map do |y_ordinal| | |
| { | |
| **Geometry.rect(x: x_ordinal * 40, y: y_ordinal * 40, w: 40, h: 40), | |
| x_ordinal: x_ordinal, | |
| y_ordinal: y_ordinal, |
| class Game | |
| attr_dr | |
| def initialize | |
| @player = { x: 640 - 50, | |
| y: 360 - 50, | |
| w: 100, | |
| h: 100, | |
| path: "sprites/square/blue.png" } | |
| @boundary_left = 300 |
| class Camera | |
| attr :origin, | |
| :viewport_w, | |
| :viewport_h, | |
| :viewport_offset_x, | |
| :viewport_offset_y, | |
| :scale, | |
| :x, | |
| :y, | |
| :target_scale, |
| <html> | |
| <head> | |
| <title>DragonRuby - Warp Drive Tutorial</title> | |
| </head> | |
| <body> | |
| <h1>DragonRuby Game Toolkit - Warp Drive Tutorial</h1> | |
| <div itemscope="itemscope" itemtype="tutorial-step" data-step-number="1"> | |
| <div itemscope="itemscope" itemtype="tutorial-text"> | |
| <h1>Traveling at Light Speed</h1> |
| def boot args | |
| args.state = {} | |
| end | |
| def tick args | |
| args.outputs.background_color = [30, 30, 30] | |
| args.state.player ||= { | |
| x: 640 - 32, | |
| y: 360 - 32, | |
| w: 64, |
| def boot args | |
| args.state = {} | |
| end | |
| def tick args | |
| # create 100 things and set the seed to a numeric value | |
| # the seed will be used to create a delay for each thing when the up and down keys are pressed | |
| args.state.things ||= 220.map do |i| | |
| x_ordinal = i % 20 | |
| y_ordinal = i.idiv(20) |
| BLENDOPERATION_ADD = 0x1 | |
| BLENDOPERATION_SUBTRACT = 0x2 | |
| BLENDOPERATION_REV_SUBTRACT = 0x3 | |
| BLENDOPERATION_MINIMUM = 0x4 | |
| BLENDOPERATION_MAXIMUM = 0x5 | |
| BLENDFACTOR_ZERO = 0x1 | |
| BLENDFACTOR_ONE = 0x2 | |
| BLENDFACTOR_SRC_COLOR = 0x3 | |
| BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4 | |
| BLENDFACTOR_SRC_ALPHA = 0x5 |