<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://wiki.yz-learning.com/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>Yz-Learning Base Wiki - game-engineer:classes:2023:game-programing-1:first-term:7</title>
        <description></description>
        <link>https://wiki.yz-learning.com/</link>
        <lastBuildDate>Sat, 04 Apr 2026 16:17:26 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://wiki.yz-learning.com/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
            <title>Yz-Learning Base Wiki</title>
            <link>https://wiki.yz-learning.com/</link>
        </image>
        <item>
            <title>文字の検索</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:7:07-03-1&amp;rev=1688367499</link>
            <description>文字の検索


#include &lt;iostream&gt;
#include &lt;cstring&gt;

using namespace std;
int main(void){
    // 自分の得意な言語で
    // Let&#039;s チャレンジ！！
    char str[100];
    char c;
    cin &gt;&gt; str;
    cin &gt;&gt; c;
    
    int length = strlen(str);
    
    for(int count=1; count &lt;= length; count++)
    {
        //if(str == &quot;paiza&quot;) //できない 文字配列と文字リテラル、文字配列同士の比較はできない。
        if(str[count-1] == c)//配列は０からなんで１個ずらす
            cout &lt;&lt; count &lt;&lt; endl;
    }
    
    return 0;
}…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 03 Jul 2023 06:58:19 +0000</pubDate>
        </item>
        <item>
            <title>フレームレート徒競走</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:7:07-04-4&amp;rev=1688450057</link>
            <description>フレームレート徒競走

フレームレートの違う画面（PC画面145fps、外付けモニタ60fps)でそれぞれ、フレームベースの移動と、時間ベースの移動がどのように変わってくるか確認しよう。



# include &lt;Siv3D.hpp&gt; // OpenSiv3D v0.6.10

Vec2 dPos = { 0,200 }; //ドラゴンの初期位置
Vec2 cPos = { 0,300 }; //ラクダさんの初期位置
Vec2 dVelocity = { 2, 0 };//1frameに2pixel 進む　60fps なので 1s で120pixel
Vec2 cVelocity = { 120, 0 };//1s に 120pixel

void Update()
{
	//場所などの更新処理
	dPos = dPos + dVelocity;
	cPos = cPos + Scene::DeltaTime() * cVelocity;
}

void Draw()
{
	//描画関係の処理
	TextureAsset(U&quot;dragon&quot;).mirrored().resized(6…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 04 Jul 2023 05:54:17 +0000</pubDate>
        </item>
        <item>
            <title></title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:7:07-06-3&amp;rev=1688632705</link>
            <description>車画像の回転(```carImg.rotated(回転角度)```)は、画像の座標軸での回転方向（＋が時計回り(clockwise))

数学座標での回転```Vec2 RotateVec(Vec2 _vec, double _angle)```は、＋方向の回転が反時計回り（reverse clockwise)になる。</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 06 Jul 2023 08:38:25 +0000</pubDate>
        </item>
        <item>
            <title>ライバルカーうろうろ</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:7:07-10-4&amp;rev=1688977149</link>
            <description># include &lt;Siv3D.hpp&gt; // OpenSiv3D v0.6.10

const double PI = 3.14159265359;
const double vLength = 60.0;

/// @brief 数学の座標をスクリーン座標に変換する関数
/// @param _point 変換前の数学座標
/// @return 変換されたスクリーン座標
Vec2 ConvertMath2Screen(Vec2 _point)
{
	Vec2 resultPoint;
	Vec2 halfScrSize = { Scene::Width() / 2.0, Scene::Height() / 2.0 };
	resultPoint.x = _point.x + halfScrSize.x;
	resultPoint.y = Scene::Height() - (_point.y + halfScrSize.y);
	return resultPoint;
}

/// @param _angle 角度を入力
/// @return  ラジアンに変換された値
dou…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 10 Jul 2023 08:19:09 +0000</pubDate>
        </item>
        <item>
            <title>構造体の宣言と構造体型の変数</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:7:07-10-123&amp;rev=1688961921</link>
            <description>授業メモ



レコード型（一般形）
　・複数の変数をパッキングしたもの

