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
| # game concept from: https://youtu.be/Tz-AinJGDIM | |
| # Color pallete for game | |
| 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 } | |
| module Main | |
| def start |
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
| class Camera | |
| class << self | |
| def viewport_w | |
| Grid.allscreen_w | |
| end | |
| def viewport_h | |
| Grid.allscreen_h | |
| end |
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
| #!/usr/bin/env bash | |
| # git clone https://gist.github.com/amirrajan/0732e675346fca3ab4e7f19c01ad8806 benchmark-java-build && cd ./benchmark-java-build && sh ./go.sh | |
| # Clone Kafka 4.0.2, fetch the benchmark script, and run it. | |
| set -eu | |
| git clone --depth 1 --branch 4.0.2 https://github.com/apache/kafka.git | |
| cd kafka |
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
| module Main | |
| def start | |
| @game = Game.new | |
| end | |
| def tick | |
| @game.inputs = inputs | |
| @game.tick | |
| outputs.background_color = [30, 30, 30] | |
| outputs.primitives << @game.primitives |
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
| # main entry point for the game | |
| module Main | |
| def start | |
| # initialize the game and create 100 random squares | |
| @squares = create_random_squares | |
| end | |
| def create_random_squares | |
| # function creates 100 random squares | |
| # that are within the bounds of the screen |
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
| # https://www.youtube.com/watch?v=8rCRsOLiO7k | |
| require "shaders/ripples.fragment.hlsl" | |
| module Main | |
| def start | |
| @ripple_queue = [] | |
| end | |
| def tick |
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
| class Game | |
| attr_gtk | |
| attr :queues | |
| def initialize | |
| @keeper = { | |
| max_speed: 3, | |
| acceleration: 0.1, | |
| x: 659, |
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
| // this is the main scene (args.outputs) | |
| Texture2D tex_scene : register(t0, space2); | |
| // this is the render target that represents the wind displacement map (args.outputs[:wind]) | |
| Texture2D tex_wind : register(t1, space2); | |
| // sampler for the main scene texture | |
| SamplerState sam_scene : register(s0, space2); | |
| // sampler for the wind displacement texture |
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
| Texture2D scene : register(t0, space2); | |
| Texture2D displacement_map : register(t1, space2); | |
| SamplerState sampler0 : register(s0, space2); | |
| SamplerState sampler1 : register(s1, space2); | |
| struct Input { | |
| float4 tex_color : COLOR0; | |
| float2 tex_coord : TEXCOORD0; | |
| }; |
NewerOlder