#include using namespace std; const int ARR_SIZE = 8; int main() { //二次元配列 float arr[4][2] ={{1.2, 2.4}, {3.6, 4.8}, {5.2, 3.1}, {2.6, 1.1}}; int zaseki[9][4] = {{0,2,3,4},{1,2,3,4},{2,2,3,4},{3,2,3,4},{4,2,3,4}, {5,2,3,4},{6,2,3,4},{7,2,3,4},{8,2,3,4} }; // for(int i=0; i ==== Siv3Dで2Dマップ ==== # include // OpenSiv3D v0.6.10 void Main() { // 背景の色を設定する | Set the background color Scene::SetBackground(ColorF{ 0.6, 0.8, 0.7 }); // 絵文字からテクスチャを作成する | Create a texture from an emoji //const Texture emoji{ U"🦖"_emoji }; TextureAsset::Register(U"dragon", { U"🟫"_emoji }); TextureAsset::Register(U"hana", { U"🌷"_emoji }); TextureAsset::Register(U"ki", { U"🌳"_emoji }); TextureAsset::Register(U"ie", { U"🏠"_emoji }); Texture images[4] = { TextureAsset(U"dragon"), TextureAsset(U"hana"), TextureAsset(U"ki"), TextureAsset(U"ie") }; const Size imageSize(32, 32); int map[19][25] = { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,2,2,2,2,2,2,2,3,2,2,2,2,2,2,2,3,2,2,2,1,2,2,2,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,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