おべんとう
　→主食
	・白米
　→おかず
　　・卵焼き
　　・たこさんウィンナー
　　・回鍋肉
　　・ほうれんそうのおひたし

一つのキャラクターやオブジェクトに関連する複数の変数たちを、ばらばらに扱っていくのはしんどい
→お弁当箱に詰めればいいじゃん。

RAV4の色は？
Eliseの値段は？

レコード型をC++,C言語などで表現する方法　→ 構造体

Vec2 v = {2, 3};//構造体
v.x = 2;↑これと一緒
v.y = 3;

v{ x, y}
v.x 
v.y

P1(x1,y1) P2(x2,y2)の距離
distance = √{(x2-x1)^2 + (y2-y1)^2}

struct 構造体名
{
	メンバを並べる。;
};

構造体名　変数名;
構造体型の変数ができる。
変数名.メンバ名
でメンバにアクセス（代入、読み出し）
//構造体の話ここまで

関数
・何度も呼ばれる処理をサブルーチンとして書いておく
→値を返すタイプのサブルーチン：ファンクション（関数）
→値を返さ…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 10 Jul 2023 04:05:21 +0000</pubDate>
        </item>
        <item>
            <title></title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:7:07-12-4&amp;rev=1689147468</link>
            <description>ライバルカーから見た視点を考える



OA・OB = |OA||OB|cosθ
|OA|=1
|OB|=1のとき
OA・OB = 1*1*cosθ = cosθ

 OA・OB
-------- = cosθ
|OA||OB|

OA={x1, y1}
OB={x2, y2}
OA・OB = x1*x2+y1*y2

	//車の基本方向を表すベクトル
	Vec2 sVec;
	//車の進行方向ベクトル
	Vec2 transVec;
	//車の位置 位置ベクトル Vec2
	Vec2 carPosition;
	//車の向き 回転角度 double
	double carRot;
	//車のスピード pixel/sec
	double speed;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 12 Jul 2023 07:37:48 +0000</pubDate>
        </item>
        <item>
            <title>いろいろ補足</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:7:07-14-xx&amp;rev=1689756407</link>
            <description>いろいろ補足

今やっていること

	*  方向ベクトルと、位置ベクトル、スピードを使ってキャラクタ移動させる
		*  数学・物理
			*  ベクトルの足し算・引き算
			*  ベクトルとスカラーの掛け算</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 19 Jul 2023 08:46:47 +0000</pubDate>
        </item>
        <item>
            <title>atan2を使って、ベクトルの傾きを出し、三角形を回してゆくぅ</title>
            <link>https://wiki.yz-learning.com/doku.php?id=game-engineer:classes:2023:game-programing-1:first-term:7:07-18-45&amp;rev=1689752395</link>
            <description>Console.open();
	//double cos_theta = 1.0;
	double theta;
	double deg;

	//for (cos_theta = -1; cos_theta &lt;= 2; cos_theta += 0.1)
	//{
	//	theta = asin(cos_theta);
	//	deg = theta * (180.0 / PI);
	//	std::cout &lt;&lt;&quot;sin(θ)=&quot; &lt;&lt; cos_theta&lt;&lt; &quot;の時 θ＝&quot; &lt;&lt;  theta &lt;&lt; &quot;(&quot; &lt;&lt; deg &lt;&lt; &quot;度)&quot; &lt;&lt; std::endl;
	//}
	Vec2 v;
	v.x = sqrt(3.0);
	v.y = 1.0;
	theta = atan2(v.y, v.x);
	deg = theta * (180.0 / PI);
	std::cout &lt;&lt; &quot;x, y = &quot; &lt;&lt; v.x &lt;&lt; &quot;, &quot; &lt;&lt; v.y &lt;&lt; &quot;の時 θ＝&quot; &lt;&lt; theta &lt;&lt; &quot;(&quot; &lt;&lt; deg &lt;&lt; &quot;度)&quot; &lt;&lt; std::endl;…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 19 Jul 2023 07:39:55 +0000</pubDate>
        </item>
    </channel>
</rss>
