-
-
Notifications
You must be signed in to change notification settings - Fork 86
OpenSiv3D
Kasuga Chiyo edited this page Feb 23, 2019
·
12 revisions
#include <Siv3D.hpp>
#include <DTL.hpp>
#include <cstdint>
#include <cstddef>
#include <array>
#include <bitset>
void Main() {
constexpr std::size_t matrix_size{ 128 };
constexpr std::size_t dungeon_pixel_size{ 2 };
Window::Resize(int32(matrix_size*dungeon_pixel_size), int32(matrix_size*dungeon_pixel_size));
std::array<std::bitset<matrix_size>, matrix_size> matrix{ {} };
const dtl::generator::terrain::stl::SimpleVoronoiIsland<bool> create(matrix);
dtl::utility::stl::noiseShoreBool(matrix);
while (System::Update())
for (std::size_t row{}; row < matrix.size(); ++row)
for (std::size_t col{}; col < matrix[row].size(); ++col)
Rect(int32(col*dungeon_pixel_size), int32(row*dungeon_pixel_size), int32(dungeon_pixel_size)).draw((matrix[row][col]) ? Color(98, 170, 48) : Color(30, 30, 163));
}
Copyright (c) 2018-2021 As Project.
Distributed under the Boost Software License, Version 1.0.(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)