Skip to content

Commit

Permalink
色んなトランジションを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
boxerprogrammer committed Jan 23, 2024
1 parent 7fbfbc0 commit b17cd7e
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 26 deletions.
2 changes: 2 additions & 0 deletions JsonToBinary/jikki/PauseMenu/PauseMenu.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
<ClCompile Include="Enemy\Slime.cpp" />
<ClCompile Include="StringUtility.cpp" />
<ClCompile Include="Transition\Transitor.cpp" />
<ClCompile Include="Transition\WipeTransitor.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Application.h" />
Expand Down Expand Up @@ -200,6 +201,7 @@
<ClInclude Include="Enemy\Slime.h" />
<ClInclude Include="StringUtility.h" />
<ClInclude Include="Transition\Transitor.h" />
<ClInclude Include="Transition\WipeTransitor.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="PauseMenu.rc" />
Expand Down
6 changes: 6 additions & 0 deletions JsonToBinary/jikki/PauseMenu/PauseMenu.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@
<ClCompile Include="Transition\PushTransitor.cpp">
<Filter>ソース ファイル</Filter>
</ClCompile>
<ClCompile Include="Transition\WipeTransitor.cpp">
<Filter>ソース ファイル</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Scene\SceneManager.h">
Expand Down Expand Up @@ -230,6 +233,9 @@
<ClInclude Include="Transition\PushTransitor.h">
<Filter>ヘッダー ファイル</Filter>
</ClInclude>
<ClInclude Include="Transition\WipeTransitor.h">
<Filter>ヘッダー ファイル</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="PauseMenu.rc">
Expand Down
4 changes: 4 additions & 0 deletions JsonToBinary/jikki/PauseMenu/Scene/GameScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include"../Transition/TileTransitor.h"
#include"../Transition/FallTileTransitor.h"
#include"../Transition/IrisTransitor.h"
#include"../Transition/WipeTransitor.h"
void GameScene::InitializeUpdate(Input& input)
{
auto& app = Application::GetInstance();
Expand Down Expand Up @@ -248,6 +249,9 @@ drawFunc_ (&GameScene::InitializeDraw)
{
static int count = 0;
std::vector<std::function<std::shared_ptr<Transitor>(void)>> transitMakers;
transitMakers.push_back([]() {
return std::make_shared<WipeTransitor>();
});
transitMakers.push_back([]() {
return std::make_shared<FadeTransitor>();
});
Expand Down
8 changes: 4 additions & 4 deletions JsonToBinary/jikki/PauseMenu/Transition/IrisTransitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ class IrisTransitor:
{
private:
int width_ = 100;
int handleForMaskScreen_;
int maskH_;
float diagonalLength_;
bool irisOut_=false;
int handleForMaskScreen_;//マスク転送用グラフィックハンドル
int maskH_;//マスクハンドル
float diagonalLength_;//対角線の長さ
bool irisOut_=false;//アイリスアウトフラグ(falseならアイリスイン)
int gHandle_=-1;
bool isTiled_ = false;
public:
Expand Down
10 changes: 5 additions & 5 deletions JsonToBinary/jikki/PauseMenu/Transition/PushTransitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include<DxLib.h>
#include"../Application.h"

PushTransitor::PushTransitor(PushDirection dir, int interval):direction_(dir),Transitor(interval)
PushTransitor::PushTransitor(TransitDirection dir, int interval):direction_(dir),Transitor(interval)
{
}

Expand Down Expand Up @@ -31,16 +31,16 @@ void PushTransitor::Draw()
int endX=0;
int endY=0;
switch (direction_) {
case PushDirection::left:
case TransitDirection::left:
endX = -wsize.w;
break;
case PushDirection::right:
case TransitDirection::right:
endX = wsize.w;
break;
case PushDirection::up:
case TransitDirection::up:
endY = -wsize.h;
break;
case PushDirection::down:
case TransitDirection::down:
endY = wsize.h;
break;

Expand Down
12 changes: 3 additions & 9 deletions JsonToBinary/jikki/PauseMenu/Transition/PushTransitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,11 @@
class PushTransitor :
public Transitor
{
public:
enum class PushDirection {
up,
down,
right,
left
};

private:
PushDirection direction_;//ƒvƒbƒVƒ…•ûŒü
TransitDirection direction_;//ˆÚ“®•ûŒü
public:
PushTransitor(PushDirection dir=PushDirection::up, int interval = 60);
PushTransitor(TransitDirection dir=TransitDirection::up, int interval = 60);
virtual void Update() override;
virtual void Draw() override;
};
Expand Down
2 changes: 1 addition & 1 deletion JsonToBinary/jikki/PauseMenu/Transition/StripTransitor.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#include "Transitor.h"
//’Zûƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“
//短冊トランジション(縦縞)
class StripTransitor :
public Transitor
{
Expand Down
4 changes: 0 additions & 4 deletions JsonToBinary/jikki/PauseMenu/Transition/TileTransitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Transitor(interval)
tiles_.push_back({xidx,yidx});
}
}

}

void TileTransitor::Update()
Expand All @@ -35,7 +34,6 @@ void TileTransitor::Update()
if (IsEnd()) {
return;
}
//std::uniform_int_distribution<int> uid(0, tiles_.size() - 1);
std::shuffle(tiles_.begin(), tiles_.end(),mt_);
const auto& wsize = Application::GetInstance().GetWindowSize();
int xnum = (wsize.w / cellSize_) + 1;
Expand All @@ -47,8 +45,6 @@ void TileTransitor::Update()
else {
tiles_.clear();
}


}

void TileTransitor::Draw()
Expand Down
6 changes: 3 additions & 3 deletions JsonToBinary/jikki/PauseMenu/Transition/TileTransitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#include "Transitor.h"
#include<vector>
#include<random>
/// <summary>
/// タイル状切り替え(ディゾルヴトランジションとも)
/// </summary>
class TileTransitor :
public Transitor
{
Expand All @@ -12,12 +15,9 @@ class TileTransitor :
};
std::mt19937 mt_;
std::vector<XYIdx> tiles_;
//float g_;
//std::vector<float> vys_;
public:
TileTransitor(int cellSize = 50, int interval = 60);
virtual void Update() override;
virtual void Draw() override;

};

8 changes: 8 additions & 0 deletions JsonToBinary/jikki/PauseMenu/Transition/Transitor.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#pragma once

enum class TransitDirection {
up,
down,
right,
left
};

/// <summary>
/// シーン遷移時演出基底クラス
/// </summary>
Expand Down

0 comments on commit b17cd7e

Please sign in to comment.