Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
IntangibleMatter committed Oct 9, 2023
0 parents commit bf538d4
Show file tree
Hide file tree
Showing 145 changed files with 1,598 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Godot 4+ specific ignores
.godot/
.build/
Binary file added ball.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions ball.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://8i44d68wyipb"
path="res://.godot/imported/ball.png-9a4ca347acb7532f6ae347744a6b04f7.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://ball.png"
dest_files=["res://.godot/imported/ball.png-9a4ca347acb7532f6ae347744a6b04f7.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
1 change: 1 addition & 0 deletions icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions icon.svg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://xvynre2dvve4"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
111 changes: 111 additions & 0 deletions meta.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
#@tool
extends Node2D

# Was an export, moved to a config file bc fuck you
var ball_count : int = 128

var balls : Array[Transform2D]
var sizes : PackedFloat32Array
var killing : PackedVector2Array
var spawning : PackedVector2Array

var INIT_V_MAX := 32.0
var INIT_V_MIN := 8.0
var MAX_V := 32.0
var INIT_A := 16.0
var MAX_A := 32.0
@export_range(0.1, 2.0) var SIZE_MIN := 0.6
@export_range(0.1, 2.0) var SIZE_MAX := 1.2
@export_range(0.0, 1.0) var gyration := 0.1


var half_width : float
var half_height : float

var tex := preload("res://ball.png")

func _ready() -> void:
RenderingServer.set_default_clear_color(Color.BLACK)
half_height = get_viewport_rect().size.y/2 + 256
half_width = get_viewport_rect().size.x/2 + 256
randomize()

get_ball_count()

create_balls(ball_count)


func get_ball_count() -> void:
var cfg := ConfigFile.new()
if cfg.load("user://balls.cfg") != OK:
cfg.set_value("balls", "count", ball_count)
cfg.set_value("balls", "size_min", SIZE_MIN)
cfg.set_value("balls", "size_max", SIZE_MAX)
cfg.set_value("balls", "gyration", gyration)
cfg.set_value("balls", "init_velocity_min", INIT_V_MIN)
cfg.set_value("balls", "init_velocity_max", INIT_V_MAX)
cfg.set_value("balls", "velocity_max", MAX_V)
cfg.set_value("balls", "accel_max", MAX_A)
cfg.save("user://balls.cfg")
else:
ball_count = cfg.get_value("balls", "count", ball_count)
SIZE_MIN = cfg.get_value("balls", "size_min", SIZE_MIN)
SIZE_MAX = cfg.get_value("balls", "size_max", SIZE_MAX)
gyration = cfg.get_value("balls", "gyration", gyration)
INIT_V_MIN = cfg.get_value("balls", "init_velocity_min", INIT_V_MIN)
INIT_V_MAX = cfg.get_value("balls", "init_velocity_max", INIT_V_MAX)
MAX_V = cfg.get_value("balls", "velocity_max", MAX_V)
MAX_A = cfg.get_value("balls", "accel_max", MAX_A)


func _process(delta: float) -> void:
update_balls(delta)
queue_redraw()


func create_balls(count: int) -> void:
for ball in count:
sizes.append(randf_range(SIZE_MIN, SIZE_MAX))
balls.append(Transform2D(
Vector2(randf_range(INIT_V_MIN, INIT_V_MAX) * sign(randf_range(-1, 1)), randf_range(INIT_V_MIN, INIT_V_MAX) * sign(randf_range(-1, 1))),
Vector2.ZERO,#(randf_range(-INIT_A, INIT_A), randf_range(-INIT_A, INIT_A)),
Vector2(randf_range(-half_width, half_width), randf_range(-half_height, half_height))
))
print(balls[-1])


func update_balls(delta: float) -> void:
for ball in balls.size():
# print(ball)
balls[ball].y += Vector2(randf_range(-1, 1), randf_range(-1, 1))
balls[ball].x += balls[ball].y * delta
# prints(balls[ball].origin, balls[ball].origin + balls[ball].x)
balls[ball].origin += balls[ball].x * delta
balls[ball].y.x = clamp(balls[ball].y.x, -MAX_A, MAX_A)
balls[ball].y.y = clamp(balls[ball].y.y, -MAX_A, MAX_A)
balls[ball].x.x = clamp(balls[ball].x.x, -MAX_A, MAX_A)
balls[ball].x.y = clamp(balls[ball].x.y, -MAX_A, MAX_A)
if balls[ball].origin.y > half_height:
balls[ball].origin.y = -half_height
elif balls[ball].origin.y < -half_height:
balls[ball].origin.y = half_height
elif balls[ball].origin.x > half_width:
balls[ball].origin.x = -half_width
elif balls[ball].origin.x < -half_width:
balls[ball].origin.x = half_width
#
#func get_accel_diff(pos: Vector2) -> Vector2:
# return pos.normalized() * -1


func _draw() -> void:
# draw_rect(get_viewport_rect(), Color.BLACK)
# draw_texture(tex, get_local_mouse_position())
# prints(Time.get_ticks_msec(), "ASDASDASD")
for ball in balls.size():
## alternate version which enables scale
var dsize : float = sizes[ball] + gyration * sin(Time.get_ticks_msec() / 1000.0 + ball * ball)\
if fmod(sizes[ball], 0.1) == 0 else sizes[ball] + gyration * cos(Time.get_ticks_msec() / 1000.0 + ball * ball)
draw_set_transform(balls[ball].origin, 0, Vector2(dsize, dsize))
draw_texture(tex, Vector2.ZERO)
# draw_texture(tex, balls[ball].origin, Color(Color.WHITE, sizes[ball]))
8 changes: 8 additions & 0 deletions meta.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[gd_scene load_steps=2 format=3 uid="uid://cldu5o7rgeph5"]

[ext_resource type="Script" path="res://meta.gd" id="1_561lu"]

[node name="meta" type="Node2D"]
script = ExtResource("1_561lu")

[node name="Camera2D" type="Camera2D" parent="."]
6 changes: 6 additions & 0 deletions palettes/0/fullbw.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://dbcvhv7lkwasn"]

[sub_resource type="Gradient" id="Gradient_ajka3"]

[resource]
gradient = SubResource("Gradient_ajka3")
9 changes: 9 additions & 0 deletions palettes/2/bitbee.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://dpdigybl5eu5q"]

[sub_resource type="Gradient" id="Gradient_abq40"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.5)
colors = PackedColorArray(0.160784, 0.168627, 0.188235, 1, 0.811765, 0.670588, 0.290196, 1)

[resource]
gradient = SubResource("Gradient_abq40")
8 changes: 8 additions & 0 deletions palettes/2/fullcontrast.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://b6n6l5to0p8qp"]

[sub_resource type="Gradient" id="Gradient_abq40"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.5)

[resource]
gradient = SubResource("Gradient_abq40")
9 changes: 9 additions & 0 deletions palettes/2/macpaint.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://dprf6gqlcsoho"]

[sub_resource type="Gradient" id="Gradient_abq40"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.5)
colors = PackedColorArray(0.0196078, 0.105882, 0.172549, 1, 0.545098, 0.784314, 0.996078, 1)

[resource]
gradient = SubResource("Gradient_abq40")
9 changes: 9 additions & 0 deletions palettes/2/noiretruth.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://dgoatscjqk8k6"]

[sub_resource type="Gradient" id="Gradient_abq40"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.5)
colors = PackedColorArray(0.117647, 0.109804, 0.196078, 1, 0.776471, 0.729412, 0.67451, 1)

[resource]
gradient = SubResource("Gradient_abq40")
9 changes: 9 additions & 0 deletions palettes/2/obradinnibm8503.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://cynj6errpyags"]

[sub_resource type="Gradient" id="Gradient_abq40"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.5)
colors = PackedColorArray(0.180392, 0.188235, 0.215686, 1, 0.921569, 0.898039, 0.807843, 1)

[resource]
gradient = SubResource("Gradient_abq40")
9 changes: 9 additions & 0 deletions palettes/2/paperback2.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://bi7288cclms8c"]

[sub_resource type="Gradient" id="Gradient_abq40"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.5)
colors = PackedColorArray(0.219608, 0.168627, 0.14902, 1, 0.721569, 0.760784, 0.72549, 1)

[resource]
gradient = SubResource("Gradient_abq40")
9 changes: 9 additions & 0 deletions palettes/2/pastelito2.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://bdkkeq0yahkw3"]

[sub_resource type="Gradient" id="Gradient_abq40"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.5)
colors = PackedColorArray(0.294118, 0.278431, 0.360784, 1, 0.843137, 0.870588, 0.862745, 1)

[resource]
gradient = SubResource("Gradient_abq40")
9 changes: 9 additions & 0 deletions palettes/2/pixelink.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://dpv54hhdld3rv"]

[sub_resource type="Gradient" id="Gradient_abq40"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.5)
colors = PackedColorArray(0.243137, 0.137255, 0.172549, 1, 0.929412, 0.964706, 0.839216, 1)

[resource]
gradient = SubResource("Gradient_abq40")
9 changes: 9 additions & 0 deletions palettes/3/titanstone.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://gtp1ypnao3e1"]

[sub_resource type="Gradient" id="Gradient_k4ic1"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.4, 0.7)
colors = PackedColorArray(0.0823529, 0.0156863, 0.0745098, 1, 0.388235, 0.360784, 0.427451, 1, 1, 1, 0.819608, 1)

[resource]
gradient = SubResource("Gradient_k4ic1")
9 changes: 9 additions & 0 deletions palettes/4/2bitdemichrome.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://dte0c55chcjgm"]

[sub_resource type="Gradient" id="Gradient_wwqgs"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.4, 0.6, 0.8)
colors = PackedColorArray(0.129412, 0.117647, 0.12549, 1, 0.333333, 0.333333, 0.407843, 1, 0.627451, 0.627451, 0.545098, 1, 0.913725, 0.937255, 0.92549, 1)

[resource]
gradient = SubResource("Gradient_wwqgs")
9 changes: 9 additions & 0 deletions palettes/4/ambercrtgb.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://b0kw0wbpy2s0e"]

[sub_resource type="Gradient" id="Gradient_wwqgs"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.4, 0.6, 0.8)
colors = PackedColorArray(0.0509804, 0.0156863, 0.0196078, 1, 0.368627, 0.0705882, 0.0627451, 1, 0.827451, 0.337255, 0, 1, 0.996078, 0.815686, 0.0941176, 1)

[resource]
gradient = SubResource("Gradient_wwqgs")
9 changes: 9 additions & 0 deletions palettes/4/andradegameboy.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://h241bcex0lho"]

[sub_resource type="Gradient" id="Gradient_wwqgs"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.4, 0.6, 0.8)
colors = PackedColorArray(0.12549, 0.12549, 0.12549, 1, 0.368627, 0.403922, 0.270588, 1, 0.682353, 0.729412, 0.537255, 1, 0.890196, 0.933333, 0.752941, 1)

[resource]
gradient = SubResource("Gradient_wwqgs")
9 changes: 9 additions & 0 deletions palettes/4/autumnchill.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://bx8rlhjl2bmd8"]

[sub_resource type="Gradient" id="Gradient_wwqgs"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.4, 0.6, 0.8)
colors = PackedColorArray(0.172549, 0.117647, 0.454902, 1, 0.760784, 0.227451, 0.45098, 1, 0.835294, 0.533333, 0.388235, 1, 0.854902, 0.827451, 0.686275, 1)

[resource]
gradient = SubResource("Gradient_wwqgs")
9 changes: 9 additions & 0 deletions palettes/4/bittersweet.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://dlqaufphcyskv"]

[sub_resource type="Gradient" id="Gradient_wwqgs"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.4, 0.6, 0.8)
colors = PackedColorArray(0.188235, 0, 0.188235, 1, 0.376471, 0.156863, 0.470588, 1, 0.972549, 0.564706, 0.12549, 1, 0.972549, 0.941176, 0.533333, 1)

[resource]
gradient = SubResource("Gradient_wwqgs")
9 changes: 9 additions & 0 deletions palettes/4/blkaqua4.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://d0nnq2vpeyfub"]

[sub_resource type="Gradient" id="Gradient_wwqgs"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.4, 0.6, 0.8)
colors = PackedColorArray(0, 0.168627, 0.34902, 1, 0, 0.372549, 0.54902, 1, 0, 0.72549, 0.745098, 1, 0.623529, 0.956863, 0.898039, 1)

[resource]
gradient = SubResource("Gradient_wwqgs")
9 changes: 9 additions & 0 deletions palettes/4/bloodcrow.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://b3ymt75p5oe53"]

[sub_resource type="Gradient" id="Gradient_wwqgs"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.4, 0.6, 0.8)
colors = PackedColorArray(0.0980392, 0, 0, 1, 0.337255, 0.0352941, 0.0352941, 1, 0.678431, 0.12549, 0.12549, 1, 0.94902, 0.901961, 0.901961, 1)

[resource]
gradient = SubResource("Gradient_wwqgs")
9 changes: 9 additions & 0 deletions palettes/4/bluem0ld.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://eyak3iuavrr2"]

[sub_resource type="Gradient" id="Gradient_wwqgs"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.4, 0.6, 0.8)
colors = PackedColorArray(0.156863, 0.137255, 0.156863, 1, 0.329412, 0.360784, 0.494118, 1, 0.772549, 0.411765, 0.505882, 1, 0.639216, 0.635294, 0.603922, 1)

[resource]
gradient = SubResource("Gradient_wwqgs")
9 changes: 9 additions & 0 deletions palettes/4/cave4.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://65js6kv0sycw"]

[sub_resource type="Gradient" id="Gradient_wwqgs"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.4, 0.6, 0.8)
colors = PackedColorArray(0.172549, 0, 0.0862745, 1, 0.309804, 0.305882, 0.501961, 1, 0.576471, 0.509804, 0.509804, 1, 0.894118, 0.796078, 0.74902, 1)

[resource]
gradient = SubResource("Gradient_wwqgs")
9 changes: 9 additions & 0 deletions palettes/4/coldfiregb.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="GradientTexture1D" load_steps=2 format=3 uid="uid://51u5her2mwfs"]

[sub_resource type="Gradient" id="Gradient_mf16r"]
interpolation_mode = 1
offsets = PackedFloat32Array(0, 0.4, 0.6, 0.8)
colors = PackedColorArray(0.27451, 0.258824, 0.368627, 1, 0.356863, 0.462745, 0.552941, 1, 0.819608, 0.486275, 0.486275, 1, 0.964706, 0.776471, 0.658824, 1)

[resource]
gradient = SubResource("Gradient_mf16r")
Loading

0 comments on commit bf538d4

Please sign in to comment.