mirror of
https://github.com/Cookie-CHR/LD54-SPAce-ltd.git
synced 2024-11-21 23:14:18 +00:00
19 lines
486 B
GDScript
19 lines
486 B
GDScript
extends TileMap
|
|
|
|
var rng =RandomNumberGenerator.new()
|
|
|
|
func _ready():
|
|
#randomize background
|
|
rng.randomize()
|
|
|
|
for x in range(0, 16):
|
|
for y in range(0, 10):
|
|
set_cell(0, Vector2(x,y), 0, Vector2(rng.randi_range(0,3), rng.randi_range(0,3)))
|
|
|
|
|
|
func _process(_delta):
|
|
#change one tile from time to time, randomly
|
|
for x in range(0, 16):
|
|
for y in range(0, 10):
|
|
if(rng.randi_range(0,200)==0):
|
|
set_cell(0, Vector2(x,y), 0, Vector2(rng.randi_range(0,3), rng.randi_range(0,3)))
|