diff --git a/CONTRIBUTING-ja.md b/CONTRIBUTING-ja.md deleted file mode 100644 index 818fde0..0000000 --- a/CONTRIBUTING-ja.md +++ /dev/null @@ -1,64 +0,0 @@ -# コントリビューションの手引き - -[English](CONTRIBUTING.md) - -**コントリビュートにご協力いただきありがとうございます!その前に、このガイドをお読みいただければと思います。** - -## 貢献者へ - -あなたがこのプロジェクトに提供したソースコードには、他のコードと同様に LICENSE ファイルに記載されるライセンスが付与されることに同意してください。 - -## Issue - -新機能の要望やバグ報告などは [GitHub Issues](https://github.com/EbiseLutica/Promete/Issues) にてお願いします。 Issue を作成する前に、重複を避けるため既に存在している同じような Issue が存在しないかどうか検索をしてください。もし存在するならば、リアクションやコメントを用いて upvote してください。 - -## 文書化 - -- 日本語版ドキュメントは `/docs/ja` にあります。 -- 英語版ドキュメントは `/docs/` にあります。 - -## 継続的インテグレーション - -Promete では、 AppVeyor を用いてデプロイの自動化を行っています。設定ファイルは `/appveyor.yml` にあります。 - -## コーディング規則 - -基本的には [C# のコーディング規則(公式)](https://docs.microsoft.com/ja-jp/dotnet/csharp/programming-guide/inside-a-program/coding-conventions) に従います。その上で、次の規約に従うこと - -- インデントは4文字タブ(ハードタブ)にすること。 -- フィールドを `public` にしないこと。 -- `private` を省略しないこと。 -- クラスや構造体のメンバーは次の順番で定義すること。 - - プロパティ - - コンストラクター - - 複数存在する場合は、仮引数の少ない順に並べること。 - - メソッド - - オーバーライドされたメソッド - - フィールド - - ネストされたクラス, 構造体, インターフェイス - - デリゲート -- メソッドをオーバーロードする場合は連続して配置すること。 -- 文字列変数は基本的に Null 非許容とし、初期値として空文字列を挿入すること。 - -## 設計上の規則 - -### 公開APIをSilk.NET等の外部ライブラリに依存させないこと - -Prometeでは、Silk.NET等のバックエンドに依存しないようAPIを設計しています。 - -新しくAPIを追加する場合、このようなバックエンドにある型を引数や戻り値に使用しないでください。内部的に使う場合や、private、internalなメンバーの場合は使用しても良いです。 - -## デプロイ手順 - -デプロイはメイン開発者の @EbiseLutica が行います。従ってこの項目はフォークされたプロジェクトの管理者向けの情報となります。 - -1. 最新版の変更がビルドできて、サンプルコードに不具合が発生しないことを確認する -1. master に最新版をコミットする -1. Promete/Promete.nuspec 内のバージョン表記を書き換える -1. appveyor.yml 内のバージョン表記を書き換える -1. 上記の変更をコミットする -1. そのコミットにバージョン名のタグをつける -1. push する -1. :pray: - -## デプロイに問題が起きた場合 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 92705a6..485f032 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,64 +1,60 @@ -# Contribution guide +# コントリビューションの手引き -[日本語](CONTRIBUTING-ja.md) +**コントリビュートにご協力いただきありがとうございます!その前に、このガイドをお読みいただければと思います。** -Thanks for contributing! Before that, please read this guide. +## 貢献者へ -## To Conrtibutors - -Please agree that the source code you provided for this project will be licensed as described in the LICENSE file as same as other code. +あなたがこのプロジェクトに提供したソースコードには、他のコードと同様に LICENSE ファイルに記載されるライセンスが付与されることに同意してください。 ## Issue -If you want me to add new features or find bugs, please post it to [GitHub Issues](https://github.com/EbiseLutica/Promete/Issues). Before making Issue, to avoid duplication, please make sure there are no same issues. If exists, upvote it by using reactions or comments. +新機能の要望やバグ報告などは [GitHub Issues](https://github.com/EbiseLutica/Promete/Issues) にてお願いします。 Issue を作成する前に、重複を避けるため既に存在している同じような Issue が存在しないかどうか検索をしてください。もし存在するならば、リアクションやコメントを用いて upvote してください。 -## Documentation +## 文書化 -- Japanese document: `/docs/ja` -- English document: `/docs/` +作成中。 -## Continuous Integration +## 継続的インテグレーション -Promete uses AppVeyor to automatic deployment. Its configuration is in `/appveyor.yml`. +Promete では、 GitHub Actions を用いてデプロイの自動化を行っています。設定ファイルは `.github/workflow` にあります。 -## Coding Style +## コーディング規則 -Basically I compliant [C# Coding Conventions (Official)](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/inside-a-program/coding-conventions). Moreover, follow the rules below: +基本的には [C# のコーディング規則(公式)](https://docs.microsoft.com/ja-jp/dotnet/csharp/programming-guide/inside-a-program/coding-conventions) に従います。その上で、次の規約に従うこと -+ Use 4-character tabs for indentation -+ DON'T make fields `public` -+ Define members of classes and structs the following orders: - + Properties - + Constructor(s) - + If have many ones, arrange in ascending order of arguments. - + Methods - + Overridden Methods - + Fields - + Nested classes, structs and interfaces - + Delegates -+ If you overload methods, locate them adjacently. -+ Define an entrypoint method in a dedicated `static` class. -+ Make string-variables non-null, and initialize them with empty string. +- インデントは4文字タブ(ハードタブ)にすること。 +- フィールドを `public` にしないこと。 +- アクセス修飾子は必ず省略しないこと。 +- クラスや構造体のメンバーは次の順番で定義すること。 + - プロパティ + - フィールド + - コンストラクター + - 複数存在する場合は、仮引数の少ない順に並べること。 + - メソッド + - オーバーライドされたメソッド + - ネストされたクラス, 構造体, インターフェイス + - デリゲート +- メソッドをオーバーロードする場合は連続して配置すること。 +- 文字列変数は基本的に Null 非許容とし、初期値として空文字列を挿入すること。 -## Design Guideline +## 設計上の規則 -### DO NOT make public API dependent on external libraries such as Silk.NET +### 公開APIをSilk.NET等の外部ライブラリに依存させないこと -Promete API is designed to be backend (such as Silk.NET) independent. +Prometeでは、Silk.NET等のバックエンドに依存しないようAPIを設計しています。 -Do not use the type in the backend for arguments or return value of the newly added API. +新しくAPIを追加する場合、このようなバックエンドにある型を引数や戻り値に使用しないでください。 +内部的に使う場合、プラグイン向けの場合や、private、internalなメンバーの場合は使用しても良いです。 -However, it is allowed to be used internally or for private or internal members. +## デプロイ手順 -## To deploy +デプロイはメイン開発者の @EbiseLutica が行います。従ってこの項目はフォークされたプロジェクトの管理者向けの情報となります。 -This project is always deployed by @Xeltica, a main developer. So this note is for forked projects' maintainers. +1. 最新版の変更がビルドできて、サンプルコードに不具合が発生しないことを確認する +2. master に最新版をコミットする +3. Promete/Promete.csproj 内のバージョン表記を書き換える +4. 上記の変更をコミットする +5. push する +6. :pray: -1. Make sure latest changes can be built and there is no wrong behaviors in sample code. -1. Commit latest to master -1. Rewrite version number at Promete/Promete.nuspec -1. Rewrite version number at appveyor.yml -1. Commit changes of 3. and 4. -1. Add a tag named as version number to the commit. -1. Push it -1. :pray: +## デプロイに問題が起きた場合 diff --git a/Promete.sln.DotSettings b/Promete.sln.DotSettings index d56d2c4..3600dd0 100644 --- a/Promete.sln.DotSettings +++ b/Promete.sln.DotSettings @@ -1,2 +1,3 @@  - GL \ No newline at end of file + GL + True \ No newline at end of file diff --git a/README-ja.md b/README-ja.md deleted file mode 100644 index 399c17f..0000000 --- a/README-ja.md +++ /dev/null @@ -1,66 +0,0 @@ -# Promete - -[![GitHub Releases](https://img.shields.io/github/release-pre/ebiselutica/Promete.svg?style=for-the-badge)][releases] -[![Nuget](https://img.shields.io/nuget/vpre/Promete.svg?style=for-the-badge)](https://www.nuget.org/packages/Promete/) - -Promete Engine は、 C# と .NET 8 のための、軽量で汎用的な2Dゲームエンジンです。 - -[README is also available in English!](README.md) - -## ビルドの仕方 - -```shell -git clone https://github.com/EbiseLutica/Promete -cd Promete -dotnet build -``` - -## サポートされるプラットフォーム - -- Windows -- macOS -- GNU/Linux - -## 機能 - -- 軽快な処理 -- 2Dに特化したグラフィックシステム - - スプライト - 画面上へのテクスチャ表示 - - タイルマップ - テクスチャを敷き詰めたマップ表示 - - グラフィック - 線分や矩形を1ピクセル単位で描画 - - コンテナー - 描画要素を格納できるオブジェクト - - テキスト - 文字列を描画できるオブジェクト - - 9スライススプライト - テクスチャを9分割して、矩形状のテクスチャ−をスムーズに引き伸ばせる特殊なスプライト -- キーボード入力 -- マウス入力 -- スクリーンショット撮影機能 -- 動画作成を支援するための、画面を連番画像でキャプチャーする機能 -- シーン遷移機能 -- 音楽再生 -- 効果音再生 -- 返り値の取得やエラーハンドリングを備えた Unity ライクなコルーチンシステム -- 高い拡張性 - - 独自の描画機能の追加 - - オーディオ機能の拡張 - -## ドキュメント - -WIP - -## コントリビュート - -[コントリビュートの手引き](CONTRIBUTING-ja.md) をご確認ください。 - -[![GitHub issues](https://img.shields.io/github/issues/ebiselutica/promete.svg?style=for-the-badge)][issues] -[![GitHub pull requests](https://img.shields.io/github/issues-pr/ebiselutica/promete.svg?style=for-the-badge)][pulls] - -## ライセンス - -[![License](https://img.shields.io/github/license/ebiselutica/promete.svg?style=for-the-badge)](LICENSE) - -Promete はいくつかのサードパーティソフトウェアに依存しています。ライセンスをご確認ください [THIRD_PARTIES.md](THIRD_PARTIES.md) - -[ci]: https://ci.appveyor.com/project/EbiseLutica/Promete -[issues]: //github.com/EbiseLutica/Promete/issues -[pulls]: //github.com/EbiseLutica/Promete/pulls -[releases]: //github.com/EbiseLutica/Promete/releases diff --git a/README.md b/README.md index e0ebf82..e035346 100644 --- a/README.md +++ b/README.md @@ -1,63 +1,145 @@ # Promete -[![GitHub Releases](https://img.shields.io/github/release/ebiselutica/Promete.svg?style=for-the-badge)][releases] -[![Nuget](https://img.shields.io/nuget/v/Promete.svg?style=for-the-badge)](https://www.nuget.org/packages/Promete/) +[![Nuget](https://img.shields.io/nuget/vpre/Promete.svg?style=for-the-badge)](https://www.nuget.org/packages/Promete/) -Promete Engine is a lightweight cross-platform generic 2D game engine for C#/.NET 8. +Promete Engine は、.NET 8以降を対象とする、2Dグラフィックに特化したゲームエンジンです。 -[日本語でもご覧いただけます。](README-ja.md) +シンプルなAPI、高速な動作、充実した機能、高い拡張性を持ちます。 -## Supported Platform +## 特徴 -- Windows -- macOS -- GNU/Linux +### シンプルなAPI -## To Build +簡潔なエントリポイントからはじめる、シンプルなAPIを提供します。 + +```csharp +var app = PrometeApp.Create() + .Use() + .Use() + .Use() + .BuildWithOpenGLDesktop(); + +app.Run(); +``` + +```csharp +public class MainScene(IWindow window, Keyboard keyboard) +{ + private ITexture texture1; + private ITexture texture2; + + public override Container Setup() + { + texture1 = window.TextureFactory.Load("./texture1.png"); + texture2 = window.TextureFactory.Load("./texture2.png"); + + return new Container + { + new Sprite(texture1, location: (16, 16)), + new Sprite(texture2, location: (16, 32)), + }; + } + + public override void OnUpdate() + { + if (keyboard.Escape.IsKeyDown) + { + window.Close(); + } + } +} +``` + +### 高速な動作 + +C# 12の言語機能を駆使し、なるべくオーバーヘッドを減らした設計を取り入れています。 + +### クロスプラットフォーム + +Windows だけでなく、macOSやLinuxでも動作します。 また、将来的にはAndroidやiOS、Webでも動作する予定です。 + +デフォルトの描画バックエンドはOpenGLを使用していますが、将来的にはVulkanやMetalなどのAPIをサポートし、より高速な描画を実現する予定です。 + +### 2Dに特化したグラフィックシステム + +ピクセルパーフェクトな2Dグラフィックを気軽に実現できるゲームエンジンはそう多くありません。 Prometeは、2Dグラフィックに特化したグラフィックシステムを提供します。 + +Prometeでは、Elementという描画単位を用いた階層構造で画面を構成します。 + +Elementの一覧: + +- スプライト - 画面上へのテクスチャ表示 +- タイルマップ - テクスチャを敷き詰めたマップ表示 +- シェイプ - シンプルな図形の描画 +- コンテナー - 描画要素を格納できるオブジェクト +- テキスト - 文字列を描画できるオブジェクト +- 9スライススプライト - テクスチャを9分割して、矩形状のテクスチャ−をスムーズに引き伸ばせる特殊なスプライト + +各種Elementを描画する上で、エンジンに登録された `ElementRenderer` が用いられます。このレンダラーは特に何もしなくとも標準のものが用いられますが、拡張することも可能です。 + +### 拡張性 + +Prometeは、拡張性を重視して設計されています。 + +標準の描画機能だけでは足りない場合、独自の `ElementRenderer` を実装することで、OpenGLを直接用いた独自のレンダリング機能をPrometeと統合できます。 + +また、オーディオ機能も同様に、定期的にバッファ配列にデータを書き込む `IAudioSource` の実装を作成することで、標準では足りないオーディオ形式をサポートできます。 + +### オーディオ機能 + +BGMから効果音まで、ゲームに欠かせないオーディオ機能を提供します。 + +BGMは特定のポイントを起点としたループ再生に対応しています(これがないエンジンも多い) + +デフォルトではogg vorbisおよびwav形式をサポートしています。オーディオファイルの読み込みはプラグインによって拡張可能です。 + +### プラグインシステム + +Prometeは、DIコンテナを用いたプラグインシステムを採用しています。 + +アプリ初期化時に `Use` メソッドでプラグインを登録することで、その機能が使えるようになります。 + +キーボードやマウスの入力は、例えばPCでは必要かもしれませんが、スマートフォン等では不要な機能です。 +こうした環境の差異を吸収したり、不要な機能を削減して高速化を図れるのが、Prometeのプラグインシステムです。 + +また、ゲーム開発時にはアセットやパラメータの管理クラスを作る必要がしばしば発生します。 +プラグインシステムには任意のクラスを登録することができるので、そういった管理クラスを登録し、シーンをまたいでアクセスする書き方もできます。 + +## サポート プラットフォーム + +| プラットフォーム | サポート状況 | +|----------|------------------------------------| +| Windows | テスト済み。開発者自身がWindows 11で動作を確認しています。 | +| macOS | 動作可能。未テスト | +| Linux | 動作可能。未テスト | +| Android | まだ対応していません。 | +| iOS | まだ対応していません。 | +| Web | まだ対応していません。 | + +## ビルドの仕方 ```shell -git clone https://github.com/EbiseLutica/Promete.git +git clone https://github.com/EbiseLutica/Promete cd Promete dotnet build ``` -## Features - -- Lightweight processing -- 2D-specified Graphics System - - Sprite - Display textures on the screen - - Tilemap - Map textures on the grid - - Graphic - Draw lines, rectangles etc - - Container - An object which can contain other drawables - - Text - An object which can draw text - - 9-slice Sprite - A special sprite to split into 9 sheets to resize smoothly -- A Function to Take Screenshot -- A Feature to capture screen as a serial-numbered pictures -- Scene Management -- Keyboard Input -- Mouse Input -- Playing music -- Playing SFX -- High Extensibility - - Add original rendering method - - Add original audio processor - -## Documents +## ドキュメント WIP -## Contributing +## コントリビュート -Please see [Contribution Guide](CONTRIBUTING.md). +[コントリビュートの手引き](CONTRIBUTING-ja.md) をご確認ください。 -[![GitHub issues](https://img.shields.io/github/issues/EbiseLutica/Promete.svg?style=for-the-badge)][issues] -[![GitHub pull requests](https://img.shields.io/github/issues-pr/EbiseLutica/Promete.svg?style=for-the-badge)][pulls] +[![GitHub issues](https://img.shields.io/github/issues/ebiselutica/promete.svg?style=for-the-badge)][issues] +[![GitHub pull requests](https://img.shields.io/github/issues-pr/ebiselutica/promete.svg?style=for-the-badge)][pulls] -## LICENSE +## ライセンス -[![License](https://img.shields.io/github/license/EbiseLutica/Promete.svg?style=for-the-badge)](LICENSE) +[![License](https://img.shields.io/github/license/ebiselutica/promete.svg?style=for-the-badge)](LICENSE) -Promete depends on several third-party software. See these licenses: [THIRD_PARTIES.md](THIRD_PARTIES.md) +Promete はいくつかのサードパーティソフトウェアに依存しています。ライセンスをご確認ください [THIRD_PARTIES.md](THIRD_PARTIES.md) [ci]: https://ci.appveyor.com/project/EbiseLutica/Promete [issues]: //github.com/EbiseLutica/Promete/issues