Skip to content

Instantly share code, notes, and snippets.

#include <string.h>
#include <stdbool.h>
#include "sc1.h"
#define DELTA_X 1
#define DELTA_Y N
#define NUM_OF_LINE (N + N + 2)
#define LINE_SUM 111
#define HOLE_NUM 15
#include <stdexcept>
#include <string>
#include <tuple>
#include "Pasolib.hpp"
#include "felicalib.h"
#pragma comment(lib, "felicalib.lib")
namespace pasolib {
@azaika
azaika / tetris.cpp
Last active December 29, 2016 20:27
#include <Siv3D.hpp>
#include <array>
#include <vector>
#include <algorithm>
using ShapeType = std::array<std::array<bool, 4>, 4>;
struct TetrominoInfo {
ShapeType shape;
Color color;
};
@azaika
azaika / makeDividedTexture.cpp
Created April 2, 2017 13:07
Siv3DでDxLibのLoadDivGraph関数っぽいやつ
#include <Siv3D.hpp>
// image を大きさ size の画像に分割
Array<Texture> makeDividedTexture(const Image& image, const Size& size) {
// 分割数
const Size numDiv{ image.size.x / size.x, image.size.y / size.y };
Array<Texture> result;
result.reserve(numDiv.x * numDiv.y);
@azaika
azaika / Main.cpp
Created August 19, 2017 14:12
TOMLReader実装案
# include <Siv3D.hpp> // OpenSiv3D v0.1.6
# include "cpptoml.h"
namespace toml
{
class TOMLValue;
}
namespace s3d
{
//-----------------------------------------------
//
// This file is part of the HamFramework for Siv3D.
//
// Copyright (C) 2014-2017 HAMSTRO
// Copyright (c) 2017 OpenSiv3D Project
//
// Licensed under the MIT License.
//
//-----------------------------------------------
# pragma once
# include <memory>
# include <variant>
# include "Fwd.hpp"
# include "TextReader.hpp"
# include "TextWriter.hpp"
# include "Array.hpp"
namespace s3d
# include <Siv3D.hpp> // OpenSiv3D v0.4.2
# include "JSON.hpp"
# include "boost/ut.hpp"
JSON MakeDummy()
{
JSON json;
json[U"Dummy"][U"title"] = U"My title";
json[U"Dummy"][U"width"] = 640;
json[U"Dummy"][U"height"] = 480;
#include <Siv3D.hpp>
void Main() {
Graphics::SetTargetFrameRateHz(60);
Window::SetTitle(U"五月祭 TSGLIVE 5! day-1 ライブゲームプログラミング");
Scene::SetBackground(Palette::Lightblue);
Window::Resize({ 500, 800 });
constexpr double timeDelta = 1 / 60.0;