# hacky AF | |
# abandon all hope ye who enter here | |
class Pixel | |
def self.abgr_to_h abgr | |
a = (abgr >> 24) & 0xff | |
b = (abgr >> 16) & 0xff | |
g = (abgr >> 8) & 0xff | |
r = (abgr >> 0) & 0xff | |
{ r: r, g: g, b: b, a: a } | |
end |
# https://www.youtube.com/watch?v=-GWTDhOQU6M | |
class Square | |
attr :x, :y, :w, :h, | |
:prev_x, :prev_y, | |
:acceleration_x, :acceleration_y, | |
:drag_x, :drag_y, | |
:radius, | |
:dx, :dy, :path, :start_acceleration_x, :start_acceleration_y | |
def initialize(x:, y:, w:, h:, radius:, start_acceleration_x:, start_acceleration_y:, drag_x:, drag_y:) |
class ToggleButton | |
attr :on_off | |
def initialize(x:, y:, w:, h:, on_off:, button_text:, on_click:) | |
@x = x | |
@y = y | |
@w = w | |
@h = h | |
@on_off = on_off | |
@button_text = button_text |
# Sprites represented as Hashes using the queue ~args.outputs.sprites~ | |
# code up, but are the "slowest" to render. | |
# The reason for this is the access of the key in the Hash and also | |
# because the data args.outputs.sprites is cleared every tick. | |
def random_x | |
rand * $grid.w * -1 | |
end | |
def random_y |
RED = { r: 222, g: 63, b: 66 } | |
GRAY = { r: 128, g: 128, b: 128 } | |
BLACK = { r: 0, g: 0, b: 0 } | |
LIGHT_GRAY = { r: 237, g: 237, b: 237 } | |
def boot args | |
args.state = {} | |
end | |
def tick args |
Nissan Motors, and Their Crappy U.S. Made Transmissions
This is a work of fiction. Names, characters, places and incidents either are products of the author’s imagination or are used fictitiously. Any resemblance to actual events or locales or persons or companies (or anything else not explicity stated in this ridiculous disclaimer), living or dead, is entirely coincidental.
In the 1960’s, Nissan Motors expanded its market to the United States. In doing so, a portion of parts were to be built on American soil. Around this same time period, automotive innovation was in full force. Specifically with regard to automatic transmissions. An extremely bright team of American and Japanese engineers got together and spec’d out the first line of automatic transmissions to be used in Nissan automobiles.
The specifications for the new automatic transmissions were sent to the production lines in the United States and Japan. The transmissions were complex, 863 unique parts needed to be assembled for this incredible piec
def tick args | |
duration = 120 | |
args.state.after_image_queue ||= [] | |
args.state.start_at = if Kernel.tick_count == 0 | |
0 | |
elsif Kernel.tick_count.zmod?(duration.idiv(2)) | |
args.state.start_at + duration.idiv(2) | |
else | |
args.state.start_at | |
end |