Skip to content

Instantly share code, notes, and snippets.

View sdkfz181tiger's full-sized avatar
👾

Kajiru sdkfz181tiger

👾
View GitHub Profile
@sdkfz181tiger
sdkfz181tiger / SceneBox2d.cpp
Last active October 3, 2025 10:33
Box2D基本4_Contactを使ったオブジェクトの削除パターン
#include "SceneBox2d.h"
#include "box2d/box2d.h"
#include "box2d/collision.h"
#include "box2d/math_functions.h"
SceneBox2d *SceneBox2d::create(int dWidth, int dHeight) {
// New
auto obj = new SceneBox2d(dWidth, dHeight);
if (obj && obj->init()) return obj;
@sdkfz181tiger
sdkfz181tiger / DrawerCar.cpp
Created October 3, 2025 06:03
Box2D基本3_Motorを使った自動車クラス
#include "DrawerCar.h"
#include "DrawerBox.h"
#include "DrawerCircle.h"
DrawerCar *DrawerCar::create(const b2WorldId &worldId,
float x, float y) {
// New
auto obj = new DrawerCar(worldId, x, y);
if (obj && obj->init()) return obj;
DX_SAFE_DELETE(obj);
@sdkfz181tiger
sdkfz181tiger / DrawerRagdoll.cpp
Last active October 3, 2025 10:58
Box2D基本2_Jointを使ったRagdollクラス
#include "DrawerRagdoll.h"
#include "DrawerBox.h"
#include "DrawerCircle.h"
DrawerRagdoll *DrawerRagdoll::create(const b2WorldId &worldId,
float x, float y) {
// New
auto obj = new DrawerRagdoll(worldId, x, y);
if (obj && obj->init()) return obj;
DX_SAFE_DELETE(obj);
@sdkfz181tiger
sdkfz181tiger / DrawerBase.cpp
Last active October 3, 2025 06:04
Box2D基本1_四角や円を物理空間に描くクラス
#include "DrawerBase.h"
DrawerBase::DrawerBase(const b2WorldId &worldId,
float x, float y, Type type) :
NodeBase(x, y), type(type),
color(GetColor(255, 255, 255)),
b2dRate(UtilDebug::getInstance()->getGridSize() * 2),
worldId(worldId), bodyId(b2_nullBodyId) {
//LOGD("Main", "DrawerBase()");
}
@sdkfz181tiger
sdkfz181tiger / 01_helloworld.py
Last active April 29, 2025 00:25
Python3_定番ハンズオン7選_2025
# coding: utf-8
"""
Hello World
"""
#==========
# Main
import math, random
@sdkfz181tiger
sdkfz181tiger / 01_helloworld.js
Last active April 29, 2025 00:25
JavaScript_定番ハンズオン7選_2025
console.log("main.js!!");
const inputName = prompt("名前を入力してください");
console.log("こんにちは,", inputName, "さん!!");
const inputAge = prompt("年齢を入力してください");
console.log("年齢は,", inputAge, "ですね");
const numAge = parseInt(inputAge);
if(numAge < 13){
@sdkfz181tiger
sdkfz181tiger / 01_helloworld.cpp
Last active April 29, 2025 00:25
C/C++_定番ハンズオン7選_2025
#include <cstdlib>
#include <stdio.h>
#include <string>
#include <ctime>
#include <iostream>
/*
1, $brew install cmake
2, $cmake --version
3, $ cd your_project_folder
@sdkfz181tiger
sdkfz181tiger / main01.js
Last active June 17, 2024 00:10
疑似3Dであっさりアウトラン_チュートリアル版
"use strict"
// URL: https://openprocessing.org/sketch/957775
const WHITE = "#ffffff";
const BLACK = "#000000";
const SCREEN = 100; // スクリーンまでの距離
const points = [];// 3D空間の座標を格納する配列
@sdkfz181tiger
sdkfz181tiger / main01.js
Last active March 20, 2025 11:16
経路探索(p5js)_深度優先/幅優先/A*アルゴリズム
"use strict"
const WHITE = "#eeeeee";
const BLACK = "#333333";
const GRAY = "#777777";
const RED = "#ff6624";
const GREEN = "#66ff24";
const BLUE = "#2466ff";
const ROWS = 23;// 迷路の大きさ(行数)
@sdkfz181tiger
sdkfz181tiger / test01.sh
Last active June 12, 2024 03:26
シェルスクリプトあっさり7選!!
#!/bin/bash
# シェルスクリプトの実行と引数
# $bash test.sh
# $bash test.sh hoge
# $bash test.sh hoge fuga
# $bash test.sh hoge fuga piyo
echo "Running $0"
echo "arg1: $1"