updates. herorganizatie en schilderij
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
@tool
|
||||
extends Node3D
|
||||
|
||||
const SIZE = 5
|
||||
enum Direction {UP, RIGHT, DOWN, LEFT}
|
||||
var sequence = []
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
randomize()
|
||||
|
||||
var arrow = Image.load_from_file("res://Images/arrow.png")
|
||||
arrow.convert(Image.FORMAT_RG8)
|
||||
|
||||
var painting = Image.create(128*SIZE, 128*SIZE, false, Image.FORMAT_RG8)
|
||||
var painting_em = Image.create(128*SIZE, 128*SIZE, false, Image.FORMAT_RG8)
|
||||
painting_em.fill(Color.BLACK)
|
||||
painting.fill(Color.YELLOW_GREEN)
|
||||
|
||||
for x in range(SIZE):
|
||||
for y in range(SIZE):
|
||||
var dir = randi() % 4
|
||||
for i in range(dir):
|
||||
arrow.rotate_90(0)
|
||||
painting.blit_rect(arrow, arrow.get_used_rect() ,Vector2i(x*128, y*128))
|
||||
if randi() % 4 == 0:
|
||||
painting_em.blit_rect(arrow, arrow.get_used_rect() ,Vector2i(x*128, y*128))
|
||||
sequence.append(dir)
|
||||
for i in range(4-dir):
|
||||
arrow.rotate_90(0)
|
||||
|
||||
|
||||
var texture = ImageTexture.create_from_image(painting)
|
||||
$Canvas.get_surface_override_material(0).albedo_texture = texture
|
||||
var texture_em = ImageTexture.create_from_image(painting_em)
|
||||
$Canvas.get_surface_override_material(0).emission_texture = texture_em
|
||||
Reference in New Issue
Block a user