Skip to content
This repository has been archived by the owner on Jun 3, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/1.1_e'
Browse files Browse the repository at this point in the history
  • Loading branch information
su8ru committed Jun 15, 2019
2 parents df7e954 + b64b438 commit 4eb9508
Show file tree
Hide file tree
Showing 21 changed files with 86 additions and 61 deletions.
6 changes: 5 additions & 1 deletion SpaceWars2/CommonData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ namespace Data {
KeyRepeat RKeyBack = KeyRepeat(false, L"KeyBack");
KeyRepeat LKeySelect = KeyRepeat(true, L"KeySelect");
KeyRepeat RKeySelect = KeyRepeat(false, L"KeySelect");
KeyRepeat LKeyCancel = KeyRepeat(true, L"KeyCancel");
KeyRepeat RKeyCancel = KeyRepeat(false, L"KeyCancel");
KeyRepeat KeyUp = KeyRepeat(L"KeyUp");
KeyRepeat KeyLeft = KeyRepeat(L"KeyLeft");
KeyRepeat KeyDown = KeyRepeat(L"KeyDown");
KeyRepeat KeyRight = KeyRepeat(L"KeyRight");
};
KeyRepeat KeySelectUp = KeyRepeat(L"KeySelectUp");
KeyRepeat KeySelectDown = KeyRepeat(L"KeySelectDown");
}
6 changes: 5 additions & 1 deletion SpaceWars2/CommonData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ namespace Data {
extern KeyRepeat RKeyBack;
extern KeyRepeat LKeySelect;
extern KeyRepeat RKeySelect;
extern KeyRepeat LKeyCancel;
extern KeyRepeat RKeyCancel;
extern KeyRepeat KeyUp;
extern KeyRepeat KeyLeft;
extern KeyRepeat KeyDown;
extern KeyRepeat KeyRight;
};
extern KeyRepeat KeySelectUp;
extern KeyRepeat KeySelectDown;
}
4 changes: 2 additions & 2 deletions SpaceWars2/Config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace Config {
// version
const String VERSION = L"1.1_d";
const int VER_NUM = 19061423;
const String VERSION = L"1.1_e";
const int VER_NUM = 19061511;

// タイトル
const String TITLE = L"SpaceWars 2";
Expand Down
3 changes: 3 additions & 0 deletions SpaceWars2/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "Config.hpp"
#include "CommonData.hpp"
#include "functions/Asset.hpp"
#include "functions/Utils.hpp"

// Scenes
#include "scenes/Title.hpp"
Expand All @@ -22,6 +23,7 @@ void Main() {
TextureAsset::Register(L"title-button", L"/7110");
TextureAsset::Register(L"title-button-hidden", L"/7111");
TextureAsset::Register(L"license" , L"/7200");
TextureAsset::Register(L"license-s" , L"/7201");
TextureAsset::Register(L"buttonA_24" , L"/7800");
TextureAsset::Register(L"buttonB_24" , L"/7801");
// TextureAsset::Register(L"buttonX_24" , L"/7802");
Expand Down Expand Up @@ -72,5 +74,6 @@ void Main() {
while (System::Update()){
manager.updateAndDraw();
Debug::DebugModeWarning();
Utils::ChangeFullScreen();
}
}
1 change: 1 addition & 0 deletions SpaceWars2/Resource.rc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
7111 FILE "assets/title-button-hidden.png"

7200 FILE "assets/license.png"
7201 FILE "assets/license-s.png"

7300 FILE "assets/keyboard.png"
7310 FILE "assets/controller.png"
Expand Down
2 changes: 2 additions & 0 deletions SpaceWars2/SpaceWars2.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
<ClCompile Include="functions\SkillDescription.cpp" />
<ClCompile Include="functions\SpecialSkill.cpp" />
<ClCompile Include="functions\SubSkill.cpp" />
<ClCompile Include="functions\Utils.cpp" />
<ClCompile Include="functions\Vec2Utils.cpp" />
<ClCompile Include="functions\XInput.cpp" />
<ClCompile Include="Main.cpp" />
Expand Down Expand Up @@ -319,6 +320,7 @@
<ClInclude Include="functions\MainSkill.hpp" />
<ClInclude Include="functions\Player.hpp" />
<ClInclude Include="functions\SkillDescription.hpp" />
<ClInclude Include="functions\Utils.hpp" />
<ClInclude Include="functions\Vec2Utils.hpp" />
<ClInclude Include="functions\XInput.hpp" />
<ClInclude Include="scenes\Include.hpp" />
Expand Down
8 changes: 7 additions & 1 deletion SpaceWars2/SpaceWars2.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,9 @@
<ClCompile Include="Scenes\Title.cpp">
<Filter>ソース ファイル</Filter>
</ClCompile>
<ClCompile Include="functions\Utils.cpp">
<Filter>ソース ファイル</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="CommonData.hpp">
Expand Down Expand Up @@ -622,5 +625,8 @@
<ClInclude Include="fontPlus\FontP.hpp">
<Filter>ヘッダー ファイル</Filter>
</ClInclude>
<ClInclude Include="functions\Utils.hpp">
<Filter>ヘッダー ファイル</Filter>
</ClInclude>
</ItemGroup>
</Project>
</Project>
Binary file added SpaceWars2/assets/Honeyview_License-s.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SpaceWars2/assets/license-s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified SpaceWars2/assets/title-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 7 additions & 9 deletions SpaceWars2/functions/Debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
String Debug::InputFnKey(){
String sceneName = L"";

# ifdef _DEBUG
if (Input::KeyF1.clicked) sceneName = L"Title";
if (Input::KeyF2.clicked) sceneName = L"ControlGuidance";
if (Input::KeyF3.clicked) sceneName = L"ScreenGuidance";
if (Input::KeyF4.clicked) sceneName = L"SkillSelect";
if (Input::KeyF5.clicked) sceneName = L"Game";
if (Input::KeyF6.clicked) sceneName = L"Game";
if (Input::KeyF7.clicked) sceneName = L"Game";
# endif
if (Input::KeyF1.clicked) sceneName = L"Title";
if (Input::KeyF2.clicked) sceneName = L"ControlGuidance";
if (Input::KeyF3.clicked) sceneName = L"ScreenGuidance";
if (Input::KeyF4.clicked) sceneName = L"SkillSelect";
if (Input::KeyF5.clicked) sceneName = L"Game";
if (Input::KeyF6.clicked) sceneName = L"Game";
if (Input::KeyF7.clicked) sceneName = L"Game";

return sceneName;
}
Expand Down
2 changes: 1 addition & 1 deletion SpaceWars2/functions/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ bool Player::skillSelect() {
if (selectedType != 0) {
if (
KeyLeft.repeat(20, true) ||
(isLeft ? Data::LKeyBack.repeat(20, true) : Data::RKeyBack.repeat(20, true))
(isLeft ? Data::LKeyCancel.repeat(20, true) : Data::RKeyCancel.repeat(20, true))
) {
--selectedType;
returnFlag = true;
Expand Down
8 changes: 8 additions & 0 deletions SpaceWars2/functions/Utils.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <Siv3D.hpp>
#include "./Utils.hpp"

void Utils::ChangeFullScreen() {
const Size size(1280, 720);
if (Input::KeyF11.clicked)
Window::SetFullscreen(!Window::IsFullSceen(), size);
}
6 changes: 6 additions & 0 deletions SpaceWars2/functions/Utils.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once
#include <Siv3D.hpp>

namespace Utils {
void ChangeFullScreen();
};
24 changes: 15 additions & 9 deletions SpaceWars2/functions/XInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,18 @@ void GamePad::SetButton() {
input.addButton(L"R_KeyDown", s3d::Input::KeyL | s3d::Input::KeyDown | XInput(1).buttonDown);
input.addButton(L"R_KeyRight", s3d::Input::KeySemicolon | s3d::Input::KeyRight | XInput(1).buttonRight);

// SkillSelect
input.addButton(L"KeySelectUp", s3d::Input::KeyW | s3d::Input::KeyO | s3d::Input::KeyUp);
input.addButton(L"KeySelectDown", s3d::Input::KeyS | s3d::Input::KeyL | s3d::Input::KeyDown);

// 操作
input.addButton(L"KeyEnter", s3d::Input::KeyEnter | XInput(0).buttonA | XInput(1).buttonA);
input.addButton(L"L_KeyBack", s3d::Input::KeyLControl | s3d::Input::KeyBackspace | s3d::Input::KeyEnd | XInput(0).buttonB);
input.addButton(L"R_KeyBack", s3d::Input::KeyRControl | s3d::Input::KeyBackspace | s3d::Input::KeyEnd | XInput(1).buttonB);
input.addButton(L"L_KeySelect", s3d::Input::KeyLShift | XInput(0).buttonA);
input.addButton(L"R_KeySelect", s3d::Input::KeyRShift | XInput(1).buttonA);
input.addButton(L"KeyEnter", s3d::Input::KeyEnter | s3d::Input::KeyEnter);
input.addButton(L"L_KeyBack", s3d::Input::KeyLControl | s3d::Input::KeyBackspace);
input.addButton(L"R_KeyBack", s3d::Input::KeyRControl | s3d::Input::KeyBackspace);
input.addButton(L"L_KeySelect", s3d::Input::KeyLShift | XInput(0).buttonA);
input.addButton(L"R_KeySelect", s3d::Input::KeyRShift | XInput(1).buttonA);
input.addButton(L"L_KeyCancel", s3d::Input::KeyLControl | s3d::Input::KeyEnd | XInput(0).buttonB);
input.addButton(L"R_KeyCancel", s3d::Input::KeyRControl | s3d::Input::KeyEnd | XInput(1).buttonB);
}


Expand Down Expand Up @@ -121,8 +127,8 @@ bool GamePad::Key(bool _isLeft, const String& _name) {
if(_name == L"KeyRight")
return input.button(lr + L"_KeyRight").pressed || input.axis(lr + L"_CtrlX") > 0.8;

if (_name == L"KeyBack")
return input.button(lr + L"_KeyBack").pressed
if (_name == L"KeyCancel")
return input.button(lr + L"_KeyCancel").pressed
|| XInput((int)!_isLeft). leftTrigger > 0.5
|| XInput((int)!_isLeft).rightTrigger > 0.5
|| s3d::Input::KeyBackspace.pressed;
Expand All @@ -146,8 +152,8 @@ bool GamePad::Key(const String& _name) {
if (_name == L"KeyRight")
return input.button(L"L_KeyBack").pressed || input.button(L"R_KeyBack").pressed || input.axis(L"L_CtrlX") > 0.8 || input.axis(L"R_CtrlX") > 0.8;

if (_name == L"KeyBack")
return input.button(L"L_KeyBack").pressed || input.button(L"R_KeyBack").pressed || XInput(0).leftTrigger > 0.5 || XInput(0).rightTrigger > 0.5 || XInput(0).leftTrigger > 0.5 || XInput(0).rightTrigger > 0.5;
if (_name == L"KeyCancel")
return input.button(L"L_KeyCancel").pressed || input.button(L"R_KeyCancel").pressed || XInput(0).leftTrigger > 0.5 || XInput(0).rightTrigger > 0.5 || XInput(0).leftTrigger > 0.5 || XInput(0).rightTrigger > 0.5;

if (input.hasButton(L"L_" + _name) && input.hasButton(L"R_" + _name))
return input.button(L"L_" + _name).pressed || input.button(L"R_" + _name).pressed;
Expand Down
7 changes: 1 addition & 6 deletions SpaceWars2/scenes/ControlGuidance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void ControlGuidance::update() {
SoundAsset(L"move1").playMulti();
}
if (Data::KeyBack.repeat(20)) {
if (status != KEY) {
if (status != CONTROLLER) {
status = (ControlType)(status - 1);
SoundAsset(L"move1").setVolume(Config::MASTER_VOLUME * Config::CURSOR_VOLUME);
SoundAsset(L"move1").playMulti();
Expand Down Expand Up @@ -88,11 +88,6 @@ void ControlGuidance::draw() const {
break;
}
}

// 右下操作方法表示
Vec2 buttonPos(1190, 692);
buttonPos.x += (int)TextureAsset(L"buttonA_24").draw(buttonPos).w + 6;
buttonPos.x += (int)CicaR::Get(C12)(L"次へ").draw(buttonPos).w + 15;
}


Expand Down
2 changes: 1 addition & 1 deletion SpaceWars2/scenes/ControlGuidance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ enum ControlType {

class ControlGuidance final : public SceneManager<String, CommonData>::Scene {
private:
ControlType status = KEY;
ControlType status = CONTROLLER;

static void drawPointLine(Vec2 _root, Vec2 _pos, Color _color = Color(L"#fff"));

Expand Down
16 changes: 7 additions & 9 deletions SpaceWars2/scenes/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ void Game::init() {}
void Game::update() {
changeScene(Debug::InputFnKey(), 100);

# ifdef _DEBUG
if (Input::KeyF5.pressed) status = COUNT_DOWN_INIT;
if (Input::KeyF6.pressed) status = GAME_INIT;
if (Input::KeyF7.pressed) status = FINISH_INIT;
# endif

switch(status) {
case COUNT_DOWN_INIT: {
Expand Down Expand Up @@ -141,13 +139,13 @@ void Game::update() {

bool sound = true;

if (Data::KeyDown.repeat(10, true))
if (Data::KeySelectDown.repeat(10, true))
++selecting;
else if (Data::KeyUp.repeat(10, true))
else if (Data::KeySelectUp.repeat(10, true))
--selecting;
else
sound = false;
selecting = Clamp(selecting, 0, 2);
selecting = Clamp(selecting, 0, 1);
if (sound) {
SoundAsset(L"cursor1").setVolume(Config::MASTER_VOLUME * Config::CURSOR_VOLUME);
SoundAsset(L"cursor1").playMulti();
Expand All @@ -158,10 +156,10 @@ void Game::update() {
SoundAsset(L"click2").playMulti();
switch (selecting) {
case 0:
changeScene(L"SkillSelect", 500);
changeScene(L"Title", 500);
break;
case 1:
changeScene(L"Title", 500);
changeScene(L"SkillSelect", 500);
break;
case 2:
System::Exit();
Expand Down Expand Up @@ -319,9 +317,9 @@ void Game::draw() const {
// 装飾
Line(250, hy - 10, 250, ty + 70).draw(6, ColorF(L"#00BFFF"));

const String text[3] = { L"RESTART", L"TITLE", L"EXIT" };
const String text[3] = { L"TITLE", L"RESTART", L"EXIT"};
for (auto i : step(3)) {
SmartUI::Get(S28)(text[i]).draw(Arg::leftCenter, { 280, 540 + 65 * i });
SmartUI::Get(S28)(text[i]).draw(Arg::leftCenter, { 280, 540 + 65 * i }, ColorF(L"#fff").setAlpha(i<2 ? 1 : 0.4));
if (i == selecting) {
Geometry2D::CreateNgon(3, 13, 90_deg, { 245, 540 + selecting * 65 }).draw();
}
Expand Down
6 changes: 0 additions & 6 deletions SpaceWars2/scenes/ScreenGuidance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,5 @@ void ScreenGuidance::draw() const {
}

SmartUI::Get(S28)(description[status], L"").draw(tl + Vec2(0, 280), frameColor[status]);


// 右下操作方法表示
Vec2 buttonPos(1190, 692);
buttonPos.x += (int)TextureAsset(L"buttonA_24").draw(buttonPos).w + 6;
buttonPos.x += (int)CicaR::Get(C12)(L"次へ").draw(buttonPos).w + 15;
}

4 changes: 2 additions & 2 deletions SpaceWars2/scenes/SkillSelect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ void SkillSelect::update() {
SoundAsset(L"click1").setVolume(Config::MASTER_VOLUME * Config::CURSOR_VOLUME);
SoundAsset(L"click1").playMulti();
}
if (LReady && Data::LKeyBack.repeat(20, true)) LReady = false;
if (RReady && Data::RKeyBack.repeat(20, true)) RReady = false;
if (LReady && Data::LKeyCancel.repeat(20, true)) LReady = false;
if (RReady && Data::RKeyCancel.repeat(20, true)) RReady = false;

// 機体の処理
for (int isLeft = 0; isLeft < 2; isLeft++) {
Expand Down
26 changes: 13 additions & 13 deletions SpaceWars2/scenes/Title.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ void Title::init() {
void Title::update(){
changeScene(Debug::InputFnKey(), 100);

if (Data::KeyUp.repeat(20, true) && selecting > 0) {
if (Data::KeySelectUp.repeat(20, true) && selecting > 0) {
--selecting;
SoundAsset(L"cursor1").setVolume(Config::MASTER_VOLUME * Config::CURSOR_VOLUME);
SoundAsset(L"cursor1").playMulti();
}
if (Data::KeyDown.repeat(20, true) && selecting < 3) {
if (Data::KeySelectDown.repeat(20, true) && selecting < 1) {
++selecting;
SoundAsset(L"cursor1").setVolume(Config::MASTER_VOLUME * Config::CURSOR_VOLUME);
SoundAsset(L"cursor1").playMulti();
Expand Down Expand Up @@ -50,25 +50,25 @@ void Title::update(){

}

void Title::draw() const{
void Title::draw() const {
TextureAsset(L"background").resize(Window::Size()).draw();
TextureAsset(L"title-logo").drawAt(Window::Center().x, 150);
TextureAsset(L"title-logo").drawAt(Window::Center().x + 50, 150);

Circle(1180, 1080, 760).drawFrame(5, 5, Color(L"#00bfff"));

const String name[4] = { L"START", L"GAME", L"LICENSE", L"EXIT" };
for (auto i : step(4)) {
for (auto i : step(2)) {
TextureAsset(i == selecting ? L"title-button" : L"title-button-hidden").draw(950, 400 + 70 * i);
SmartUI::Get(S28)(name[i]).draw({ 980, 398 + 70 * i }, (i == selecting ? Color(L"#fff") : Color(L"#ccc")));
SmartUI::Get(S28)(name[i]).draw({ 980, 398 + 70 * i }, i == selecting ? ColorF(L"#fff") : ColorF(L"#ccc"));
}

Rect(0, 690, 220, 30).draw(ColorF(L"#000").setAlpha(0.5));
CicaR::Get(C12)(Config::VERSION, L" / ", Config::VER_NUM).draw({ 10, 695 });
for (int i = 2; i < 4; i++) {
TextureAsset(L"title-button-hidden").draw(950, 400 + 70 * i, ColorF(L"#fff").setAlpha(0.4));
SmartUI::Get(S28)(name[i]).draw({ 980, 398 + 70 * i }, ColorF(L"#ccc").setAlpha(0.4));
}

Vec2 buttonPos(1165, 692);
TextureAsset(L"license-s").draw(0, 260);

buttonPos.x += (int)TextureAsset(L"cross_24").draw(buttonPos, Alpha(200)).w + 5;
buttonPos.x += (int)TextureAsset(L"stick_24").draw(buttonPos, Alpha(200)).w + 10;
buttonPos.x += (int)CicaR::Get(C12)(L"/").draw(buttonPos, Alpha(200)).w + 10;
buttonPos.x += (int)TextureAsset(L"buttonA_24").draw(buttonPos, Alpha(200)).w + 6;
Rect(0, 690, 220, 30).draw(ColorF(L"#000").setAlpha(0.5));
CicaR::Get(C12)(Config::VERSION, L" / ", Config::VER_NUM).draw({ 10, 695 });
}

0 comments on commit 4eb9508

Please sign in to comment.