This file contains 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
extends RigidBody | |
var rotating = false | |
var prev_mouse_position | |
var next_mouse_position | |
func _process(delta): | |
if (Input.is_action_just_pressed("Rotate")): | |
rotating = true |
This file contains 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
w, h = 1000, 1000 | |
colors = [[(188, 216, 193), (214, 219, 178), (227, 217, 133), (229, 122, 68)], [(219, 177, 188), (211, 196, 227), (143, 149, 211), (137, 218, 255)], [(191, 107, 99), (217, 163, 132), (91, 158, 166), (169, 212, 217)]] | |
random_colors = int(random(3)) | |
def get_random_element(l): | |
return l[int(random(len(l)))] | |
def deformed_circle(x, y, r, random_colors): |
This file contains 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
shader_type canvas_item; | |
uniform vec4 color_1 = vec4(.0, .0, .0, 1.0); | |
uniform vec4 color_2 = vec4(0.5, 0.5, 0.5, 1.0); | |
void fragment() { | |
vec4 colors[2] = {color_1, color_2}; | |
float min_diff = -1.0; |
This file contains 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
// Created from: https://github.com/hughsk/glsl-dither | |
// Inspired by: https://www.youtube.com/watch?v=npno7zivwrQ | |
shader_type canvas_item; | |
float dither8x8(vec2 position, float brightness) { | |
int x = int(mod(position.x, 8.0)); | |
int y = int(mod(position.y, 8.0)); | |
int index = x + y * 8; |
This file contains 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
extends Node2D | |
var messages = [ | |
"My First Message", | |
"Second Message For You" | |
] | |
var typing_speed = .1 | |
var read_time = 2 |
This file contains 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
days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] | |
def day_offset(day, offset): | |
return days[(days.index(day) + offset) % 7] | |
if __name__ == "__main__": | |
print(day_offset("Wednesday", 5)) # Monday | |
print(day_offset("Monday", 0)) # Monday | |
print(day_offset("Saturday", -1)) # Friday |
This file contains 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
import random | |
# First element is the attack, the following elements are weaknesses | |
attacks = [ | |
['rock', 'paper'], | |
['paper', 'scissors'], | |
['scissors', 'rock'] | |
] | |
# Tracking game progress |
This file contains 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
def substring(*arg): | |
# Unknown number of arguments | |
arg_length = len(arg) | |
# Input string and output | |
orig = '' | |
out = '' | |
# Return original string if no other parameters are given | |
if (arg_length > 1): |
This file contains 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
<div class="row_2"> | |
<div class="column_6"> | |
<div id="sketchdiv" style="min-height: 1px;"> | |
</div> | |
</div> | |
</div> |
This file contains 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
.row_2::after { | |
content: ""; | |
clear: both; | |
display: table; | |
} | |
.column_6 { | |
float: left; | |
width: 100%; | |
padding: 5px; |
NewerOlder