Skip to content

Instantly share code, notes, and snippets.

View voidproc's full-sized avatar
👾
shoot 'em up

voidProc voidproc

👾
shoot 'em up
View GitHub Profile
@voidproc
voidproc / intersect.cpp
Last active September 23, 2016 11:16
Collision detection for Shapes
#include <Siv3D.hpp>
template <class T>
const bool intersect(const T& shape1, const Shape& shape2)
{
const Shape::Type type = shape2.type();
switch (type)
{
#include <Siv3D.hpp>
#include <memory>
#include <list>
#include <unordered_map>
// ----------------------------------------
// Entity インスタンス間の共有データ
// ----------------------------------------
#include <Siv3D.hpp>
struct ScrollLines
{
Array<RectF> lines;
int frame = 0;
const int duration;
const int fade;
#include <Siv3D.hpp>
struct Twinkle : IEffect
{
Vec2 pos;
double angle;
double scale;
Twinkle(const Vec2 pos) : pos(pos), angle(RandomSelect({ 0_deg, 45_deg })), scale(Random(0.2, 1.0))
{
#include <Siv3D.hpp>
class Bubble : public IEffect
{
public:
Bubble(const Vec2& pos, const Vec2& vel, const double r) : pos_(pos), vel_(vel), r_(r)
{
}
bool update(double t) override
#include <Siv3D.hpp>
#include <memory>
// Console app
#pragma comment(linker, "/SUBSYSTEM:CONSOLE")
// Lua 5.2.x (need 'lua52.dll' at runtime)
#include <lua.hpp>
#pragma comment(lib, "lua52.lib")
#include <Siv3D.hpp>
#include <memory>
// Lua 5.2.x (need 'lua52.dll' at runtime)
#include <lua.hpp>
#pragma comment(lib, "lua52.lib")
// Sol 2.14
#include <sol.hpp>
@voidproc
voidproc / power.cpp
Created November 4, 2016 13:27
Show system power status
#define NOMINMAX
#define STRICT
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <Siv3D.hpp>
// システムの電源情報をWin32APIにより取得し保持する
class PowerStatus
{
#include <Siv3D.hpp>
// hqx : https://code.google.com/archive/p/hqx/
extern "C" {
#include "hqx.h"
};
void Main()
{
#define NOMINMAX
#define STRICT
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <Siv3D.hpp>
struct DIBSection
{
HDC hdc;