mirror of
https://github.com/GayPizzaSpecifications/voxelotl-engine.git
synced 2025-08-03 13:11:33 +00:00
more random colours
This commit is contained in:
@ -34,14 +34,9 @@ class Game: GameDelegate {
|
|||||||
|
|
||||||
private func generateWorld() {
|
private func generateWorld() {
|
||||||
var random = DarwinRandom(seed: Arc4Random.instance.next(in: DarwinRandom.max))
|
var random = DarwinRandom(seed: Arc4Random.instance.next(in: DarwinRandom.max))
|
||||||
let colors: [Color<UInt8>] = [
|
|
||||||
.white,
|
|
||||||
.red, .blue, .green,
|
|
||||||
.magenta, .yellow, .cyan
|
|
||||||
]
|
|
||||||
self.chunk.fill(allBy: {
|
self.chunk.fill(allBy: {
|
||||||
if (random.next() & 0x1) == 0x1 {
|
if (random.next() & 0x1) == 0x1 {
|
||||||
.solid(colors[random.next(in: 0..<colors.count)])
|
.solid(.init(rgb888: UInt32(random.next(in: 0..<0xFFFFFF+1))))
|
||||||
} else {
|
} else {
|
||||||
.air
|
.air
|
||||||
}
|
}
|
||||||
@ -84,9 +79,6 @@ class Game: GameDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func draw(_ renderer: Renderer, _ time: GameTime) {
|
func draw(_ renderer: Renderer, _ time: GameTime) {
|
||||||
let totalTime = Float(time.total.asFloat)
|
|
||||||
let cubeSpeedMul: Float = 0.1
|
|
||||||
|
|
||||||
let instances = chunk.compactMap { block, position in
|
let instances = chunk.compactMap { block, position in
|
||||||
if case let .solid(color) = block.type {
|
if case let .solid(color) = block.type {
|
||||||
Instance(
|
Instance(
|
||||||
|
Reference in New Issue
Block a user