├── .DS_Store ├── .eslintrc.json ├── .github └── workflows │ └── codeql-analysis.yml ├── .gitignore ├── .husky ├── pre-commit └── pre-push ├── .lintstagedrc ├── .prettierignore ├── .prettierrc.json ├── .stylelintignore ├── .stylelintrc.json ├── .vscode ├── extensions.json └── settings.json ├── LICENSE ├── README.md ├── apps ├── .gitkeep ├── example-app-angular-e2e │ ├── .eslintrc.json │ ├── cypress.json │ ├── project.json │ ├── src │ │ ├── fixtures │ │ │ └── example.json │ │ ├── integration │ │ │ └── app.spec.ts │ │ └── support │ │ │ ├── app.po.ts │ │ │ ├── commands.ts │ │ │ └── index.ts │ └── tsconfig.json ├── example-app-angular │ ├── .eslintrc.json │ ├── .stylelintrc.json │ ├── android │ │ ├── .gitignore │ │ ├── .idea │ │ │ ├── .gitignore │ │ │ ├── compiler.xml │ │ │ ├── jarRepositories.xml │ │ │ └── misc.xml │ │ ├── app │ │ │ ├── .gitignore │ │ │ ├── build.gradle │ │ │ ├── capacitor.build.gradle │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ │ ├── androidTest │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── getcapacitor │ │ │ │ │ └── myapp │ │ │ │ │ └── ExampleInstrumentedTest.java │ │ │ │ ├── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java │ │ │ │ │ └── angular │ │ │ │ │ │ └── ionicphaser │ │ │ │ │ │ └── openforge │ │ │ │ │ │ └── io │ │ │ │ │ │ └── MainActivity.java │ │ │ │ └── res │ │ │ │ │ ├── drawable-land-hdpi │ │ │ │ │ └── splash.png │ │ │ │ │ ├── drawable-land-mdpi │ │ │ │ │ └── splash.png │ │ │ │ │ ├── drawable-land-xhdpi │ │ │ │ │ └── splash.png │ │ │ │ │ ├── drawable-land-xxhdpi │ │ │ │ │ └── splash.png │ │ │ │ │ ├── drawable-land-xxxhdpi │ │ │ │ │ └── splash.png │ │ │ │ │ ├── drawable-port-hdpi │ │ │ │ │ └── splash.png │ │ │ │ │ ├── drawable-port-mdpi │ │ │ │ │ └── splash.png │ │ │ │ │ ├── drawable-port-xhdpi │ │ │ │ │ └── splash.png │ │ │ │ │ ├── drawable-port-xxhdpi │ │ │ │ │ └── splash.png │ │ │ │ │ ├── drawable-port-xxxhdpi │ │ │ │ │ └── splash.png │ │ │ │ │ ├── drawable-v24 │ │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ │ ├── drawable │ │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ │ └── splash.png │ │ │ │ │ ├── layout │ │ │ │ │ └── activity_main.xml │ │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ │ ├── ic_launcher.xml │ │ │ │ │ └── ic_launcher_round.xml │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_foreground.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_foreground.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_foreground.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_foreground.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_foreground.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── values │ │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ │ ├── strings.xml │ │ │ │ │ └── styles.xml │ │ │ │ │ └── xml │ │ │ │ │ └── file_paths.xml │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── getcapacitor │ │ │ │ └── myapp │ │ │ │ └── ExampleUnitTest.java │ │ ├── build.gradle │ │ ├── capacitor.settings.gradle │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── settings.gradle │ │ └── variables.gradle │ ├── capacitor.config.ts │ ├── ios │ │ ├── .gitignore │ │ └── App │ │ │ ├── App.xcodeproj │ │ │ ├── project.pbxproj │ │ │ └── project.xcworkspace │ │ │ │ └── contents.xcworkspacedata │ │ │ ├── App.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ ├── App │ │ │ ├── AppDelegate.swift │ │ │ ├── Assets.xcassets │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ ├── AppIcon-20x20@1x.png │ │ │ │ │ ├── AppIcon-20x20@2x-1.png │ │ │ │ │ ├── AppIcon-20x20@2x.png │ │ │ │ │ ├── AppIcon-20x20@3x.png │ │ │ │ │ ├── AppIcon-29x29@1x.png │ │ │ │ │ ├── AppIcon-29x29@2x-1.png │ │ │ │ │ ├── AppIcon-29x29@2x.png │ │ │ │ │ ├── AppIcon-29x29@3x.png │ │ │ │ │ ├── AppIcon-40x40@1x.png │ │ │ │ │ ├── AppIcon-40x40@2x-1.png │ │ │ │ │ ├── AppIcon-40x40@2x.png │ │ │ │ │ ├── AppIcon-40x40@3x.png │ │ │ │ │ ├── AppIcon-512@2x.png │ │ │ │ │ ├── AppIcon-60x60@2x.png │ │ │ │ │ ├── AppIcon-60x60@3x.png │ │ │ │ │ ├── AppIcon-76x76@1x.png │ │ │ │ │ ├── AppIcon-76x76@2x.png │ │ │ │ │ ├── AppIcon-83.5x83.5@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── Contents.json │ │ │ │ └── Splash.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── splash-2732x2732-1.png │ │ │ │ │ ├── splash-2732x2732-2.png │ │ │ │ │ └── splash-2732x2732.png │ │ │ ├── Base.lproj │ │ │ │ ├── LaunchScreen.storyboard │ │ │ │ └── Main.storyboard │ │ │ └── Info.plist │ │ │ └── Podfile │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── project.json │ ├── src │ │ ├── app │ │ │ ├── app-routing.module.ts │ │ │ ├── app.component.html │ │ │ ├── app.component.scss │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── home │ │ │ │ ├── home.page.html │ │ │ │ ├── home.page.scss │ │ │ │ ├── home.page.spec.ts │ │ │ │ └── home.page.ts │ │ │ ├── pipes │ │ │ │ └── reverse.pipe.ts │ │ │ └── shop │ │ │ │ ├── shop.component.html │ │ │ │ ├── shop.component.scss │ │ │ │ ├── shop.component.spec.ts │ │ │ │ └── shop.component.ts │ │ ├── assets │ │ │ ├── blacksmith │ │ │ │ ├── blacksmith_bg.png │ │ │ │ ├── blacksmith_sprites.png │ │ │ │ ├── blacksmith_sprites_anim.json │ │ │ │ └── blacksmith_sprites_atlas.json │ │ │ ├── fancy_sword.png │ │ │ ├── icon │ │ │ │ └── favicon.png │ │ │ ├── shapes.svg │ │ │ └── swords │ │ │ │ ├── cheap_sword.png │ │ │ │ └── fancy_sword.png │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── global.scss │ │ ├── index.html │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── test.ts │ │ ├── theme │ │ │ └── variables.scss │ │ └── zone-flags.ts │ ├── tsconfig.app.json │ ├── tsconfig.editor.json │ ├── tsconfig.json │ └── tsconfig.spec.json ├── example-app-react-e2e │ ├── .eslintrc.json │ ├── cypress.json │ ├── project.json │ ├── src │ │ ├── fixtures │ │ │ └── example.json │ │ ├── integration │ │ │ └── app.spec.ts │ │ └── support │ │ │ ├── app.po.ts │ │ │ ├── commands.ts │ │ │ └── index.ts │ └── tsconfig.json ├── example-app-react │ ├── .eslintrc.json │ ├── index.html │ ├── project.json │ ├── public │ │ └── favicon.ico │ ├── src │ │ ├── app │ │ │ ├── app.module.scss │ │ │ ├── app.spec.tsx │ │ │ ├── app.tsx │ │ │ └── nx-welcome.tsx │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── main.tsx │ │ └── styles.scss │ ├── tsconfig.app.json │ ├── tsconfig.json │ ├── tsconfig.spec.json │ └── vite.config.ts └── example-app-vue │ ├── .gitignore │ ├── .vscode │ └── extensions.json │ ├── README.md │ ├── index.html │ ├── package.json │ ├── project.json │ ├── public │ └── vite.svg │ ├── src │ ├── App.vue │ ├── assets │ │ └── vue.svg │ ├── components │ │ └── HelloWorld.vue │ ├── main.ts │ ├── style.css │ └── vite-env.d.ts │ ├── tsconfig.json │ ├── tsconfig.node.json │ └── vite.config.ts ├── ionic.config.json ├── jest.config.ts ├── jest.preset.ts ├── libs ├── .DS_Store ├── .gitkeep ├── example-app-angular │ ├── ionic │ │ └── ui-modals │ │ │ ├── .eslintrc.json │ │ │ ├── README.md │ │ │ ├── jest.config.ts │ │ │ ├── project.json │ │ │ ├── src │ │ │ ├── index.ts │ │ │ ├── lib │ │ │ │ └── example-app-angular-ionic-ui-modals.module.ts │ │ │ └── test-setup.ts │ │ │ ├── tsconfig.json │ │ │ ├── tsconfig.lib.json │ │ │ └── tsconfig.spec.json │ └── phaser │ │ └── ui-modals │ │ ├── .eslintrc.json │ │ ├── README.md │ │ ├── jest.config.ts │ │ ├── project.json │ │ ├── src │ │ ├── index.ts │ │ ├── lib │ │ │ └── example-app-angular-phaser-ui-modals.module.ts │ │ └── test-setup.ts │ │ ├── tsconfig.json │ │ ├── tsconfig.lib.json │ │ └── tsconfig.spec.json └── shared │ ├── data-access-model │ ├── .eslintrc.json │ ├── README.md │ ├── jest.config.ts │ ├── project.json │ ├── src │ │ ├── index.ts │ │ ├── lib │ │ │ ├── classes │ │ │ │ ├── blacksmith │ │ │ │ │ └── blacksmith.class.ts │ │ │ │ ├── cheap_sword │ │ │ │ │ └── cheap_sword.class.ts │ │ │ │ ├── fancy_sword │ │ │ │ │ └── fancy_sword.class.ts │ │ │ │ └── warrior │ │ │ │ │ ├── warrior.class.ts │ │ │ │ │ └── warrior.stats.class.ts │ │ │ ├── primordials │ │ │ │ ├── event │ │ │ │ │ └── event.class.ts │ │ │ │ ├── human │ │ │ │ │ └── human.primordial.class.ts │ │ │ │ ├── primordial.readme.md │ │ │ │ ├── stat │ │ │ │ │ ├── dependent-stat │ │ │ │ │ │ └── dependent.stat.class.ts │ │ │ │ │ ├── finalbonus │ │ │ │ │ │ └── final-bonus.class.ts │ │ │ │ │ ├── rawbonus │ │ │ │ │ │ └── raw-bonus.class.ts │ │ │ │ │ ├── stat.base.class.ts │ │ │ │ │ └── stat.class.ts │ │ │ │ └── sword │ │ │ │ │ ├── sword.enum.ts │ │ │ │ │ └── sword.primordial.class.ts │ │ │ └── stats │ │ │ │ ├── level │ │ │ │ ├── level.class.ts │ │ │ │ └── level.dependent.stat.ts │ │ │ │ ├── salary │ │ │ │ └── salary.class.ts │ │ │ │ └── stats.md │ │ └── test-setup.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json │ └── phaser-singleton │ ├── .eslintrc.json │ ├── README.md │ ├── jest.config.ts │ ├── project.json │ ├── src │ ├── index.ts │ ├── lib │ │ ├── phaser-singleton.module.ts │ │ ├── scenes │ │ │ └── world.scene.ts │ │ └── utilities │ │ │ └── scroll-manager.ts │ └── test-setup.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── migrations.json ├── nx.json ├── package-lock.json ├── package.json ├── pull_request_template.md ├── tools ├── generators │ └── .gitkeep └── tsconfig.tools.json ├── tsconfig.base.json └── tsconfig.json /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/.DS_Store -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL" 13 | 14 | on: 15 | push: 16 | branches: [ master, develop, staging ] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [ master ] 20 | schedule: 21 | - cron: '18 5 * * 4' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-latest 27 | permissions: 28 | actions: read 29 | contents: read 30 | security-events: write 31 | 32 | strategy: 33 | fail-fast: false 34 | matrix: 35 | language: [ 'javascript' ] 36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] 37 | # Learn more about CodeQL language support at https://git.io/codeql-language-support 38 | 39 | steps: 40 | - name: Checkout repository 41 | uses: actions/checkout@v2 42 | 43 | # Initializes the CodeQL tools for scanning. 44 | - name: Initialize CodeQL 45 | uses: github/codeql-action/init@v1 46 | with: 47 | languages: ${{ matrix.language }} 48 | # If you wish to specify custom queries, you can do so here or in a config file. 49 | # By default, queries listed here will override any specified in a config file. 50 | # Prefix the list here with "+" to use these queries and those in the config file. 51 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 52 | 53 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 54 | # If this step fails, then you should remove it and run the build manually (see below) 55 | - name: Autobuild 56 | uses: github/codeql-action/autobuild@v1 57 | 58 | # ℹ️ Command-line programs to run using the OS shell. 59 | # 📚 https://git.io/JvXDl 60 | 61 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 62 | # and modify them (or add more) to build your code if your project 63 | # uses a compiled language 64 | 65 | #- run: | 66 | # make bootstrap 67 | # make release 68 | 69 | - name: Perform CodeQL Analysis 70 | uses: github/codeql-action/analyze@v1 71 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | 106 | # Angular cache 107 | .angular 108 | 109 | # DS_STORE 110 | .DS_Store -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | echo "Setting Node Memory to 8 GB" 5 | export NODE_OPTIONS="--max-old-space-size=8192" 6 | 7 | echo "Linting Staged Files for consistency to OpenForge standards..." 8 | npx lint-staged 9 | -------------------------------------------------------------------------------- /.husky/pre-push: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | echo "Linting All Files to assure consistency to OpenForge standards..." 5 | npx nx run-many --all --target=lint --fix 6 | 7 | echo "Verifying Project Builds..." 8 | npx nx build 9 | -------------------------------------------------------------------------------- /.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "lint-staged": { 3 | "*": ["eslint --fix", "git add"] 4 | } 5 | } -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | **/www 2 | **/node_modules 3 | **/ios 4 | **/android 5 | **/dist 6 | **/configs 7 | **/.vscode 8 | **/.husky 9 | **/.vs 10 | 11 | # Ignore CHANGELOG.md files to avoid issues with automated release job 12 | CHANGELOG.md 13 | 14 | LICENSE.md -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 200, 3 | "tabWidth": 4, 4 | "useTabs": false, 5 | "semi": true, 6 | "singleQuote": true, 7 | "trailingComma": "es5", 8 | "bracketSpacing": true, 9 | "arrowParens": "avoid", 10 | "overrides": [ 11 | { 12 | "files": ["*.html"], 13 | "options": { 14 | "parser": "html" 15 | } 16 | }, 17 | { 18 | "files": ["*.component.html"], 19 | "options": { 20 | "parser": "angular" 21 | } 22 | }, 23 | { 24 | "files": ["*.page.html"], 25 | "options": { 26 | "parser": "angular" 27 | } 28 | }, 29 | { 30 | "files": "*.yml", 31 | "options": { 32 | "tabWidth": 2 33 | } 34 | } 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /.stylelintignore: -------------------------------------------------------------------------------- 1 | # compiled output 2 | /dist 3 | dist/ 4 | /tmp 5 | /out-tsc 6 | 7 | # dependencies 8 | /node_modules -------------------------------------------------------------------------------- /.stylelintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "stylelint-config-standard-scss", 3 | "rules": { 4 | "scss/at-import-partial-extension": null, 5 | "scss/comment-no-empty": null, 6 | "scss/double-slash-comment-empty-line-before": null, 7 | "scss/at-extend-no-missing-placeholder": null, 8 | "no-invalid-position-at-import-rule": null, 9 | "rule-empty-line-before": null, 10 | "selector-no-vendor-prefix": null, 11 | "alpha-value-notation": null, 12 | "color-function-notation": null, 13 | "scss/no-global-function-names": null, 14 | "value-keyword-case": null, 15 | "shorthand-property-no-redundant-values": null, 16 | "scss/operator-no-unspaced": null, 17 | "declaration-block-no-redundant-longhand-properties": null, 18 | "keyframes-name-pattern": null, 19 | "number-max-precision": null, 20 | "scss/dollar-variable-empty-line-before": null, 21 | "property-no-vendor-prefix": null, 22 | "string-quotes": "single", 23 | "max-empty-lines": 1, 24 | "no-duplicate-selectors": true, 25 | "scss/dollar-variable-pattern": "^[a-z\\d](?:[a-z\\d]|-(?=[a-z\\d]))*$", 26 | "scss/selector-no-redundant-nesting-selector": true, 27 | "declaration-empty-line-before": null, 28 | "selector-pseudo-element-no-unknown": null, 29 | "unit-disallowed-list": ["px"] 30 | } 31 | } -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "esbenp.prettier-vscode" 4 | ], 5 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "[typescript]": { 3 | "editor.defaultFormatter": "rvest.vs-code-prettier-eslint" 4 | }, 5 | 6 | "[json]": { 7 | "editor.defaultFormatter": "vscode.typescript-language-features" 8 | }, 9 | "editor.codeActionsOnSave": { 10 | "source.fixAll.eslint": true 11 | }, 12 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT LICENSE 2 | 3 | Copyright (C) 2022 - Present OPENFORGE, LLC. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /apps/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/.gitkeep -------------------------------------------------------------------------------- /apps/example-app-angular-e2e/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["plugin:cypress/recommended", "../../.eslintrc.json"] 3 | } 4 | -------------------------------------------------------------------------------- /apps/example-app-angular-e2e/cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "fileServerFolder": ".", 3 | "fixturesFolder": "./src/fixtures", 4 | "integrationFolder": "./src/integration", 5 | "modifyObstructiveCode": false, 6 | "supportFile": "./src/support/index.ts", 7 | "pluginsFile": false, 8 | "video": true, 9 | "videosFolder": "../../dist/cypress/apps/example-app-angular-e2e/videos", 10 | "screenshotsFolder": "../../dist/cypress/apps/example-app-angular-e2e/screenshots", 11 | "chromeWebSecurity": false 12 | } 13 | -------------------------------------------------------------------------------- /apps/example-app-angular-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example-app-angular-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "apps/example-app-angular-e2e/src", 5 | "projectType": "application", 6 | "targets": { 7 | "e2e": { 8 | "executor": "@nrwl/cypress:cypress", 9 | "options": { 10 | "cypressConfig": "apps/example-app-angular-e2e/cypress.json", 11 | "devServerTarget": "example-app-angular:serve:development" 12 | }, 13 | "configurations": { 14 | "production": { 15 | "devServerTarget": "example-app-angular:serve:production" 16 | } 17 | } 18 | }, 19 | "lint": { 20 | "executor": "@nrwl/linter:eslint", 21 | "outputs": ["{options.outputFile}"], 22 | "options": { 23 | "lintFilePatterns": ["apps/example-app-angular-e2e/**/*.{js,ts}"] 24 | } 25 | } 26 | }, 27 | "tags": [], 28 | "implicitDependencies": ["example-app-angular"] 29 | } 30 | -------------------------------------------------------------------------------- /apps/example-app-angular-e2e/src/fixtures/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Using fixtures to represent data", 3 | "email": "hello@cypress.io" 4 | } 5 | -------------------------------------------------------------------------------- /apps/example-app-angular-e2e/src/integration/app.spec.ts: -------------------------------------------------------------------------------- 1 | import { getGreeting } from '../support/app.po'; 2 | 3 | describe('example-app-angular', () => { 4 | beforeEach(() => cy.visit('/')); 5 | 6 | it('should display welcome message', () => { 7 | // Custom command example, see `../support/commands.ts` file 8 | cy.login('my-email@something.com', 'myPassword'); 9 | 10 | // Function helper example, see `../support/app.po.ts` file 11 | getGreeting().contains('Welcome to example-app-angular!'); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /apps/example-app-angular-e2e/src/support/app.po.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unsafe-call */ 2 | /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ 3 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */ 4 | // eslint-disable-next-line @typescript-eslint/no-unsafe-return 5 | export const getGreeting = () => cy.get('h1'); 6 | -------------------------------------------------------------------------------- /apps/example-app-angular-e2e/src/support/commands.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unsafe-call */ 2 | /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ 3 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */ 4 | // eslint-disable-next-line @typescript-eslint/no-unsafe-return 5 | 6 | // *********************************************** 7 | // This example commands.js shows you how to 8 | // create various custom commands and overwrite 9 | // existing commands. 10 | // 11 | // For more comprehensive examples of custom 12 | // commands please read more here: 13 | // https://on.cypress.io/custom-commands 14 | // *********************************************** 15 | 16 | // eslint-disable-next-line @typescript-eslint/no-namespace 17 | declare namespace Cypress { 18 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 19 | interface Chainable { 20 | login(email: string, password: string): void; 21 | } 22 | } 23 | // 24 | // -- This is a parent command -- 25 | Cypress.Commands.add('login', (email, password) => { 26 | console.log('Custom command example: Login', email, password); 27 | }); 28 | // 29 | // -- This is a child command -- 30 | // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) 31 | // 32 | // 33 | // -- This is a dual command -- 34 | // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) 35 | // 36 | // 37 | // -- This will overwrite an existing command -- 38 | // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) 39 | -------------------------------------------------------------------------------- /apps/example-app-angular-e2e/src/support/index.ts: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/index.js is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.js using ES2015 syntax: 17 | import './commands'; 18 | -------------------------------------------------------------------------------- /apps/example-app-angular-e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "sourceMap": false, 5 | "outDir": "../../dist/out-tsc", 6 | "allowJs": true, 7 | "types": ["cypress", "node"], 8 | "forceConsistentCasingInFileNames": true, 9 | "strict": true, 10 | "noImplicitReturns": true, 11 | "noFallthroughCasesInSwitch": true 12 | }, 13 | "include": ["src/**/*.ts", "src/**/*.js"], 14 | "angularCompilerOptions": { 15 | "strictInjectionParameters": true, 16 | "strictInputAccessModifiers": true, 17 | "strictTemplates": true 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /apps/example-app-angular/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["../../.eslintrc.json"] 3 | } 4 | -------------------------------------------------------------------------------- /apps/example-app-angular/.stylelintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["../../.stylelintrc.json"] 3 | } 4 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/.gitignore: -------------------------------------------------------------------------------- 1 | # Using Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore 2 | 3 | # Built application files 4 | *.apk 5 | *.aar 6 | *.ap_ 7 | *.aab 8 | 9 | # Files for the ART/Dalvik VM 10 | *.dex 11 | 12 | # Java class files 13 | *.class 14 | 15 | # Generated files 16 | bin/ 17 | gen/ 18 | out/ 19 | # Uncomment the following line in case you need and you don't have the release build type files in your app 20 | # release/ 21 | 22 | # Gradle files 23 | .gradle/ 24 | build/ 25 | 26 | # Local configuration file (sdk path, etc) 27 | local.properties 28 | 29 | # Proguard folder generated by Eclipse 30 | proguard/ 31 | 32 | # Log Files 33 | *.log 34 | 35 | # Android Studio Navigation editor temp files 36 | .navigation/ 37 | 38 | # Android Studio captures folder 39 | captures/ 40 | 41 | # IntelliJ 42 | *.iml 43 | .idea/workspace.xml 44 | .idea/tasks.xml 45 | .idea/gradle.xml 46 | .idea/assetWizardSettings.xml 47 | .idea/dictionaries 48 | .idea/libraries 49 | # Android Studio 3 in .gitignore file. 50 | .idea/caches 51 | .idea/modules.xml 52 | # Comment next line if keeping position of elements in Navigation Editor is relevant for you 53 | .idea/navEditor.xml 54 | 55 | # Keystore files 56 | # Uncomment the following lines if you do not want to check your keystore files in. 57 | #*.jks 58 | #*.keystore 59 | 60 | # External native build folder generated in Android Studio 2.2 and later 61 | .externalNativeBuild 62 | .cxx/ 63 | 64 | # Google Services (e.g. APIs or Firebase) 65 | # google-services.json 66 | 67 | # Freeline 68 | freeline.py 69 | freeline/ 70 | freeline_project_description.json 71 | 72 | # fastlane 73 | fastlane/report.xml 74 | fastlane/Preview.html 75 | fastlane/screenshots 76 | fastlane/test_output 77 | fastlane/readme.md 78 | 79 | # Version control 80 | vcs.xml 81 | 82 | # lint 83 | lint/intermediates/ 84 | lint/generated/ 85 | lint/outputs/ 86 | lint/tmp/ 87 | # lint/reports/ 88 | 89 | # Android Profiling 90 | *.hprof 91 | 92 | # Cordova plugins for Capacitor 93 | capacitor-cordova-android-plugins 94 | 95 | # Copied web assets 96 | app/src/main/assets/public 97 | 98 | # Generated Config files 99 | app/src/main/assets/capacitor.config.json 100 | app/src/main/assets/capacitor.plugins.json 101 | app/src/main/res/xml/config.xml 102 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build/* 2 | !/build/.npmkeep 3 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion rootProject.ext.compileSdkVersion 5 | defaultConfig { 6 | applicationId "angular.ionicphaser.openforge.io" 7 | minSdkVersion rootProject.ext.minSdkVersion 8 | targetSdkVersion rootProject.ext.targetSdkVersion 9 | versionCode 1 10 | versionName "1.0" 11 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 12 | aaptOptions { 13 | // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. 14 | // Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61 15 | ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~' 16 | } 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | } 25 | 26 | repositories { 27 | flatDir{ 28 | dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs' 29 | } 30 | } 31 | 32 | dependencies { 33 | implementation fileTree(include: ['*.jar'], dir: 'libs') 34 | implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion" 35 | implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion" 36 | implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion" 37 | implementation project(':capacitor-android') 38 | testImplementation "junit:junit:$junitVersion" 39 | androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion" 40 | androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion" 41 | implementation project(':capacitor-cordova-android-plugins') 42 | } 43 | 44 | apply from: 'capacitor.build.gradle' 45 | 46 | try { 47 | def servicesJSON = file('google-services.json') 48 | if (servicesJSON.text) { 49 | apply plugin: 'com.google.gms.google-services' 50 | } 51 | } catch(Exception e) { 52 | logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work") 53 | } 54 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/capacitor.build.gradle: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN 2 | 3 | android { 4 | compileOptions { 5 | sourceCompatibility JavaVersion.VERSION_11 6 | targetCompatibility JavaVersion.VERSION_11 7 | } 8 | } 9 | 10 | apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle" 11 | dependencies { 12 | 13 | 14 | } 15 | 16 | 17 | if (hasProperty('postBuildExtras')) { 18 | postBuildExtras() 19 | } 20 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.getcapacitor.myapp; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import android.content.Context; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | import androidx.test.platform.app.InstrumentationRegistry; 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * @see Testing documentation 15 | */ 16 | @RunWith(AndroidJUnit4.class) 17 | public class ExampleInstrumentedTest { 18 | 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 23 | 24 | assertEquals("com.getcapacitor.app", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/java/angular/ionicphaser/openforge/io/MainActivity.java: -------------------------------------------------------------------------------- 1 | package angular.ionicphaser.openforge.io; 2 | 3 | import com.getcapacitor.BridgeActivity; 4 | 5 | public class MainActivity extends BridgeActivity {} 6 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/drawable-land-hdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/drawable-land-hdpi/splash.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/drawable-land-mdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/drawable-land-mdpi/splash.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/drawable-land-xhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/drawable-land-xhdpi/splash.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/drawable-land-xxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/drawable-land-xxhdpi/splash.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/drawable-land-xxxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/drawable-land-xxxhdpi/splash.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/drawable-port-hdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/drawable-port-hdpi/splash.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/drawable-port-mdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/drawable-port-mdpi/splash.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/drawable-port-xhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/drawable-port-xhdpi/splash.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/drawable-port-xxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/drawable-port-xxhdpi/splash.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/drawable-port-xxxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/drawable-port-xxxhdpi/splash.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/drawable/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/drawable/splash.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | example-app-angular 4 | example-app-angular 5 | angular.ionicphaser.openforge.io 6 | angular.ionicphaser.openforge.io 7 | 8 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 17 | 18 | 19 | 22 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/main/res/xml/file_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.getcapacitor.myapp; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | 14 | @Test 15 | public void addition_isCorrect() throws Exception { 16 | assertEquals(4, 2 + 2); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | 5 | repositories { 6 | google() 7 | mavenCentral() 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:7.2.1' 11 | classpath 'com.google.gms:google-services:4.3.13' 12 | 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | apply from: "variables.gradle" 19 | 20 | allprojects { 21 | repositories { 22 | google() 23 | mavenCentral() 24 | } 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/capacitor.settings.gradle: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN 2 | include ':capacitor-android' 3 | project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor') 4 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | 19 | # AndroidX package structure to make it clearer which packages are bundled with the 20 | # Android operating system, and which are packaged with your app's APK 21 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 22 | android.useAndroidX=true 23 | # Automatically convert third-party libraries to use AndroidX 24 | android.enableJetifier=true 25 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /apps/example-app-angular/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /apps/example-app-angular/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | include ':capacitor-cordova-android-plugins' 3 | project(':capacitor-cordova-android-plugins').projectDir = new File('./capacitor-cordova-android-plugins/') 4 | 5 | apply from: 'capacitor.settings.gradle' -------------------------------------------------------------------------------- /apps/example-app-angular/android/variables.gradle: -------------------------------------------------------------------------------- 1 | ext { 2 | minSdkVersion = 22 3 | compileSdkVersion = 32 4 | targetSdkVersion = 32 5 | androidxActivityVersion = '1.4.0' 6 | androidxAppCompatVersion = '1.4.2' 7 | androidxCoordinatorLayoutVersion = '1.2.0' 8 | androidxCoreVersion = '1.8.0' 9 | androidxFragmentVersion = '1.4.1' 10 | coreSplashScreenVersion = '1.0.0-rc01' 11 | androidxWebkitVersion = '1.4.0' 12 | junitVersion = '4.13.2' 13 | androidxJunitVersion = '1.1.3' 14 | androidxEspressoCoreVersion = '3.4.0' 15 | cordovaAndroidVersion = '10.1.1' 16 | } -------------------------------------------------------------------------------- /apps/example-app-angular/capacitor.config.ts: -------------------------------------------------------------------------------- 1 | import { CapacitorConfig } from '@capacitor/cli'; 2 | 3 | const config: CapacitorConfig = { 4 | appId: 'angular.ionicphaser.openforge.io', 5 | appName: 'example-app-angular', 6 | webDir: '../../dist/apps/example-app-angular', 7 | bundledWebRuntime: false, 8 | }; 9 | 10 | export default config; 11 | -------------------------------------------------------------------------------- /apps/example-app-angular/ios/.gitignore: -------------------------------------------------------------------------------- 1 | App/build 2 | App/Pods 3 | App/Podfile.lock 4 | App/App/public 5 | DerivedData 6 | xcuserdata 7 | 8 | # Cordova plugins for Capacitor 9 | capacitor-cordova-ios-plugins 10 | 11 | # Generated Config files 12 | App/App/capacitor.config.json 13 | App/App/config.xml 14 | -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Capacitor 3 | 4 | @UIApplicationMain 5 | class AppDelegate: UIResponder, UIApplicationDelegate { 6 | 7 | var window: UIWindow? 8 | 9 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 10 | // Override point for customization after application launch. 11 | return true 12 | } 13 | 14 | func applicationWillResignActive(_ application: UIApplication) { 15 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 16 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 17 | } 18 | 19 | func applicationDidEnterBackground(_ application: UIApplication) { 20 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 21 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 22 | } 23 | 24 | func applicationWillEnterForeground(_ application: UIApplication) { 25 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 26 | } 27 | 28 | func applicationDidBecomeActive(_ application: UIApplication) { 29 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 30 | } 31 | 32 | func applicationWillTerminate(_ application: UIApplication) { 33 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 34 | } 35 | 36 | func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool { 37 | // Called when the app was launched with a url. Feel free to add additional processing here, 38 | // but if you want the App API to support tracking app url opens, make sure to keep this call 39 | return ApplicationDelegateProxy.shared.application(app, open: url, options: options) 40 | } 41 | 42 | func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { 43 | // Called when the app was launched with an activity, including Universal Links. 44 | // Feel free to add additional processing here, but if you want the App API to support 45 | // tracking app url opens, make sure to keep this call 46 | return ApplicationDelegateProxy.shared.application(application, continue: userActivity, restorationHandler: restorationHandler) 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "AppIcon-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "AppIcon-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "AppIcon-29x29@2x-1.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "AppIcon-29x29@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "AppIcon-40x40@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "AppIcon-40x40@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "AppIcon-60x60@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "AppIcon-60x60@3x.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "size" : "20x20", 53 | "idiom" : "ipad", 54 | "filename" : "AppIcon-20x20@1x.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "AppIcon-20x20@2x-1.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "29x29", 65 | "idiom" : "ipad", 66 | "filename" : "AppIcon-29x29@1x.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "AppIcon-29x29@2x.png", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "size" : "40x40", 77 | "idiom" : "ipad", 78 | "filename" : "AppIcon-40x40@1x.png", 79 | "scale" : "1x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "AppIcon-40x40@2x-1.png", 85 | "scale" : "2x" 86 | }, 87 | { 88 | "size" : "76x76", 89 | "idiom" : "ipad", 90 | "filename" : "AppIcon-76x76@1x.png", 91 | "scale" : "1x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "AppIcon-76x76@2x.png", 97 | "scale" : "2x" 98 | }, 99 | { 100 | "size" : "83.5x83.5", 101 | "idiom" : "ipad", 102 | "filename" : "AppIcon-83.5x83.5@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "1024x1024", 107 | "idiom" : "ios-marketing", 108 | "filename" : "AppIcon-512@2x.png", 109 | "scale" : "1x" 110 | } 111 | ], 112 | "info" : { 113 | "version" : 1, 114 | "author" : "xcode" 115 | } 116 | } -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "splash-2732x2732-2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "splash-2732x2732-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "splash-2732x2732.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/App/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | example-app-angular 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | UIViewControllerBasedStatusBarAppearance 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /apps/example-app-angular/ios/App/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../../node_modules/@capacitor/ios/scripts/pods_helpers' 2 | 3 | platform :ios, '13.0' 4 | use_frameworks! 5 | 6 | # workaround to avoid Xcode caching of Pods that requires 7 | # Product -> Clean Build Folder after new Cordova plugins installed 8 | # Requires CocoaPods 1.6 or newer 9 | install! 'cocoapods', :disable_input_output_paths => true 10 | 11 | def capacitor_pods 12 | pod 'Capacitor', :path => '../../node_modules/@capacitor/ios' 13 | pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios' 14 | 15 | end 16 | 17 | target 'App' do 18 | capacitor_pods 19 | # Add your Pods here 20 | end 21 | 22 | post_install do |installer| 23 | assertDeploymentTarget(installer) 24 | end 25 | -------------------------------------------------------------------------------- /apps/example-app-angular/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'example-app-angular', 4 | 5 | setupFilesAfterEnv: ['/src/test-setup.ts'], 6 | globals: { 7 | 'ts-jest': { 8 | tsconfig: '/tsconfig.spec.json', 9 | stringifyContentPathRegex: '\\.(html|svg)$', 10 | }, 11 | }, 12 | coverageDirectory: '../../coverage/apps/example-app-angular', 13 | transform: { 14 | '^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular', 15 | }, 16 | transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], 17 | snapshotSerializers: ['jest-preset-angular/build/serializers/no-ng-attributes', 'jest-preset-angular/build/serializers/ng-snapshot', 'jest-preset-angular/build/serializers/html-comment'], 18 | preset: '../../jest.preset.ts', 19 | }; 20 | -------------------------------------------------------------------------------- /apps/example-app-angular/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example-app-angular", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "private": true, 6 | "dependencies": { 7 | "@capacitor/android": "4.7.0", 8 | "@capacitor/core": "^4.7.0", 9 | "@capacitor/ios": "4.7.0" 10 | }, 11 | "devDependencies": { 12 | "@capacitor/cli": "^4.7.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /apps/example-app-angular/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example-app-angular", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "sourceRoot": "apps/example-app-angular/src", 6 | "prefix": "openforge", 7 | "targets": { 8 | "build": { 9 | "executor": "@angular-devkit/build-angular:browser", 10 | "outputs": ["{options.outputPath}"], 11 | "options": { 12 | "outputPath": "dist/apps/example-app-angular", 13 | "index": "apps/example-app-angular/src/index.html", 14 | "main": "apps/example-app-angular/src/main.ts", 15 | "polyfills": "apps/example-app-angular/src/polyfills.ts", 16 | "tsConfig": "apps/example-app-angular/tsconfig.app.json", 17 | "inlineStyleLanguage": "scss", 18 | "assets": [ 19 | "apps/example-app-angular/src/assets", 20 | { 21 | "glob": "**/*.svg", 22 | "input": "node_modules/ionicons/dist/ionicons/svg", 23 | "output": "./svg" 24 | } 25 | ], 26 | "styles": ["apps/example-app-angular/src/global.scss"], 27 | "scripts": [] 28 | }, 29 | "configurations": { 30 | "production": { 31 | "budgets": [ 32 | { 33 | "type": "initial", 34 | "maximumWarning": "2mb", 35 | "maximumError": "3mb" 36 | }, 37 | { 38 | "type": "anyComponentStyle", 39 | "maximumWarning": "2kb", 40 | "maximumError": "4kb" 41 | } 42 | ], 43 | "fileReplacements": [ 44 | { 45 | "replace": "apps/example-app-angular/src/environments/environment.ts", 46 | "with": "apps/example-app-angular/src/environments/environment.prod.ts" 47 | } 48 | ], 49 | "outputHashing": "all" 50 | }, 51 | "development": { 52 | "buildOptimizer": false, 53 | "optimization": false, 54 | "vendorChunk": true, 55 | "extractLicenses": false, 56 | "sourceMap": true, 57 | "namedChunks": true 58 | } 59 | }, 60 | "defaultConfiguration": "production" 61 | }, 62 | "serve": { 63 | "executor": "@angular-devkit/build-angular:dev-server", 64 | "configurations": { 65 | "production": { 66 | "browserTarget": "example-app-angular:build:production" 67 | }, 68 | "development": { 69 | "browserTarget": "example-app-angular:build:development" 70 | } 71 | }, 72 | "defaultConfiguration": "development" 73 | }, 74 | "extract-i18n": { 75 | "executor": "@angular-devkit/build-angular:extract-i18n", 76 | "options": { 77 | "browserTarget": "example-app-angular:build" 78 | } 79 | }, 80 | "lint": { 81 | "executor": "@nrwl/linter:eslint", 82 | "options": { 83 | "lintFilePatterns": ["apps/example-app-angular/src/**/*.ts", "apps/example-app-angular/src/**/*.html"] 84 | } 85 | }, 86 | "test": { 87 | "executor": "@nrwl/jest:jest", 88 | "outputs": ["{workspaceRoot}/coverage/apps/example-app-angular"], 89 | "options": { 90 | "jestConfig": "apps/example-app-angular/jest.config.ts", 91 | "passWithNoTests": true 92 | } 93 | }, 94 | "stylelint": { 95 | "executor": "nx-stylelint:lint", 96 | "outputs": ["{options.outputFile}"], 97 | "options": { 98 | "lintFilePatterns": ["apps/example-app-angular/**/*.css", "apps/example-app-angular/**/*.scss"] 99 | } 100 | } 101 | }, 102 | "tags": [] 103 | } 104 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; 3 | 4 | import { HomePageComponent } from './home/home.page'; 5 | import { ShopPageComponent } from './shop/shop.component'; 6 | 7 | const routes: Routes = [ 8 | { 9 | path: 'home', 10 | component: HomePageComponent, 11 | }, 12 | { 13 | path: 'shop', 14 | component: ShopPageComponent, 15 | }, 16 | { 17 | path: '', 18 | redirectTo: 'home', 19 | pathMatch: 'full', 20 | }, 21 | ]; 22 | 23 | @NgModule({ 24 | imports: [RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })], 25 | exports: [RouterModule], 26 | }) 27 | export class AppRoutingModule {} 28 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Ionic Menu 8 | 9 | 10 | 11 | 12 | 13 | NAVIGATION 14 | 15 | Forge (Home) 16 | Open Shop (Modal) 17 | Open Shop (Page) 18 | 19 | 20 | 21 | OPERATIONS 22 | 23 | Create Warrior 24 | Create Random Event 25 | 26 | 27 | 28 | WARRIORS 29 | 30 | 31 | 32 |
33 | 34 | 35 | 36 | {{_warrior.name}} 37 | 38 | 39 | Do Pushups 40 | 41 | 42 |
43 |
44 |

None created yet, click "Create Warrior"!

45 |
46 |
47 |
48 | 49 | 50 | 51 | 52 | SYSTEM MESSAGES 53 | 54 | 55 | 56 |
57 |

{{action}}

58 |
59 |
60 | 61 |
62 |
63 | 64 | 65 |
66 |
67 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/app/app.component.scss: -------------------------------------------------------------------------------- 1 | // App component scss 2 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; 2 | import { TestBed, waitForAsync } from '@angular/core/testing'; 3 | 4 | import { AppComponent } from './app.component'; 5 | 6 | describe('AppComponent', () => { 7 | beforeEach( 8 | waitForAsync(() => { 9 | TestBed.configureTestingModule({ 10 | declarations: [AppComponent], 11 | schemas: [CUSTOM_ELEMENTS_SCHEMA], 12 | }).compileComponents(); 13 | }) 14 | ); 15 | 16 | it('should create the app', () => { 17 | const fixture = TestBed.createComponent(AppComponent); 18 | const app = fixture.debugElement.componentInstance; 19 | expect(app).toBeTruthy(); 20 | }); 21 | // TODO: add more tests! 22 | }); 23 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unsafe-call */ 2 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */ 3 | /* eslint-disable @typescript-eslint/no-unsafe-assignment */ 4 | import { Component, OnDestroy } from '@angular/core'; 5 | import { Event, Warrior } from '@company-name/shared/data-access-model'; 6 | import { PhaserSingletonService } from '@company-name/shared-phaser-singleton'; 7 | import { ModalController } from '@ionic/angular'; 8 | 9 | import { ShopPageComponent } from './shop/shop.component'; 10 | 11 | @Component({ 12 | selector: 'openforge-app-root', 13 | templateUrl: 'app.component.html', 14 | styleUrls: ['app.component.scss'], 15 | }) 16 | export class AppComponent implements OnDestroy { 17 | public actionsHistoryRef: string[]; // * Store all actions on home screen for printing 18 | public warriors: Warrior[] = []; // * Array of Warriors since they don't currently have a graphic associated 19 | 20 | // * for our app template to use the actions History) 21 | constructor(public phaserInstance: PhaserSingletonService, public modalController: ModalController) { 22 | this.actionsHistoryRef = PhaserSingletonService.actionsHistory; 23 | } 24 | 25 | public async openShop(): Promise { 26 | const modal = await this.modalController.create({ 27 | component: ShopPageComponent, 28 | cssClass: 'fullscreen', 29 | }); 30 | return await modal.present(); 31 | } 32 | 33 | /** 34 | * * Creates a warrior to be placed on scene 35 | */ 36 | public async createWarrior(): Promise { 37 | console.log('createWarrior()'); 38 | const tmpWarrior = await Warrior.build(new Warrior()); 39 | this.warriors.push(tmpWarrior); 40 | } 41 | 42 | /** 43 | * * Creates a Event and applies it to the Warrior 44 | * 45 | * @param _warrior Warrior 46 | */ 47 | public async doPushUps(_warrior: Warrior): Promise { 48 | await _warrior.doPushUps(); 49 | } 50 | 51 | /** 52 | * * Creates a Event and applies it to a random Warrior 53 | */ 54 | public async createEvent(): Promise { 55 | // * This function creates an 'experience' event that modifies the Warrior 56 | const xpEvent = new Event(); 57 | console.log('createEvent()', 'value = ', xpEvent.value); 58 | } 59 | 60 | /** 61 | * * Need to handle the destroy method so we dont lock up our computer! 62 | */ 63 | ngOnDestroy(): void { 64 | PhaserSingletonService.destroyActiveGame(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unsafe-call */ 2 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */ 3 | /* eslint-disable @typescript-eslint/no-unsafe-assignment */ 4 | import { NgModule } from '@angular/core'; 5 | import { BrowserModule } from '@angular/platform-browser'; 6 | import { RouteReuseStrategy } from '@angular/router'; 7 | import { PhaserSingletonService } from '@company-name/shared-phaser-singleton'; 8 | import { IonicModule, IonicRouteStrategy } from '@ionic/angular'; 9 | 10 | import { AppComponent } from './app.component'; 11 | import { AppRoutingModule } from './app-routing.module'; 12 | import { HomePageComponent } from './home/home.page'; 13 | import { ReversePipe } from './pipes/reverse.pipe'; 14 | import { ShopPageComponent } from './shop/shop.component'; 15 | 16 | @NgModule({ 17 | declarations: [AppComponent, ShopPageComponent, HomePageComponent, ReversePipe], 18 | imports: [BrowserModule, IonicModule.forRoot(), PhaserSingletonService.forRoot(), AppRoutingModule], 19 | providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }], 20 | bootstrap: [AppComponent], 21 | }) 22 | export class AppModule {} 23 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/app/home/home.page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Home 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/app/home/home.page.scss: -------------------------------------------------------------------------------- 1 | #container { 2 | text-align: center; 3 | position: absolute; 4 | left: 0; 5 | right: 0; 6 | top: 50%; 7 | transform: translateY(-50%); 8 | } 9 | 10 | #container strong { 11 | font-size: 1.25rem; 12 | line-height: 1.625rem; 13 | } 14 | 15 | #container p { 16 | font-size: 1rem; 17 | line-height: 1.375rem; 18 | color: #8c8c8c; 19 | margin: 0; 20 | } 21 | 22 | #container a { 23 | text-decoration: none; 24 | } 25 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/app/home/home.page.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; 2 | import { IonicModule } from '@ionic/angular'; 3 | 4 | import { HomePageComponent } from './home.page'; 5 | 6 | describe('HomePageComponent', () => { 7 | let component: HomePageComponent; 8 | let fixture: ComponentFixture; 9 | 10 | beforeEach( 11 | waitForAsync(() => { 12 | TestBed.configureTestingModule({ 13 | declarations: [HomePageComponent], 14 | imports: [IonicModule.forRoot()], 15 | }).compileComponents(); 16 | 17 | fixture = TestBed.createComponent(HomePageComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }) 21 | ); 22 | 23 | it('should create', () => { 24 | expect(component).toBeTruthy(); 25 | }); 26 | }); 27 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/app/home/home.page.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unsafe-call */ 2 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */ 3 | import { Component, OnInit } from '@angular/core'; 4 | import { PhaserSingletonService } from '@company-name/shared-phaser-singleton'; 5 | 6 | @Component({ 7 | selector: 'openforge-home', 8 | templateUrl: 'home.page.html', 9 | styleUrls: ['home.page.scss'], 10 | }) 11 | export class HomePageComponent implements OnInit { 12 | /** 13 | * * On Init, initilize the Phaser Singleton instance 14 | * The initialisation is delayed by 500ms to give the HomePage the chance to render 15 | * the
16 | * 17 | * If we don't delay it, the canvas size in preload() and create() will be 0. 18 | * With the delay the canvas size will be set correctly. 19 | */ 20 | async ngOnInit(): Promise { 21 | console.log('HomePageComponent', 'ngOnInit'); 22 | // eslint-disable-next-line @typescript-eslint/no-misused-promises 23 | setTimeout(this.init, 500); 24 | } 25 | 26 | async init(): Promise { 27 | await PhaserSingletonService.init(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/app/pipes/reverse.pipe.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-explicit-any */ 2 | /* eslint-disable @typescript-eslint/no-unsafe-call */ 3 | /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ 4 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */ 5 | import { Pipe, PipeTransform } from '@angular/core'; 6 | 7 | @Pipe({ name: 'reverse' }) 8 | export class ReversePipe implements PipeTransform { 9 | transform(value: any) { 10 | // eslint-disable-next-line @typescript-eslint/no-unsafe-return 11 | return value.slice().reverse(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/app/shop/shop.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Shop 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | Cheap Sword 22 | 10 seconds build time 23 | 24 | 25 | 26 | This sword won't take the blacksmith very long to create, but it looks a little flimsy. 27 | 28 | Purchase 29 | 30 | 31 | 32 | 33 | 34 | 35 | Fancy Sword 36 | 20 seconds build time 37 | 38 | 39 | A truly mysterious marvel! The craftmanship on this sword is amazing, and it has such a sharp looking blade... 40 | 41 | Purchase 42 | 43 |
44 | 45 |
46 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/app/shop/shop.component.scss: -------------------------------------------------------------------------------- 1 | .inventory-list { 2 | display: flex; 3 | } 4 | 5 | ion-card-content { 6 | height: 15.625rem; 7 | } 8 | 9 | ion-card { 10 | width: 50%; 11 | img { 12 | width: 50%; 13 | margin: auto; 14 | display: block; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/app/shop/shop.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ShopPageComponent } from './shop.component'; 4 | 5 | describe('ShopPageComponent', () => { 6 | let component: ShopPageComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ ShopPageComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ShopPageComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/app/shop/shop.component.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */ 2 | import { Component, OnInit } from '@angular/core'; 3 | import { Router } from '@angular/router'; 4 | import { SwordTypeEnum } from '@company-name/shared/data-access-model'; 5 | import { PhaserSingletonService } from '@company-name/shared-phaser-singleton'; 6 | import { ModalController } from '@ionic/angular'; 7 | 8 | @Component({ 9 | selector: 'openforge-shop', 10 | templateUrl: './shop.component.html', 11 | styleUrls: ['./shop.component.scss'], 12 | }) 13 | export class ShopPageComponent implements OnInit { 14 | public isModal: boolean = false; // * Property to catch if component is on the modal or not 15 | constructor(private router: Router, private modalController: ModalController) {} 16 | 17 | ngOnInit(): void { 18 | console.log('ShopPageComponent ngOnInit'); 19 | this.checkIfModal(); 20 | } 21 | 22 | /** 23 | * * Purchase Sword 24 | */ 25 | public async purchaseSword(type: string): Promise { 26 | const swordType = type === 'fancy' ? SwordTypeEnum.FANCY : SwordTypeEnum.CHEAP; 27 | console.log('shop.component.ts', `Purchasing ${swordType} Sword...`); 28 | await this.router.navigate(['/home']); // * Travel home first so that Phaser exists 29 | // eslint-disable-next-line @typescript-eslint/no-unsafe-call 30 | PhaserSingletonService.shopObservable.next(swordType); 31 | if (this.isModal) { 32 | this.closeModal(); 33 | } 34 | } 35 | 36 | /** 37 | * * Check if component was opened on a modal 38 | */ 39 | public checkIfModal(): void { 40 | void this.modalController.getTop().then(res => { 41 | if (res) { 42 | this.isModal = true; 43 | } 44 | }); 45 | } 46 | 47 | /** 48 | * * Function to close modal 49 | */ 50 | public closeModal(): void { 51 | void this.modalController.dismiss(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/assets/blacksmith/blacksmith_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/src/assets/blacksmith/blacksmith_bg.png -------------------------------------------------------------------------------- /apps/example-app-angular/src/assets/blacksmith/blacksmith_sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/src/assets/blacksmith/blacksmith_sprites.png -------------------------------------------------------------------------------- /apps/example-app-angular/src/assets/blacksmith/blacksmith_sprites_anim.json: -------------------------------------------------------------------------------- 1 | { 2 | "anims": [ 3 | { 4 | "key": "blacksmith_hammer", 5 | "type": "frames", 6 | "repeat": -1, 7 | "frameRate": 6, 8 | "frames": [ 9 | { 10 | "key": "blacksmith_hammer", 11 | "frame": "blacksmith_hammer_1" 12 | }, 13 | { 14 | "key": "blacksmith_hammer", 15 | "frame": "blacksmith_hammer_2" 16 | }, 17 | { 18 | "key": "blacksmith_hammer", 19 | "frame": "blacksmith_hammer_3" 20 | }, 21 | { 22 | "key": "blacksmith_hammer", 23 | "frame": "blacksmith_hammer_4" 24 | } 25 | ] 26 | }, 27 | { 28 | "key": "blacksmith_idle", 29 | "type": "frames", 30 | "repeat": -1, 31 | "frameRate": 6, 32 | "frames": [ 33 | { 34 | "key": "blacksmith_idle", 35 | "frame": "blacksmith_idle_1" 36 | }, 37 | { 38 | "key": "blacksmith_idle", 39 | "frame": "blacksmith_idle_2" 40 | }, 41 | { 42 | "key": "blacksmith_idle", 43 | "frame": "blacksmith_idle_3" 44 | }, 45 | { 46 | "key": "blacksmith_idle", 47 | "frame": "blacksmith_idle_4" 48 | } 49 | ] 50 | } 51 | ] 52 | } -------------------------------------------------------------------------------- /apps/example-app-angular/src/assets/blacksmith/blacksmith_sprites_atlas.json: -------------------------------------------------------------------------------- 1 | { 2 | "frames": [ 3 | { 4 | "filename": "blacksmith_hammer_1", 5 | "frame": { 6 | "w": 246, 7 | "h": 387, 8 | "x": 6, 9 | "y": 6 10 | }, 11 | "anchor": { 12 | "x": 0.5, 13 | "y": 0.5 14 | } 15 | }, 16 | { 17 | "filename": "blacksmith_hammer_2", 18 | "frame": { 19 | "w": 246, 20 | "h": 387, 21 | "x": 264, 22 | "y": 6 23 | }, 24 | "anchor": { 25 | "x": 0.5, 26 | "y": 0.5 27 | } 28 | }, 29 | { 30 | "filename": "blacksmith_hammer_3", 31 | "frame": { 32 | "w": 246, 33 | "h": 387, 34 | "x": 522, 35 | "y": 6 36 | }, 37 | "anchor": { 38 | "x": 0.5, 39 | "y": 0.5 40 | } 41 | }, 42 | { 43 | "filename": "blacksmith_hammer_4", 44 | "frame": { 45 | "w": 246, 46 | "h": 387, 47 | "x": 780, 48 | "y": 6 49 | }, 50 | "anchor": { 51 | "x": 0.5, 52 | "y": 0.5 53 | } 54 | }, 55 | { 56 | "filename": "blacksmith_idle_1", 57 | "frame": { 58 | "w": 246, 59 | "h": 387, 60 | "x": 6, 61 | "y": 405 62 | }, 63 | "anchor": { 64 | "x": 0.5, 65 | "y": 0.5 66 | } 67 | }, 68 | { 69 | "filename": "blacksmith_idle_2", 70 | "frame": { 71 | "w": 246, 72 | "h": 387, 73 | "x": 264, 74 | "y": 405 75 | }, 76 | "anchor": { 77 | "x": 0.5, 78 | "y": 0.5 79 | } 80 | }, 81 | { 82 | "filename": "blacksmith_idle_3", 83 | "frame": { 84 | "w": 246, 85 | "h": 387, 86 | "x": 522, 87 | "y": 405 88 | }, 89 | "anchor": { 90 | "x": 0.5, 91 | "y": 0.5 92 | } 93 | }, 94 | { 95 | "filename": "blacksmith_idle_4", 96 | "frame": { 97 | "w": 246, 98 | "h": 387, 99 | "x": 780, 100 | "y": 405 101 | }, 102 | "anchor": { 103 | "x": 0.5, 104 | "y": 0.5 105 | } 106 | } 107 | ], 108 | "meta": { 109 | "description": "Atlas generado con Atlas Packer Gamma V2", 110 | "web": "https://gammafp.github.io/atlas-packer-phaser/" 111 | } 112 | } -------------------------------------------------------------------------------- /apps/example-app-angular/src/assets/fancy_sword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/src/assets/fancy_sword.png -------------------------------------------------------------------------------- /apps/example-app-angular/src/assets/icon/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/src/assets/icon/favicon.png -------------------------------------------------------------------------------- /apps/example-app-angular/src/assets/shapes.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/assets/swords/cheap_sword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/src/assets/swords/cheap_sword.png -------------------------------------------------------------------------------- /apps/example-app-angular/src/assets/swords/fancy_sword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-angular/src/assets/swords/fancy_sword.png -------------------------------------------------------------------------------- /apps/example-app-angular/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/global.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * App Global CSS 3 | * ---------------------------------------------------------------------------- 4 | * Put style rules here that you want to apply globally. These styles are for 5 | * the entire app and not just one component. Additionally, this file can be 6 | * used as an entry point to import other CSS/Sass files to be included in the 7 | * output CSS. 8 | * For more information on global stylesheets, visit the documentation: 9 | * https://ionicframework.com/docs/layout/global-stylesheets 10 | */ 11 | 12 | /* Core CSS required for Ionic components to work properly */ 13 | @import '~@ionic/angular/css/core.css'; 14 | 15 | /* Basic CSS for apps built with Ionic */ 16 | @import '~@ionic/angular/css/normalize.css'; 17 | @import '~@ionic/angular/css/structure.css'; 18 | @import '~@ionic/angular/css/typography.css'; 19 | @import '~@ionic/angular/css/display.css'; 20 | 21 | /* Optional CSS utils that can be commented out */ 22 | @import '~@ionic/angular/css/padding.css'; 23 | @import '~@ionic/angular/css/float-elements.css'; 24 | @import '~@ionic/angular/css/text-alignment.css'; 25 | @import '~@ionic/angular/css/text-transformation.css'; 26 | @import '~@ionic/angular/css/flex-utils.css'; 27 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ionic App 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule) 13 | .catch(err => console.log(err)); 14 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE11 requires the following for NgClass support on SVG elements */ 22 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 23 | 24 | /** 25 | * Web Animations `@angular/platform-browser/animations` 26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 28 | */ 29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 30 | 31 | /** 32 | * By default, zone.js will patch all possible macroTask and DomEvents 33 | * user can disable parts of macroTask/DomEvents patch by setting following flags 34 | * because those flags need to be set before `zone.js` being loaded, and webpack 35 | * will put import in the top of bundle, so user need to create a separate file 36 | * in this directory (for example: zone-flags.ts), and put the following flags 37 | * into that file, and then add the following code before importing zone.js. 38 | * import './zone-flags'; 39 | * 40 | * The flags allowed in zone-flags.ts are listed here. 41 | * 42 | * The following flags will work for all browsers. 43 | * 44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 46 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 47 | * 48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 50 | * 51 | * (window as any).__Zone_enable_cross_context_check = true; 52 | * 53 | */ 54 | 55 | import './zone-flags'; 56 | /*************************************************************************************************** 57 | * Zone JS is required by default for Angular itself. 58 | */ 59 | import 'zone.js/dist/zone'; // Included with Angular CLI. 60 | 61 | /*************************************************************************************************** 62 | * APPLICATION IMPORTS 63 | */ 64 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | 5 | import { getTestBed } from '@angular/core/testing'; 6 | import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; 7 | 8 | declare const require: { 9 | context( 10 | path: string, 11 | deep?: boolean, 12 | filter?: RegExp 13 | ): { 14 | keys(): string[]; 15 | (id: string): T; 16 | }; 17 | }; 18 | 19 | // First, initialize the Angular testing environment. 20 | getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting()); 21 | // Then we find all the tests. 22 | const context = require.context('./', true, /\.spec\.ts$/); 23 | // And load the modules. 24 | context.keys().map(context); 25 | -------------------------------------------------------------------------------- /apps/example-app-angular/src/zone-flags.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-explicit-any */ 2 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */ 3 | /** 4 | * Prevents Angular change detection from 5 | * running with certain Web Component callbacks 6 | */ 7 | // eslint-disable-next-line no-underscore-dangle 8 | (window as any).__Zone_disable_customElements = true; 9 | -------------------------------------------------------------------------------- /apps/example-app-angular/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/app", 5 | "types": [], 6 | "target": "ES2022", 7 | "useDefineForClassFields": false 8 | }, 9 | "files": ["src/main.ts", "src/polyfills.ts"], 10 | "include": ["src/**/*.d.ts"] 11 | } 12 | -------------------------------------------------------------------------------- /apps/example-app-angular/tsconfig.editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["**/*.ts"], 4 | "compilerOptions": { 5 | "types": ["jest", "node"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /apps/example-app-angular/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "exclude": ["jest.config.ts"], 4 | "compilerOptions": { 5 | "target": "es2020" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /apps/example-app-angular/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /apps/example-app-react-e2e/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["plugin:cypress/recommended", "../../.eslintrc.json"], 3 | "ignorePatterns": ["!**/*"], 4 | "overrides": [ 5 | { 6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], 7 | "rules": {} 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /apps/example-app-react-e2e/cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "fileServerFolder": ".", 3 | "fixturesFolder": "./src/fixtures", 4 | "integrationFolder": "./src/integration", 5 | "modifyObstructiveCode": false, 6 | "supportFile": "./src/support/index.ts", 7 | "pluginsFile": false, 8 | "video": true, 9 | "videosFolder": "../../dist/cypress/apps/example-app-react-e2e/videos", 10 | "screenshotsFolder": "../../dist/cypress/apps/example-app-react-e2e/screenshots", 11 | "chromeWebSecurity": false 12 | } 13 | -------------------------------------------------------------------------------- /apps/example-app-react-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example-app-react-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "apps/example-app-react-e2e/src", 5 | "projectType": "application", 6 | "targets": { 7 | "e2e": { 8 | "executor": "@nrwl/cypress:cypress", 9 | "options": { 10 | "cypressConfig": "apps/example-app-react-e2e/cypress.json", 11 | "devServerTarget": "example-app-react:serve:development", 12 | "testingType": "e2e" 13 | }, 14 | "configurations": { 15 | "production": { 16 | "devServerTarget": "example-app-react:serve:production" 17 | } 18 | } 19 | }, 20 | "lint": { 21 | "executor": "@nrwl/linter:eslint", 22 | "outputs": ["{options.outputFile}"], 23 | "options": { 24 | "lintFilePatterns": ["apps/example-app-react-e2e/**/*.{js,ts}"] 25 | } 26 | } 27 | }, 28 | "tags": [], 29 | "implicitDependencies": ["example-app-react"] 30 | } 31 | -------------------------------------------------------------------------------- /apps/example-app-react-e2e/src/fixtures/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Using fixtures to represent data", 3 | "email": "hello@cypress.io" 4 | } 5 | -------------------------------------------------------------------------------- /apps/example-app-react-e2e/src/integration/app.spec.ts: -------------------------------------------------------------------------------- 1 | import { getGreeting } from '../support/app.po'; 2 | 3 | describe('example-app-react', () => { 4 | beforeEach(() => cy.visit('/')); 5 | 6 | it('should display welcome message', () => { 7 | // Custom command example, see `../support/commands.ts` file 8 | cy.login('my-email@something.com', 'myPassword'); 9 | 10 | // Function helper example, see `../support/app.po.ts` file 11 | getGreeting().contains('Welcome example-app-react'); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /apps/example-app-react-e2e/src/support/app.po.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unsafe-call */ 2 | /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ 3 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */ 4 | // eslint-disable-next-line @typescript-eslint/no-unsafe-return 5 | export const getGreeting = () => cy.get('h1'); 6 | -------------------------------------------------------------------------------- /apps/example-app-react-e2e/src/support/commands.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unsafe-call */ 2 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */ 3 | // *********************************************** 4 | // This example commands.js shows you how to 5 | // create various custom commands and overwrite 6 | // existing commands. 7 | // 8 | // For more comprehensive examples of custom 9 | // commands please read more here: 10 | // https://on.cypress.io/custom-commands 11 | // *********************************************** 12 | 13 | // eslint-disable-next-line @typescript-eslint/no-namespace 14 | declare namespace Cypress { 15 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 16 | interface Chainable { 17 | login(email: string, password: string): void; 18 | } 19 | } 20 | // 21 | // -- This is a parent command -- 22 | Cypress.Commands.add('login', (email, password) => { 23 | console.log('Custom command example: Login', email, password); 24 | }); 25 | // 26 | // -- This is a child command -- 27 | // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) 28 | // 29 | // 30 | // -- This is a dual command -- 31 | // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) 32 | // 33 | // 34 | // -- This will overwrite an existing command -- 35 | // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) 36 | -------------------------------------------------------------------------------- /apps/example-app-react-e2e/src/support/index.ts: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/index.ts is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.ts using ES2015 syntax: 17 | import './commands'; 18 | -------------------------------------------------------------------------------- /apps/example-app-react-e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "sourceMap": false, 5 | "outDir": "../../dist/out-tsc", 6 | "allowJs": true, 7 | "types": ["cypress", "node"] 8 | }, 9 | "include": ["src/**/*.ts", "src/**/*.js"] 10 | } 11 | -------------------------------------------------------------------------------- /apps/example-app-react/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"], 3 | "ignorePatterns": ["!**/*"], 4 | "overrides": [ 5 | { 6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], 7 | "rules": {} 8 | }, 9 | { 10 | "files": ["*.ts", "*.tsx"], 11 | "rules": {} 12 | }, 13 | { 14 | "files": ["*.js", "*.jsx"], 15 | "rules": {} 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /apps/example-app-react/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ExampleAppReact 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /apps/example-app-react/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example-app-react", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "apps/example-app-react/src", 5 | "projectType": "application", 6 | "targets": { 7 | "build": { 8 | "executor": "@nrwl/vite:build", 9 | "outputs": ["{options.outputPath}"], 10 | "defaultConfiguration": "production", 11 | "options": { 12 | "outputPath": "dist/apps/example-app-react" 13 | }, 14 | "configurations": { 15 | "development": { 16 | "mode": "development" 17 | }, 18 | "production": { 19 | "mode": "production" 20 | } 21 | } 22 | }, 23 | "serve": { 24 | "executor": "@nrwl/vite:dev-server", 25 | "defaultConfiguration": "development", 26 | "options": { 27 | "buildTarget": "example-app-react:build" 28 | }, 29 | "configurations": { 30 | "development": { 31 | "buildTarget": "example-app-react:build:development", 32 | "hmr": true 33 | }, 34 | "production": { 35 | "buildTarget": "example-app-react:build:production", 36 | "hmr": false 37 | } 38 | } 39 | }, 40 | "preview": { 41 | "executor": "@nrwl/vite:preview-server", 42 | "defaultConfiguration": "development", 43 | "options": { 44 | "buildTarget": "example-app-react:build" 45 | }, 46 | "configurations": { 47 | "development": { 48 | "buildTarget": "example-app-react:build:development" 49 | }, 50 | "production": { 51 | "buildTarget": "example-app-react:build:production" 52 | } 53 | } 54 | }, 55 | "test": { 56 | "executor": "@nrwl/vite:test", 57 | "outputs": ["coverage/apps/example-app-react"], 58 | "options": { 59 | "passWithNoTests": true, 60 | "reportsDirectory": "../../coverage/apps/example-app-react" 61 | } 62 | }, 63 | "lint": { 64 | "executor": "@nrwl/linter:eslint", 65 | "outputs": ["{options.outputFile}"], 66 | "options": { 67 | "lintFilePatterns": ["apps/example-app-react/**/*.{ts,tsx,js,jsx}"] 68 | } 69 | } 70 | }, 71 | "tags": [] 72 | } 73 | -------------------------------------------------------------------------------- /apps/example-app-react/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-react/public/favicon.ico -------------------------------------------------------------------------------- /apps/example-app-react/src/app/app.module.scss: -------------------------------------------------------------------------------- 1 | /* Your styles goes here. */ 2 | -------------------------------------------------------------------------------- /apps/example-app-react/src/app/app.spec.tsx: -------------------------------------------------------------------------------- 1 | import { render } from '@testing-library/react'; 2 | 3 | import App from './app'; 4 | 5 | describe('App', () => { 6 | it('should render successfully', () => { 7 | const { baseElement } = render(); 8 | expect(baseElement).toBeTruthy(); 9 | }); 10 | 11 | it('should have a greeting as the title', () => { 12 | const { getByText } = render(); 13 | expect(getByText(/Welcome example-app-react/gi)).toBeTruthy(); 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /apps/example-app-react/src/app/app.tsx: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 2 | import styles from './app.module.scss'; 3 | 4 | import NxWelcome from './nx-welcome'; 5 | 6 | export function App() { 7 | return ( 8 | <> 9 | 10 | 11 |
12 | 13 | ); 14 | } 15 | 16 | export default App; 17 | -------------------------------------------------------------------------------- /apps/example-app-react/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/apps/example-app-react/src/assets/.gitkeep -------------------------------------------------------------------------------- /apps/example-app-react/src/main.tsx: -------------------------------------------------------------------------------- 1 | import { StrictMode } from 'react'; 2 | import * as ReactDOM from 'react-dom/client'; 3 | 4 | import App from './app/app'; 5 | 6 | const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement); 7 | root.render( 8 | 9 | 10 | 11 | ); 12 | -------------------------------------------------------------------------------- /apps/example-app-react/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /apps/example-app-react/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": ["node"] 6 | }, 7 | "files": ["../../node_modules/@nrwl/react/typings/cssmodule.d.ts", "../../node_modules/@nrwl/react/typings/image.d.ts"], 8 | "exclude": ["src/**/*.spec.ts", "src/**/*.test.ts", "src/**/*.spec.tsx", "src/**/*.test.tsx", "src/**/*.spec.js", "src/**/*.test.js", "src/**/*.spec.jsx", "src/**/*.test.jsx"], 9 | "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"] 10 | } 11 | -------------------------------------------------------------------------------- /apps/example-app-react/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "jsx": "react-jsx", 4 | "allowJs": false, 5 | "esModuleInterop": false, 6 | "allowSyntheticDefaultImports": true, 7 | "strict": true, 8 | "types": ["vite/client", "vitest"] 9 | }, 10 | "files": [], 11 | "include": [], 12 | "references": [ 13 | { 14 | "path": "./tsconfig.app.json" 15 | }, 16 | { 17 | "path": "./tsconfig.spec.json" 18 | } 19 | ], 20 | "extends": "../../tsconfig.base.json" 21 | } 22 | -------------------------------------------------------------------------------- /apps/example-app-react/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": ["vitest/globals", "node"] 6 | }, 7 | "include": [ 8 | "vite.config.ts", 9 | "src/**/*.test.ts", 10 | "src/**/*.spec.ts", 11 | "src/**/*.test.tsx", 12 | "src/**/*.spec.tsx", 13 | "src/**/*.test.js", 14 | "src/**/*.spec.js", 15 | "src/**/*.test.jsx", 16 | "src/**/*.spec.jsx", 17 | "src/**/*.d.ts" 18 | ], 19 | "files": ["../../node_modules/@nrwl/react/typings/cssmodule.d.ts", "../../node_modules/@nrwl/react/typings/image.d.ts"] 20 | } 21 | -------------------------------------------------------------------------------- /apps/example-app-react/vite.config.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import react from '@vitejs/plugin-react'; 3 | import { defineConfig } from 'vite'; 4 | import viteTsConfigPaths from 'vite-tsconfig-paths'; 5 | 6 | export default defineConfig({ 7 | cacheDir: '../../node_modules/.vite/example-app-react', 8 | 9 | server: { 10 | port: 4200, 11 | host: 'localhost', 12 | }, 13 | 14 | preview: { 15 | port: 4300, 16 | host: 'localhost', 17 | }, 18 | 19 | plugins: [ 20 | react(), 21 | viteTsConfigPaths({ 22 | root: '../../', 23 | }), 24 | ], 25 | 26 | // Uncomment this if you are using workers. 27 | // worker: { 28 | // plugins: [ 29 | // viteTsConfigPaths({ 30 | // root: '../../', 31 | // }), 32 | // ], 33 | // }, 34 | 35 | test: { 36 | globals: true, 37 | cache: { 38 | dir: '../../node_modules/.vitest', 39 | }, 40 | environment: 'jsdom', 41 | include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], 42 | }, 43 | }); 44 | -------------------------------------------------------------------------------- /apps/example-app-vue/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /apps/example-app-vue/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"] 3 | } 4 | -------------------------------------------------------------------------------- /apps/example-app-vue/README.md: -------------------------------------------------------------------------------- 1 | # Vue 3 + TypeScript + Vite 2 | 3 | This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 ` 12 | 13 | 14 | -------------------------------------------------------------------------------- /apps/example-app-vue/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example-app-vue", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vue-tsc && vite build", 9 | "preview": "vite preview" 10 | }, 11 | "dependencies": { 12 | "vue": "^3.2.45" 13 | }, 14 | "devDependencies": { 15 | "@vitejs/plugin-vue": "^4.0.0", 16 | "typescript": "^4.9.3", 17 | "vite": "^4.1.0", 18 | "vue-tsc": "^1.0.24" 19 | } 20 | } -------------------------------------------------------------------------------- /apps/example-app-vue/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example-app-vue", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "apps/example-app-vue/src", 5 | "projectType": "application", 6 | "targets": { 7 | "build": { 8 | "executor": "@nrwl/vite:build", 9 | "outputs": ["{options.outputPath}"], 10 | "defaultConfiguration": "production", 11 | "options": { 12 | "outputPath": "dist/apps/example-app-vue", 13 | "baseHref": "/" 14 | }, 15 | "configurations": { 16 | "production": { 17 | "fileReplacements": [ 18 | { 19 | "replace": "apps/example-app-vue/src/environments/environment.ts", 20 | "with": "apps/example-app-vue/src/environments/environment.prod.ts" 21 | } 22 | ] 23 | } 24 | } 25 | }, 26 | "serve": { 27 | "executor": "@nrwl/vite:dev-server", 28 | "defaultConfiguration": "development", 29 | "options": { 30 | "buildTarget": "example-app-vue:build" 31 | }, 32 | "configurations": { 33 | "production": { 34 | "fileReplacements": [ 35 | { 36 | "replace": "apps/example-app-vue/src/environments/environment.ts", 37 | "with": "apps/example-app-vue/src/environments/environment.prod.ts" 38 | } 39 | ] 40 | } 41 | } 42 | }, 43 | "lint": { 44 | "executor": "@nrwl/linter:eslint", 45 | "outputs": ["{options.outputFile}"], 46 | "options": { 47 | "lintFilePatterns": ["apps/example-app-vue/**/*.{ts,js,tsx,jsx}"] 48 | } 49 | }, 50 | "test": { 51 | "executor": "@nrwl/vite:test", 52 | "options": { 53 | "vitestConfig": "apps/example-app-vue/vitest.config.ts" 54 | } 55 | } 56 | }, 57 | "tags": [] 58 | } 59 | -------------------------------------------------------------------------------- /apps/example-app-vue/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/example-app-vue/src/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 16 | 17 | 31 | -------------------------------------------------------------------------------- /apps/example-app-vue/src/assets/vue.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/example-app-vue/src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 33 | 34 | 39 | -------------------------------------------------------------------------------- /apps/example-app-vue/src/main.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unsafe-argument */ 2 | import './style.css'; 3 | 4 | import { createApp } from 'vue'; 5 | 6 | import App from './App.vue'; 7 | 8 | createApp(App).mount('#app'); 9 | -------------------------------------------------------------------------------- /apps/example-app-vue/src/style.css: -------------------------------------------------------------------------------- 1 | :root { 2 | font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; 3 | line-height: 1.5; 4 | font-weight: 400; 5 | 6 | color-scheme: light dark; 7 | color: rgba(255, 255, 255, 0.87); 8 | background-color: #242424; 9 | 10 | font-synthesis: none; 11 | text-rendering: optimizeLegibility; 12 | -webkit-font-smoothing: antialiased; 13 | -moz-osx-font-smoothing: grayscale; 14 | -webkit-text-size-adjust: 100%; 15 | } 16 | 17 | a { 18 | font-weight: 500; 19 | color: #646cff; 20 | text-decoration: inherit; 21 | } 22 | a:hover { 23 | color: #535bf2; 24 | } 25 | 26 | body { 27 | margin: 0; 28 | display: flex; 29 | place-items: center; 30 | min-width: 320px; 31 | min-height: 100vh; 32 | } 33 | 34 | h1 { 35 | font-size: 3.2em; 36 | line-height: 1.1; 37 | } 38 | 39 | button { 40 | border-radius: 8px; 41 | border: 1px solid transparent; 42 | padding: 0.6em 1.2em; 43 | font-size: 1em; 44 | font-weight: 500; 45 | font-family: inherit; 46 | background-color: #1a1a1a; 47 | cursor: pointer; 48 | transition: border-color 0.25s; 49 | } 50 | button:hover { 51 | border-color: #646cff; 52 | } 53 | button:focus, 54 | button:focus-visible { 55 | outline: 4px auto -webkit-focus-ring-color; 56 | } 57 | 58 | .card { 59 | padding: 2em; 60 | } 61 | 62 | #app { 63 | max-width: 1280px; 64 | margin: 0 auto; 65 | padding: 2rem; 66 | text-align: center; 67 | } 68 | 69 | @media (prefers-color-scheme: light) { 70 | :root { 71 | color: #213547; 72 | background-color: #ffffff; 73 | } 74 | a:hover { 75 | color: #747bff; 76 | } 77 | button { 78 | background-color: #f9f9f9; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /apps/example-app-vue/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /apps/example-app-vue/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "target": "ESNext", 5 | "useDefineForClassFields": true, 6 | "module": "ESNext", 7 | "moduleResolution": "Node", 8 | "strict": true, 9 | "jsx": "preserve", 10 | "resolveJsonModule": true, 11 | "isolatedModules": true, 12 | "esModuleInterop": true, 13 | "lib": ["ESNext", "DOM"], 14 | "skipLibCheck": true, 15 | "noEmit": true 16 | }, 17 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], 18 | "references": [{ "path": "./tsconfig.node.json" }] 19 | } 20 | -------------------------------------------------------------------------------- /apps/example-app-vue/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "module": "ESNext", 5 | "moduleResolution": "Node", 6 | "allowSyntheticDefaultImports": true 7 | }, 8 | "include": ["vite.config.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /apps/example-app-vue/vite.config.ts: -------------------------------------------------------------------------------- 1 | import vue from '@vitejs/plugin-vue'; 2 | import { defineConfig } from 'vite'; 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [vue()], 7 | }); 8 | -------------------------------------------------------------------------------- /ionic.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultProject": "example-app-angular", 3 | "projects": { 4 | "example-app-angular": { 5 | "name": "example-app-angular", 6 | "integrations": { 7 | "capacitor": {} 8 | }, 9 | "type": "angular", 10 | "root": "apps/example-app-angular" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unsafe-call */ 2 | /* eslint-disable @typescript-eslint/no-var-requires */ 3 | /* eslint-disable @typescript-eslint/no-unsafe-assignment */ 4 | import { getJestProjects } from '@nrwl/jest'; 5 | export default { 6 | projects: getJestProjects(), 7 | }; 8 | -------------------------------------------------------------------------------- /jest.preset.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unsafe-call */ 2 | /* eslint-disable @typescript-eslint/no-var-requires */ 3 | /* eslint-disable @typescript-eslint/no-unsafe-assignment */ 4 | import { getJestProjects } from '@nrwl/jest'; 5 | 6 | module.exports = { 7 | projects: getJestProjects(), 8 | }; 9 | -------------------------------------------------------------------------------- /libs/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/libs/.DS_Store -------------------------------------------------------------------------------- /libs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/libs/.gitkeep -------------------------------------------------------------------------------- /libs/example-app-angular/ionic/ui-modals/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "../../../../.eslintrc.json" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /libs/example-app-angular/ionic/ui-modals/README.md: -------------------------------------------------------------------------------- 1 | # example-app-angular-ionic-ui-modals 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | 6 | ## Running unit tests 7 | 8 | Run `nx test example-app-angular-ionic-ui-modals` to execute the unit tests. 9 | 10 | -------------------------------------------------------------------------------- /libs/example-app-angular/ionic/ui-modals/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'example-app-angular-ionic-ui-modals', 4 | 5 | setupFilesAfterEnv: ['/src/test-setup.ts'], 6 | globals: { 7 | 'ts-jest': { 8 | tsconfig: '/tsconfig.spec.json', 9 | stringifyContentPathRegex: '\\.(html|svg)$', 10 | }, 11 | }, 12 | coverageDirectory: '../../../../coverage/libs/example-app-angular/ionic/ui-modals', 13 | transform: { 14 | '^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular', 15 | }, 16 | transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], 17 | snapshotSerializers: ['jest-preset-angular/build/serializers/no-ng-attributes', 'jest-preset-angular/build/serializers/ng-snapshot', 'jest-preset-angular/build/serializers/html-comment'], 18 | preset: '../../../../jest.preset.ts', 19 | }; 20 | -------------------------------------------------------------------------------- /libs/example-app-angular/ionic/ui-modals/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example-app-angular-ionic-ui-modals", 3 | "$schema": "../../../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "library", 5 | "sourceRoot": "libs/example-app-angular/ionic/ui-modals/src", 6 | "prefix": "company-name", 7 | "targets": { 8 | "test": { 9 | "executor": "@nrwl/jest:jest", 10 | "outputs": ["{workspaceRoot}/coverage/libs/example-app-angular/ionic/ui-modals"], 11 | "options": { 12 | "jestConfig": "libs/example-app-angular/ionic/ui-modals/jest.config.ts", 13 | "passWithNoTests": true 14 | } 15 | }, 16 | "lint": { 17 | "executor": "@nrwl/linter:eslint", 18 | "options": { 19 | "lintFilePatterns": ["libs/example-app-angular/ionic/ui-modals/src/**/*.ts", "libs/example-app-angular/ionic/ui-modals/src/**/*.html"] 20 | } 21 | } 22 | }, 23 | "tags": [] 24 | } 25 | -------------------------------------------------------------------------------- /libs/example-app-angular/ionic/ui-modals/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/example-app-angular-ionic-ui-modals.module'; 2 | -------------------------------------------------------------------------------- /libs/example-app-angular/ionic/ui-modals/src/lib/example-app-angular-ionic-ui-modals.module.ts: -------------------------------------------------------------------------------- 1 | import { CommonModule } from '@angular/common'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | @NgModule({ 5 | imports: [CommonModule], 6 | }) 7 | export class ExampleAppAngularIonicUiModalsModule {} 8 | -------------------------------------------------------------------------------- /libs/example-app-angular/ionic/ui-modals/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular/setup-jest'; 2 | -------------------------------------------------------------------------------- /libs/example-app-angular/ionic/ui-modals/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.lib.json" 8 | }, 9 | { 10 | "path": "./tsconfig.spec.json" 11 | } 12 | ], 13 | "compilerOptions": { 14 | "forceConsistentCasingInFileNames": true, 15 | "strict": true, 16 | "noImplicitReturns": true, 17 | "noFallthroughCasesInSwitch": true, 18 | "target": "es2020" 19 | }, 20 | "angularCompilerOptions": { 21 | "strictInjectionParameters": true, 22 | "strictInputAccessModifiers": true, 23 | "strictTemplates": true 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /libs/example-app-angular/ionic/ui-modals/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../../dist/out-tsc", 5 | "declaration": true, 6 | "declarationMap": true, 7 | "inlineSources": true, 8 | "types": [] 9 | }, 10 | "exclude": ["src/test-setup.ts", "**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], 11 | "include": ["**/*.ts"] 12 | } 13 | -------------------------------------------------------------------------------- /libs/example-app-angular/ionic/ui-modals/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.test.ts", "**/*.spec.ts", "**/*.d.ts", "jest.config.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /libs/example-app-angular/phaser/ui-modals/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "../../../../.eslintrc.json" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /libs/example-app-angular/phaser/ui-modals/README.md: -------------------------------------------------------------------------------- 1 | # example-app-angular-phaser-ui-modals 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | 6 | ## Running unit tests 7 | 8 | Run `nx test example-app-angular-phaser-ui-modals` to execute the unit tests. 9 | 10 | -------------------------------------------------------------------------------- /libs/example-app-angular/phaser/ui-modals/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'example-app-angular-phaser-ui-modals', 4 | 5 | setupFilesAfterEnv: ['/src/test-setup.ts'], 6 | globals: { 7 | 'ts-jest': { 8 | tsconfig: '/tsconfig.spec.json', 9 | stringifyContentPathRegex: '\\.(html|svg)$', 10 | }, 11 | }, 12 | coverageDirectory: '../../../../coverage/libs/example-app-angular/phaser/ui-modals', 13 | transform: { 14 | '^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular', 15 | }, 16 | transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], 17 | snapshotSerializers: ['jest-preset-angular/build/serializers/no-ng-attributes', 'jest-preset-angular/build/serializers/ng-snapshot', 'jest-preset-angular/build/serializers/html-comment'], 18 | preset: '../../../../jest.preset.ts', 19 | }; 20 | -------------------------------------------------------------------------------- /libs/example-app-angular/phaser/ui-modals/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example-app-angular-phaser-ui-modals", 3 | "$schema": "../../../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "library", 5 | "sourceRoot": "libs/example-app-angular/phaser/ui-modals/src", 6 | "prefix": "company-name", 7 | "targets": { 8 | "test": { 9 | "executor": "@nrwl/jest:jest", 10 | "outputs": ["{workspaceRoot}/coverage/libs/example-app-angular/phaser/ui-modals"], 11 | "options": { 12 | "jestConfig": "libs/example-app-angular/phaser/ui-modals/jest.config.ts", 13 | "passWithNoTests": true 14 | } 15 | }, 16 | "lint": { 17 | "executor": "@nrwl/linter:eslint", 18 | "options": { 19 | "lintFilePatterns": ["libs/example-app-angular/phaser/ui-modals/src/**/*.ts", "libs/example-app-angular/phaser/ui-modals/src/**/*.html"] 20 | } 21 | } 22 | }, 23 | "tags": [] 24 | } 25 | -------------------------------------------------------------------------------- /libs/example-app-angular/phaser/ui-modals/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/example-app-angular-phaser-ui-modals.module'; 2 | -------------------------------------------------------------------------------- /libs/example-app-angular/phaser/ui-modals/src/lib/example-app-angular-phaser-ui-modals.module.ts: -------------------------------------------------------------------------------- 1 | import { CommonModule } from '@angular/common'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | @NgModule({ 5 | imports: [CommonModule], 6 | }) 7 | export class ExampleAppAngularPhaserUiModalsModule {} 8 | -------------------------------------------------------------------------------- /libs/example-app-angular/phaser/ui-modals/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular/setup-jest'; 2 | -------------------------------------------------------------------------------- /libs/example-app-angular/phaser/ui-modals/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.lib.json" 8 | }, 9 | { 10 | "path": "./tsconfig.spec.json" 11 | } 12 | ], 13 | "compilerOptions": { 14 | "forceConsistentCasingInFileNames": true, 15 | "strict": true, 16 | "noImplicitReturns": true, 17 | "noFallthroughCasesInSwitch": true, 18 | "target": "es2020" 19 | }, 20 | "angularCompilerOptions": { 21 | "strictInjectionParameters": true, 22 | "strictInputAccessModifiers": true, 23 | "strictTemplates": true 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /libs/example-app-angular/phaser/ui-modals/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../../dist/out-tsc", 5 | "declaration": true, 6 | "declarationMap": true, 7 | "inlineSources": true, 8 | "types": [] 9 | }, 10 | "exclude": ["src/test-setup.ts", "**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], 11 | "include": ["**/*.ts"] 12 | } 13 | -------------------------------------------------------------------------------- /libs/example-app-angular/phaser/ui-modals/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.test.ts", "**/*.spec.ts", "**/*.d.ts", "jest.config.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "../../../.eslintrc.json" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/README.md: -------------------------------------------------------------------------------- 1 | # shared-data-access-model 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | 6 | ## Running unit tests 7 | 8 | Run `nx test shared-data-access-model` to execute the unit tests. 9 | 10 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'data-access-model', 4 | 5 | setupFilesAfterEnv: ['/src/test-setup.ts'], 6 | globals: { 7 | 'ts-jest': { 8 | tsconfig: '/tsconfig.spec.json', 9 | stringifyContentPathRegex: '\\.(html|svg)$', 10 | }, 11 | }, 12 | coverageDirectory: '../../../coverage/libs/shared/data-access-model', 13 | transform: { 14 | '^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular', 15 | }, 16 | transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], 17 | snapshotSerializers: ['jest-preset-angular/build/serializers/no-ng-attributes', 'jest-preset-angular/build/serializers/ng-snapshot', 'jest-preset-angular/build/serializers/html-comment'], 18 | preset: '../../../jest.preset.ts', 19 | }; 20 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "data-access-model", 3 | "$schema": "../../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "library", 5 | "sourceRoot": "libs/shared/data-access-model/src", 6 | "prefix": "company-name", 7 | "targets": { 8 | "test": { 9 | "executor": "@nrwl/jest:jest", 10 | "outputs": ["{workspaceRoot}/coverage/libs/shared/data-access-model"], 11 | "options": { 12 | "jestConfig": "libs/shared/data-access-model/jest.config.ts", 13 | "passWithNoTests": true 14 | } 15 | }, 16 | "lint": { 17 | "executor": "@nrwl/linter:eslint", 18 | "options": { 19 | "lintFilePatterns": ["libs/shared/data-access-model/src/**/*.ts", "libs/shared/data-access-model/src/**/*.html"] 20 | } 21 | } 22 | }, 23 | "tags": [] 24 | } 25 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/index.ts: -------------------------------------------------------------------------------- 1 | // * Classes 2 | 3 | export * from './lib/classes/blacksmith/blacksmith.class'; 4 | export * from './lib/classes/warrior/warrior.class'; 5 | export * from './lib/classes/cheap_sword/cheap_sword.class'; 6 | export * from './lib/classes/fancy_sword/fancy_sword.class'; 7 | 8 | // * Primordials 9 | 10 | export * from './lib/primordials/human/human.primordial.class'; 11 | export * from './lib/primordials/sword/sword.enum'; 12 | export * from './lib/primordials/sword/sword.primordial.class'; 13 | export * from './lib/primordials/event/event.class'; 14 | export * from './lib/primordials/stat/stat.class'; 15 | export * from './lib/primordials/stat/stat.base.class'; 16 | export * from './lib/primordials/stat/dependent-stat/dependent.stat.class'; 17 | export * from './lib/primordials/stat/finalbonus/final-bonus.class'; 18 | export * from './lib/primordials/stat/rawbonus/raw-bonus.class'; 19 | 20 | // * Stats 21 | 22 | export * from './lib/stats/level/level.class'; 23 | export * from './lib/stats/level/level.dependent.stat'; 24 | export * from './lib/stats/salary/salary.class'; 25 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/lib/classes/blacksmith/blacksmith.class.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unsafe-call */ 2 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */ 3 | /* eslint-disable no-magic-numbers, @typescript-eslint/no-unsafe-argument */ 4 | import { CheapSword, FancySword, Human, SwordTypeEnum } from '@company-name/shared/data-access-model'; 5 | import { PhaserSingletonService } from '@company-name/shared-phaser-singleton'; 6 | import * as Phaser from 'phaser'; 7 | 8 | export class Blacksmith extends Phaser.GameObjects.Sprite implements Human { 9 | public static hammeringKey = 'blacksmith_hammer'; 10 | public static idleKey = 'blacksmith_idle'; 11 | public static spriteSheet = 'assets/blacksmith/blacksmith_sprites.png'; 12 | public static atlast = 'assets/blacksmith/blacksmith_sprites_atlas.json'; 13 | public static animation = 'assets/blacksmith/blacksmith_sprites_anim.json'; 14 | 15 | constructor(phaserScene: Phaser.Scene) { 16 | // * Set the blacksmith's position relative to Phaser's Origin 17 | super(phaserScene, 0.6, 1, Blacksmith.hammeringKey); 18 | this.scene.add.existing(this); 19 | this.setVisible(true); 20 | this.play(Blacksmith.idleKey); 21 | 22 | // When business plan is finished, Hire the Founder and delete the preview 23 | PhaserSingletonService.shopObservable.subscribe(_objectToBuild => { 24 | console.log('Blacksmith received order for:', _objectToBuild); 25 | PhaserSingletonService.actionsHistory.push('Blacksmith received order for:', _objectToBuild); 26 | void this.buildSword(_objectToBuild); 27 | }); 28 | } 29 | 30 | /** 31 | * * Builds respective class asynchronously 32 | * 33 | * @param phaserScene 34 | * @returns Promise 35 | */ 36 | public static async build(phaserScene: Phaser.Scene): Promise { 37 | console.log('blacksmith.class', 'constructor()'); 38 | const tempObject = new Blacksmith(phaserScene); 39 | try { 40 | return tempObject; 41 | } catch (e) { 42 | console.error('Error creating blacksmith'); 43 | } 44 | } 45 | 46 | /** 47 | * * Sets the blacksmith's animation to Idle 48 | */ 49 | public setIdle(): void { 50 | console.log('Blacksmith going to idle!'); 51 | this.play(Blacksmith.idleKey); 52 | } 53 | 54 | /** 55 | * * Sets the blacksmith's animation to Hammering 56 | */ 57 | public async buildSword(_type: SwordTypeEnum): Promise { 58 | console.log('blacksmith.class.ts', 'buildSword()', _type); 59 | 60 | // * Start the animation 61 | PhaserSingletonService.actionsHistory.push('Blacksmith received order for a ' + _type + ' sword'); 62 | this.play(Blacksmith.hammeringKey); 63 | PhaserSingletonService.actionsHistory.push('Blacksmith started working on the ' + _type + ' sword'); 64 | 65 | // * Start building the sword 66 | let tmpSword; 67 | if (_type === SwordTypeEnum.FANCY) { 68 | tmpSword = await FancySword.build(PhaserSingletonService.activeGame.scene.scenes[0]); 69 | } else if (_type === SwordTypeEnum.CHEAP) { 70 | tmpSword = await CheapSword.build(PhaserSingletonService.activeGame.scene.scenes[0]); 71 | } 72 | 73 | if (tmpSword) { 74 | // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access 75 | PhaserSingletonService.actionsHistory.push(tmpSword.type, ' sword completed! '); 76 | } 77 | 78 | // * Now let's play the animation associated with 79 | this.play(Blacksmith.idleKey); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/lib/classes/cheap_sword/cheap_sword.class.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-magic-numbers */ 2 | import { Sword, SwordTypeEnum } from '@company-name/shared/data-access-model'; 3 | 4 | export class CheapSword extends Phaser.GameObjects.Image implements Sword { 5 | public static imageAsset = 'assets/swords/cheap_sword.png'; // * The asset for the sword, relative to URL 6 | public static key = 'cheap-sword'; // * Key for the cheap sword, used by phaser if it's an animation 7 | public swordType: SwordTypeEnum; // * Interface from parent Sword 8 | 9 | constructor(phaserScene: Phaser.Scene) { 10 | super(phaserScene, -550, -450, CheapSword.key); 11 | console.log('cheap_sword.class', 'constructor()'); 12 | this.swordType = SwordTypeEnum.CHEAP; // * inherited from Sword 13 | } 14 | 15 | /** 16 | * * Builds respective class asynchronously 17 | * 18 | * @param serializedData data for a single object 19 | * @returns Promise 20 | */ 21 | public static async build(phaserScene: Phaser.Scene): Promise { 22 | const tmpObject = new CheapSword(phaserScene); 23 | try { 24 | console.log('cheap_sword.class', 'Starting to build...'); 25 | // eslint-disable-next-line no-magic-numbers 26 | await new Promise(resolve => setTimeout(resolve, 3000)); 27 | phaserScene.add.existing(tmpObject); 28 | tmpObject.setScale(1); 29 | tmpObject.setVisible(true); 30 | tmpObject.rotation += Math.random() * (0.7 - 0.2 + 0.3); 31 | console.log('cheap_sword.class', 'Finished building!...'); 32 | return tmpObject; 33 | } catch (e) { 34 | console.error('cheap_sword.class', 'Error creating sword'); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/lib/classes/fancy_sword/fancy_sword.class.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-magic-numbers */ 2 | import { Sword, SwordTypeEnum } from '@company-name/shared/data-access-model'; 3 | 4 | export class FancySword extends Phaser.GameObjects.Image implements Sword { 5 | public static imageAsset = 'assets/swords/fancy_sword.png'; // * The asset for the sword, relative to URL 6 | public static key = 'fancy-sword'; // * Key for the fancy sword, used by phaser if it's an animation 7 | 8 | constructor(phaserScene: Phaser.Scene) { 9 | super(phaserScene, 1300, -150, FancySword.key); // * + X is to the right, - Y is up 10 | console.log('fancy_sword.class', 'constructor()'); 11 | this.swordType = SwordTypeEnum.FANCY; // * inherited from Sword 12 | } 13 | public swordType: SwordTypeEnum; 14 | 15 | /** 16 | * * Builds respective class asynchronously 17 | * 18 | * @param serializedData data for a single object 19 | * @returns Promise 20 | */ 21 | public static async build(phaserScene: Phaser.Scene): Promise { 22 | const tmpObject = new FancySword(phaserScene); 23 | try { 24 | console.log('fancy_sword.class', 'Starting to build...'); 25 | // eslint-disable-next-line no-magic-numbers 26 | await new Promise(resolve => setTimeout(resolve, 8000)); 27 | phaserScene.add.existing(tmpObject); 28 | tmpObject.setScale(1); 29 | tmpObject.setVisible(true); 30 | tmpObject.rotation += Math.random() * (0.7 - 0.2 + 0.3); 31 | console.log('fancy_sword.class', 'Finished building!...'); 32 | return tmpObject; 33 | } catch (e) { 34 | console.error('fancy_sword.class', 'Error creating sword'); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/lib/classes/warrior/warrior.class.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unsafe-call */ 2 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */ 3 | /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ 4 | /* eslint-disable no-magic-numbers */ 5 | import { PhaserSingletonService } from '@company-name/shared-phaser-singleton'; 6 | 7 | import { Human } from '../../primordials/human/human.primordial.class'; 8 | import { WarriorStats } from './warrior.stats.class'; 9 | 10 | export class Warrior extends Human { 11 | public name: string = 'Warrior ' + Math.floor(Math.random() * 1000).toString(); // * If not passed in default to random name 12 | public stats: WarriorStats; // * The Warrior's Stats 13 | 14 | constructor(data?: Warrior) { 15 | super(data); 16 | } 17 | 18 | /** 19 | * * Builds respective class asynchronously 20 | * 21 | * @param serializedData: Warrior 22 | * @returns Promise 23 | */ 24 | public static async build(serializedData?: Warrior): Promise { 25 | console.log('warrior.class', 'constructor()'); 26 | const tempObject = new Warrior(serializedData); 27 | try { 28 | return tempObject; 29 | } catch (e) { 30 | console.error('Error creating warrior'); 31 | } 32 | } 33 | 34 | /** 35 | * * The warrior exercises via pushups, and gains XP 36 | * Example of a class giving itself a stat bonus 37 | */ 38 | public async doPushUps() { 39 | PhaserSingletonService.actionsHistory.push(this.name + ' is doing pushups. XP Gained'); 40 | // TODO - Warrior increases XP by 1 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/lib/classes/warrior/warrior.stats.class.ts: -------------------------------------------------------------------------------- 1 | import { Level, Salary, Stat } from '@company-name/shared/data-access-model'; 2 | 3 | /** 4 | * * This class is a list of typed stats that the warrior has 5 | */ 6 | export class WarriorStats { 7 | public salary: Salary; // * How much the warrior costs 8 | public level: Level; // * Current level 9 | public xp: Stat; // TODO - Experience Points - migrate to it's own stat class 10 | 11 | constructor(data: WarriorStats) { 12 | console.log('WarriorStats', data); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/lib/primordials/event/event.class.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * * Random events (once generated) can affect any type of Object. 3 | */ 4 | 5 | export class Event { 6 | // TODO - Need to determine how to type this 7 | statType; // * The type of stat that this event effects 8 | title: string = 'Random Event'; // * Title of the random event 9 | value: number = 1; // * The numeric value of the change. Defaults to 1 10 | 11 | constructor() { 12 | console.log('Event', 'constructor'); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/lib/primordials/human/human.primordial.class.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * * Human class is primordial, which means multiple classes extend this. 3 | */ 4 | export class Human { 5 | public name: string; // * All humans have a name 6 | 7 | constructor(data?: Human) { 8 | console.log('Data Access Model', 'human.class', 'constructor()', data); 9 | Object.assign(this, data); 10 | } 11 | 12 | /** 13 | * * Builds respective class asynchronously 14 | * 15 | * @param serializedData data for a single object 16 | * @returns Promise 17 | */ 18 | public static async build(serializedData?: Human): Promise { 19 | const tempObject = new Human(serializedData); 20 | try { 21 | console.log('Data Access Model', 'human.class', 'Human created'); 22 | return tempObject; 23 | } catch (e) { 24 | console.error('Data Access Model', 'human.class', 'Error creating Human'); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/lib/primordials/primordial.readme.md: -------------------------------------------------------------------------------- 1 | # What is a Primordial? 2 | 3 | A primordial is a building block class that other classes are created from. 4 | As an example, a Human is a primordial class - there can be Warriors, Blacksmiths, Clerics... but they are all humans. 5 | 6 | It's up to you what your primordials are, but make sure they are at the very top level. 7 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/lib/primordials/stat/dependent-stat/dependent.stat.class.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ 2 | import { Stat } from '../stat.class'; 3 | 4 | /** 5 | * * DependentStat's are stats that depend on others. In an RPG game for instance, your "Attack Speed" is based 6 | * * on not only the weapon you use, but also your dexterity as well. 7 | */ 8 | export class DependentStat extends Stat { 9 | protected _otherStats = new Set(); // * List of other (unknown) stats. Calculated from classes that extend DependentStat 10 | 11 | constructor(startingValue: number) { 12 | super(startingValue); 13 | } 14 | 15 | /** 16 | * * Adds the stat to the _otherStats array 17 | * 18 | * @param stat Stat 19 | */ 20 | public addStat(stat: Stat) { 21 | this._otherStats.add(stat); 22 | } 23 | 24 | /** 25 | * * Removes the stat from the _otherStats array 26 | * 27 | * @param stat Stat 28 | */ 29 | public removeStat(stat: Stat) { 30 | this._otherStats.delete(stat); 31 | } 32 | 33 | /** 34 | * * Calculates the final value after RawBonuses and FinalBonuses have been made 35 | * 36 | * @returns finalValue 37 | */ 38 | protected calculateValue(): number { 39 | this._finalValue = super.calculateValue(); 40 | 41 | return this._finalValue; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/lib/primordials/stat/finalbonus/final-bonus.class.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-unsafe-argument */ 2 | /** 3 | * * FinalBonus is added to the Stat AFTER everything else has been calculated 4 | */ 5 | 6 | import { BaseStat } from '../stat.base.class'; 7 | 8 | export class FinalBonus extends BaseStat { 9 | constructor(value, multiplier) { 10 | super(value, multiplier); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/lib/primordials/stat/rawbonus/raw-bonus.class.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-unsafe-argument */ 2 | /** 3 | * * RawBonus is added to the raw value of the Stat 4 | */ 5 | 6 | import { BaseStat } from '../stat.base.class'; 7 | 8 | export class RawBonus extends BaseStat { 9 | constructor(value, multiplier) { 10 | super(value, multiplier); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/lib/primordials/stat/stat.base.class.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unsafe-assignment */ 2 | /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ 3 | /** 4 | * * BaseStat class value is one that comes directly from the serialized data without any kind of modifications 5 | * * The BaseStats class is used as part of the Composite OOP. This allows us to easily handle many types of stats and groupings 6 | * * Inspiration taken from https://gamedevelopment.tutsplus.com/tutorials/using-the-composite-design-pattern-for-an-rpg-attributes-system--gamedev-243 7 | */ 8 | export class BaseStat { 9 | private _baseValue: number; // * base value of the Stat 10 | private _baseMultiplier: number; // * Base multiplier of the Stat 11 | 12 | /** 13 | * * BaseStat is the origin of all stats 14 | * 15 | * @param _value value to be constructed with 16 | * @param _multiplier Optional multiplier - not every child will inherit this 17 | */ 18 | constructor(_value: number, _multiplier?) { 19 | console.log('BaseStat', 'value =', _value, 'multiplier = ', _multiplier); 20 | this._baseValue = _value; 21 | this._baseMultiplier = _multiplier || 0; 22 | } 23 | 24 | public get baseValue() { 25 | return this._baseValue; 26 | } 27 | 28 | public set baseValue(_baseValue) { 29 | this._baseValue = _baseValue; 30 | } 31 | 32 | public get baseMultiplier() { 33 | return this._baseMultiplier; 34 | } 35 | 36 | public set baseMultiplier(_baseMultiplier) { 37 | this._baseMultiplier = _baseMultiplier; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/lib/primordials/stat/stat.class.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-unsafe-argument */ 2 | import { FinalBonus } from './finalbonus/final-bonus.class'; 3 | import { RawBonus } from './rawbonus/raw-bonus.class'; 4 | import { BaseStat } from './stat.base.class'; 5 | 6 | /** 7 | * * Represents a generic Stat which is equivalent to a "Group" in the Composition Pattern. 8 | * * Can contain any bonus and has a method for calculating the final value of the stat. 9 | * * Since it is a subclass of BaseStat, _baseValue is it's starting value 10 | */ 11 | export class Stat extends BaseStat { 12 | private _rawBonuses = new Set(); 13 | private _finalBonuses = new Set(); 14 | protected _finalValue: number; 15 | 16 | constructor(value: number) { 17 | super(value); 18 | } 19 | 20 | protected addRawBonus(_bonus: RawBonus) { 21 | this._rawBonuses.add(_bonus); 22 | } 23 | 24 | protected addFinalBonus(_bonus: FinalBonus) { 25 | this._finalBonuses.add(_bonus); 26 | } 27 | 28 | protected removeRawBonus(_bonus: RawBonus) { 29 | this._rawBonuses.delete(_bonus); 30 | } 31 | 32 | protected removeFinalBonus(_bonus: FinalBonus) { 33 | this._finalBonuses.delete(_bonus); 34 | } 35 | 36 | /** 37 | * * Calculates the final value after RawBonuses and FinalBonuses have been made 38 | * 39 | * @returns finalValue 40 | */ 41 | protected calculateValue(): number { 42 | this._finalValue = this.baseValue; // * Resets each time this is called 43 | this.applyRawBonuses(); 44 | this.applyFinalBonuses(); 45 | return this._finalValue; 46 | } 47 | 48 | /** 49 | * * A raw bonus is added directly to the stat. 50 | * * An example would be subtracting costs from your revenue 51 | */ 52 | protected applyRawBonuses() { 53 | let rawBonusValue = 0; 54 | let rawBonusMultiplier = 0; 55 | for (const _tmp of this._rawBonuses) { 56 | rawBonusValue += _tmp.baseValue; 57 | rawBonusMultiplier *= _tmp.baseMultiplier; 58 | } 59 | this._finalValue += rawBonusValue; 60 | this._finalValue *= rawBonusMultiplier; 61 | } 62 | 63 | /** 64 | * * Final bonuses are meant to be added AFTER all raw bonuses are added. 65 | * * As an example, the government only tax your profits (i.e., multiplied after the cost has been deducted) 66 | */ 67 | protected applyFinalBonuses() { 68 | let finalBonusValue = 0; 69 | let finalBonusMultiplier = 0; 70 | for (const _tmp of this._rawBonuses) { 71 | finalBonusValue += _tmp.baseValue; 72 | finalBonusMultiplier *= _tmp.baseMultiplier; 73 | } 74 | 75 | this._finalValue += finalBonusValue; 76 | this._finalValue *= 1 + finalBonusMultiplier; 77 | } 78 | 79 | /** 80 | * * Returns the calculated Final Value 81 | */ 82 | public get finalValue() { 83 | return this.calculateValue(); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/lib/primordials/sword/sword.enum.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * * An enum to allow us to pass in a type to the Subject observable in PhaserInstance 3 | */ 4 | 5 | export enum SwordTypeEnum { 6 | CHEAP = 'CHEAP', 7 | FANCY = 'FANCY', 8 | } 9 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/lib/primordials/sword/sword.primordial.class.ts: -------------------------------------------------------------------------------- 1 | import { SwordTypeEnum } from './sword.enum'; 2 | 3 | /** 4 | * * Sword class is primordial, which means multiple types extend this. 5 | */ 6 | export class Sword { 7 | public swordType: SwordTypeEnum; // * The type of sword, passed in via constructor 8 | 9 | constructor() {} 10 | } 11 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/lib/stats/level/level.class.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-unsafe-argument */ 2 | import { Stat } from '@company-name/shared/data-access-model'; 3 | 4 | export class Level extends Stat { 5 | private static XP_PER_LEVEL = 5; 6 | private _xp: Stat; 7 | 8 | constructor(startingValue) { 9 | super(startingValue); 10 | } 11 | 12 | public setXp(xp: Stat) { 13 | this._xp = xp; 14 | } 15 | 16 | /** 17 | * * Calculates the final value after RawBonuses and FinalBonuses have been made 18 | * 19 | * @returns finalValue 20 | */ 21 | public calculateValue(): number { 22 | this._finalValue = this._xp.finalValue / Level.XP_PER_LEVEL; 23 | return this._finalValue; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/lib/stats/level/level.dependent.stat.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ 2 | import { Level, Stat } from '@company-name/shared/data-access-model'; 3 | 4 | /** 5 | * * LevelDependentStat's are stats that depend on the level 6 | */ 7 | export class LevelDependentStat extends Stat { 8 | protected _level: Level; 9 | 10 | public setLevel(level: Level): void { 11 | this._level = level; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/lib/stats/salary/salary.class.ts: -------------------------------------------------------------------------------- 1 | import { LevelDependentStat } from '@company-name/shared/data-access-model'; 2 | 3 | export class Salary extends LevelDependentStat { 4 | // eslint-disable-next-line no-magic-numbers 5 | private static SALARY_BOOST_PER_LEVEL = 0.06; // TODO - Document why static or change to this.__ 6 | 7 | /** 8 | * * Calculates salary with the BOOST_PER_LEVEL and all modifiers 9 | * 10 | * @returns salary Number 11 | */ 12 | public calculateValue(): number { 13 | const levelModifier = 1 + this._level.finalValue * Salary.SALARY_BOOST_PER_LEVEL; 14 | this._finalValue = this.baseValue * levelModifier; 15 | this.applyRawBonuses(); 16 | this.applyFinalBonuses(); 17 | return this._finalValue; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/lib/stats/stats.md: -------------------------------------------------------------------------------- 1 | # Stats 2 | 3 | - An object should be able to receive a Raw Bonus from any "Event" 4 | - Stats that are used together should _not_ effect each other. Instead they should use each other's values in the calculation function. 5 | - Since the entire object is serialized, this assures that permanent bonuses are saved in the object but STATS that are used together are never modified by each other. 6 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular/setup-jest'; 2 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig.base.json", 3 | "exclude": ["jest.config.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "declaration": true, 6 | "declarationMap": true, 7 | "inlineSources": true, 8 | "types": [] 9 | }, 10 | "exclude": [ 11 | "src/test-setup.ts", 12 | "**/*.spec.ts", 13 | "**/*.test.ts" 14 | ], 15 | "include": [ 16 | "**/*.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /libs/shared/data-access-model/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": [ 10 | "**/*.test.ts", 11 | "**/*.spec.ts", 12 | "**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /libs/shared/phaser-singleton/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["../../../.eslintrc.json"] 3 | } 4 | -------------------------------------------------------------------------------- /libs/shared/phaser-singleton/README.md: -------------------------------------------------------------------------------- 1 | # shared-phaser-singleton 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | ## Running unit tests 6 | 7 | Run `nx test shared-phaser-singleton` to execute the unit tests. 8 | -------------------------------------------------------------------------------- /libs/shared/phaser-singleton/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'shared-phaser-singleton', 4 | 5 | setupFilesAfterEnv: ['/src/test-setup.ts'], 6 | globals: { 7 | 'ts-jest': { 8 | tsconfig: '/tsconfig.spec.json', 9 | stringifyContentPathRegex: '\\.(html|svg)$', 10 | }, 11 | }, 12 | coverageDirectory: '../../../coverage/libs/shared/phaser-singleton', 13 | transform: { 14 | '^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular', 15 | }, 16 | transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], 17 | snapshotSerializers: ['jest-preset-angular/build/serializers/no-ng-attributes', 'jest-preset-angular/build/serializers/ng-snapshot', 'jest-preset-angular/build/serializers/html-comment'], 18 | preset: '../../../jest.preset.ts', 19 | }; 20 | -------------------------------------------------------------------------------- /libs/shared/phaser-singleton/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shared-phaser-singleton", 3 | "$schema": "../../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "library", 5 | "sourceRoot": "libs/shared/phaser-singleton/src", 6 | "prefix": "company-name", 7 | "targets": { 8 | "test": { 9 | "executor": "@nrwl/jest:jest", 10 | "outputs": ["{workspaceRoot}/coverage/libs/shared/phaser-singleton"], 11 | "options": { 12 | "jestConfig": "libs/shared/phaser-singleton/jest.config.ts", 13 | "passWithNoTests": true 14 | } 15 | }, 16 | "lint": { 17 | "executor": "@nrwl/linter:eslint", 18 | "options": { 19 | "lintFilePatterns": ["libs/shared/phaser-singleton/src/**/*.ts", "libs/shared/phaser-singleton/src/**/*.html"] 20 | } 21 | } 22 | }, 23 | "tags": [] 24 | } 25 | -------------------------------------------------------------------------------- /libs/shared/phaser-singleton/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/phaser-singleton.module'; 2 | -------------------------------------------------------------------------------- /libs/shared/phaser-singleton/src/lib/phaser-singleton.module.ts: -------------------------------------------------------------------------------- 1 | import { CommonModule } from '@angular/common'; 2 | import { ModuleWithProviders, NgModule, NgZone, Optional, SkipSelf } from '@angular/core'; 3 | import { SwordTypeEnum } from '@company-name/shared/data-access-model'; 4 | import * as Phaser from 'phaser'; 5 | import { Subject } from 'rxjs'; 6 | 7 | import { WorldScene } from './scenes/world.scene'; 8 | 9 | /** 10 | * * The PhaserInstance is a singleton that controls the Game Scene, which is the UI portion of the Game Engine 11 | */ 12 | 13 | @NgModule({ 14 | imports: [CommonModule], 15 | declarations: [], 16 | exports: [], 17 | }) 18 | export class PhaserSingletonService { 19 | // * We need the Phaser.Game to live inside our own class because extending Phaser.Game would require a super call 20 | public static activeGame: Phaser.Game; 21 | private static ngZone: NgZone; 22 | public static actionsHistory: string[] = []; // * Since phaser is a singleton, let's store the history of actions here for all components. 23 | public static shopObservable: Subject = new Subject(); 24 | 25 | constructor(private _ngZone: NgZone, @Optional() @SkipSelf() parentModule?: PhaserSingletonService) { 26 | if (parentModule) { 27 | console.error('Phaser Singleton is already loaded. Import it in the AppModule only'); 28 | } else { 29 | PhaserSingletonService.ngZone = this._ngZone; 30 | PhaserSingletonService.actionsHistory.push('Initializing Phaser...'); 31 | } 32 | } 33 | 34 | /** 35 | * * This function is required for singleton instance 36 | * 37 | * @returns PhaserSingletonService & List of Providers 38 | */ 39 | public static forRoot(): ModuleWithProviders { 40 | return { 41 | ngModule: PhaserSingletonService, 42 | providers: [], 43 | }; 44 | } 45 | 46 | /** 47 | * * When A user Logs out, destroy the active game. 48 | */ 49 | public static destroyActiveGame(): void { 50 | //* Param 1: Set to true if you would like the parent canvas element removed from the DOM. 51 | //* Param 2: Set to false If you do need to create another game instance on the same page 52 | if (PhaserSingletonService.activeGame) { 53 | PhaserSingletonService.activeGame.destroy(true, false); 54 | } 55 | } 56 | 57 | /** 58 | * * Initializes the active Phaser.Game 59 | * * The Phaser.Game instance owns Scene Manager, Texture Manager, Animations FrameHandler, and Device Class as GLOBALS 60 | * * The Scene Manager owns the individual Scenes and is accessed by activeGame.scene 61 | * * Each Scene owns it's own "world", which includes all game objects. 62 | * ! GameInstance must be the parent class to scenes. 63 | * ! Should only be called *when* we want it to load in memory. I.e. during simulation. 64 | */ 65 | public static async init(): Promise { 66 | console.warn('phaser-singleton init'); 67 | /** 68 | * * Phaser by default runs at 60 FPS, and each frame that triggers change detection in Angular which causes 69 | * * Performance to go out the door. NgZone's runOutsideAngular will prevent Phaser from automatically hitting change detection 70 | * * https://angular.io/guide/zone 71 | */ 72 | 73 | PhaserSingletonService.ngZone.runOutsideAngular(() => { 74 | if (!PhaserSingletonService.activeGame) { 75 | // To scale game to always fit in parent container 76 | // https://photonstorm.github.io/phaser3-docs/Phaser.Scale.ScaleManager.html 77 | PhaserSingletonService.activeGame = new Phaser.Game({ 78 | type: Phaser.AUTO, 79 | scale: { 80 | mode: Phaser.Scale.RESIZE, 81 | width: window.innerWidth, 82 | autoCenter: Phaser.Scale.CENTER_BOTH, 83 | height: window.innerHeight, 84 | }, 85 | parent: 'forge-main', 86 | scene: [WorldScene], 87 | plugins: { 88 | global: [], 89 | scene: [], 90 | }, 91 | fps: { 92 | forceSetTimeOut: true, 93 | }, 94 | render: { 95 | transparent: false, 96 | }, 97 | }); 98 | } 99 | }); 100 | } 101 | 102 | /** 103 | * * gets the actionsHistory 104 | * 105 | * @returns string[] 106 | */ 107 | public static getActionsHistory(): string[] { 108 | return PhaserSingletonService.actionsHistory; 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /libs/shared/phaser-singleton/src/lib/scenes/world.scene.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unsafe-member-access */ 2 | /* eslint-disable no-magic-numbers */ 3 | import { Blacksmith, CheapSword, FancySword, Sword } from '@company-name/shared/data-access-model'; 4 | import * as Phaser from 'phaser'; 5 | 6 | import { ScrollManager } from '../utilities/scroll-manager'; 7 | 8 | export class WorldScene extends Phaser.Scene { 9 | private backgroundKey = 'background-image'; // * Store the background image name 10 | private backgroundImageAsset = 'assets/blacksmith/blacksmith_bg.png'; // * Asset url relative to the app itself 11 | private backgroundImage: Phaser.GameObjects.Image; // * Reference for the background image 12 | private blackSmith: Blacksmith; // * We only have a single blacksmith in this game 13 | private scrollManager: ScrollManager; // * Custom openforge utility for handling scroll 14 | public constructedSwords: Sword[] = []; 15 | 16 | constructor() { 17 | super({ key: 'preloader' }); 18 | } 19 | 20 | async preload(): Promise { 21 | try { 22 | console.log('world.scene.ts', 'Preloading Assets...'); 23 | 24 | // * Now load the background image 25 | this.load.image(this.backgroundKey, this.backgroundImageAsset); 26 | // * Now preload the sword images, even though we don't use it initially 27 | this.load.image(FancySword.key, FancySword.imageAsset); 28 | this.load.image(CheapSword.key, CheapSword.imageAsset); 29 | // * Load the blacksmith sprites 30 | await this.preloadBlacksmithCharacter(); 31 | } catch (e) { 32 | console.error('preloader.scene.ts', 'error preloading', e); 33 | } 34 | } 35 | 36 | /** 37 | * * Load the blacksmith sprites 38 | */ 39 | preloadBlacksmithCharacter(): void { 40 | this.load.atlas(Blacksmith.idleKey, Blacksmith.spriteSheet, Blacksmith.atlast); 41 | this.load.atlas(Blacksmith.hammeringKey, Blacksmith.spriteSheet, Blacksmith.atlast); 42 | this.load.animation(this.backgroundKey, Blacksmith.animation); 43 | } 44 | 45 | /** 46 | * * Phaser will only call create after all assets in Preload have been loaded 47 | */ 48 | async create(): Promise { 49 | console.log('forge.scene.ts', 'Creating Assets...', this.scale.width, this.scale.height); 50 | 51 | // * Setup the Background Image 52 | this.backgroundImage = this.add.image(0, 0, this.backgroundKey); 53 | 54 | // * Setup the Blacksmith Character Sprite 55 | this.blackSmith = await Blacksmith.build(this); 56 | // * Because the blacksmith is a much smaller scale image than the background image, we need to scale it up. 57 | this.blackSmith.setScale(3); 58 | 59 | // * Now handle scrolling 60 | this.cameras.main.setBackgroundColor('0xEBF0F3'); 61 | 62 | // * Register our custom scroll manager 63 | this.scrollManager = new ScrollManager(this); 64 | this.scrollManager.registerScrollingBackground(this.backgroundImage); 65 | // * Set cameras to the correct position 66 | this.cameras.main.setZoom(0.25); 67 | this.scrollManager.scrollToCenter(); 68 | 69 | this.scale.on('resize', this.resize, this); 70 | } 71 | 72 | /** 73 | * * When the screen is resized, we 74 | * 75 | * @param gameSize 76 | */ 77 | resize(gameSize: Phaser.Structs.Size): void { 78 | console.log('Resizing', gameSize.width, gameSize.height); 79 | this.cameras.resize(gameSize.width, gameSize.height); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /libs/shared/phaser-singleton/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular/setup-jest'; 2 | -------------------------------------------------------------------------------- /libs/shared/phaser-singleton/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig.base.json", 3 | "exclude": ["jest.config.ts"], 4 | "compilerOptions": { 5 | "target": "es2020" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /libs/shared/phaser-singleton/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "declaration": true, 6 | "declarationMap": true, 7 | "inlineSources": true, 8 | "types": [] 9 | }, 10 | "exclude": ["src/test-setup.ts", "**/*.spec.ts", "**/*.test.ts"], 11 | "include": ["**/*.ts"] 12 | } 13 | -------------------------------------------------------------------------------- /libs/shared/phaser-singleton/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /nx.json: -------------------------------------------------------------------------------- 1 | { 2 | "npmScope": "company-name", 3 | "affected": { 4 | "defaultBase": "develop" 5 | }, 6 | "tasksRunnerOptions": { 7 | "default": { 8 | "runner": "nx/tasks-runners/default", 9 | "options": { 10 | "cacheableOperations": ["build", "lint", "test", "e2e", "stylelint"] 11 | } 12 | } 13 | }, 14 | "generators": { 15 | "@nrwl/angular:application": { 16 | "style": "scss", 17 | "linter": "eslint", 18 | "unitTestRunner": "jest", 19 | "e2eTestRunner": "cypress" 20 | }, 21 | "@nrwl/angular:library": { 22 | "linter": "eslint", 23 | "unitTestRunner": "jest" 24 | }, 25 | "@nrwl/angular:component": { 26 | "style": "scss" 27 | }, 28 | "@nrwl/react": { 29 | "application": { 30 | "style": "scss", 31 | "linter": "eslint", 32 | "bundler": "vite", 33 | "babel": true 34 | }, 35 | "component": { 36 | "style": "scss" 37 | }, 38 | "library": { 39 | "style": "scss", 40 | "linter": "eslint" 41 | } 42 | } 43 | }, 44 | "defaultProject": "example-app-angular", 45 | "$schema": "./node_modules/nx/schemas/nx-schema.json", 46 | "targetDefaults": { 47 | "build": { 48 | "dependsOn": ["^build"], 49 | "inputs": ["production", "^production"] 50 | }, 51 | "lint": { 52 | "inputs": ["default", "{workspaceRoot}/.eslintrc.json"] 53 | }, 54 | "test": { 55 | "inputs": ["default", "^production", "{workspaceRoot}/jest.preset.ts"] 56 | }, 57 | "e2e": { 58 | "inputs": ["default", "^production"] 59 | } 60 | }, 61 | "namedInputs": { 62 | "default": ["{projectRoot}/**/*", "sharedGlobals"], 63 | "sharedGlobals": ["{workspaceRoot}/.stylelintrc.json", "{workspaceRoot}/tsconfig.base.json", "{workspaceRoot}/tsconfig.json"], 64 | "production": ["default", "!{projectRoot}/.eslintrc.json", "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)", "!{projectRoot}/tsconfig.spec.json", "!{projectRoot}/jest.config.[jt]s"] 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "openforge-ionic-monorepo-example", 3 | "version": "1.0.0", 4 | "license": "MIT", 5 | "scripts": { 6 | "start": "nx serve", 7 | "build": "nx build", 8 | "test": "nx test", 9 | "postinstall": "ngcc --properties es2020 browser module main", 10 | "prepare": "husky install", 11 | "serve:app:angular": "nx serve example-app-angular", 12 | "build:app:angular": "nx build example-app-angular", 13 | "copy:app:angular": "cd apps/example-app-angular && npx cap copy", 14 | "sync:app:angular": "cd apps/example-app-angular && npx cap sync", 15 | "update:app:angular": "cd apps/example-app-angular && npx cap update", 16 | "ios:app:angular": "cd apps/example-app-angular && npx cap open ios", 17 | "android:app:angular": "cd apps/example-app-angular && npx cap open android", 18 | "serve:app:vue": "nx serve example-app-vue", 19 | "build:app:vue": "nx build example-app-vue", 20 | "serve:app:react": "nx serve example-app-react", 21 | "build:app:react": "nx build example-app-react" 22 | }, 23 | "private": true, 24 | "devDependencies": { 25 | "@angular-devkit/build-angular": "15.2.5", 26 | "@angular-devkit/core": "~15.1.0", 27 | "@angular-devkit/schematics": "~15.1.0", 28 | "@angular-eslint/eslint-plugin": "15.0.0", 29 | "@angular-eslint/eslint-plugin-template": "15.0.0", 30 | "@angular-eslint/template-parser": "15.0.0", 31 | "@angular/compiler-cli": "15.1.5", 32 | "@angular/language-service": "15.1.5", 33 | "@capacitor/cli": "^4.0.0", 34 | "@ionic/angular-toolkit": "^6.0.0", 35 | "@nrwl/angular": "15.7.1", 36 | "@nrwl/cli": "15.7.1", 37 | "@nrwl/cypress": "^15.7.2", 38 | "@nrwl/eslint-plugin-nx": "15.7.1", 39 | "@nrwl/jest": "15.7.1", 40 | "@nrwl/linter": "15.7.1", 41 | "@nrwl/react": "15.7.2", 42 | "@nrwl/vite": "^15.7.2", 43 | "@nrwl/workspace": "15.7.1", 44 | "@testing-library/react": "13.4.0", 45 | "@types/jest": "28.1.8", 46 | "@types/node": "18.11.9", 47 | "@types/react": "18.0.25", 48 | "@types/react-dom": "18.0.9", 49 | "@typescript-eslint/eslint-plugin": "5.52.0", 50 | "@typescript-eslint/parser": "5.52.0", 51 | "@vitejs/plugin-react": "^3.0.0", 52 | "@vitest/coverage-c8": "~0.25.8", 53 | "@vitest/ui": "^0.25.8", 54 | "cypress": "^12.2.0", 55 | "eslint": "8.15.0", 56 | "eslint-config-prettier": "^8.3.0", 57 | "eslint-plugin-cypress": "^2.10.3", 58 | "eslint-plugin-html": "^6.2.0", 59 | "eslint-plugin-jsx-a11y": "6.6.1", 60 | "eslint-plugin-prettier": "^4.0.0", 61 | "eslint-plugin-react": "7.31.11", 62 | "eslint-plugin-react-hooks": "4.6.0", 63 | "jest": "28.1.3", 64 | "jest-environment-jsdom": "28.1.3", 65 | "jest-preset-angular": "12.2.3", 66 | "jsdom": "~20.0.3", 67 | "nx": "15.7.1", 68 | "nx-stylelint": "^13.0.1", 69 | "prettier": "2.8.4", 70 | "prettier-eslint": "^8.8.2", 71 | "react-test-renderer": "18.2.0", 72 | "sass": "^1.55.0", 73 | "stylelint": "^14.16.1", 74 | "stylelint-config-prettier": "^8.0.0", 75 | "stylelint-config-standard": "^23.0.0", 76 | "stylelint-config-standard-scss": "^2.0.1", 77 | "ts-jest": "28.0.8", 78 | "ts-node": "10.9.1", 79 | "typescript": "4.8.4", 80 | "vite": "^4.0.1", 81 | "vite-plugin-eslint": "^1.8.1", 82 | "vite-tsconfig-paths": "^4.0.2", 83 | "vitest": "^0.25.8" 84 | }, 85 | "dependencies": { 86 | "@angular/animations": "15.1.5", 87 | "@angular/common": "15.1.5", 88 | "@angular/compiler": "15.1.5", 89 | "@angular/core": "15.1.5", 90 | "@angular/forms": "15.1.5", 91 | "@angular/platform-browser": "15.1.5", 92 | "@angular/platform-browser-dynamic": "15.1.5", 93 | "@angular/router": "15.1.5", 94 | "@capacitor/app": "^4.0.0", 95 | "@capacitor/core": "^4.0.0", 96 | "@capacitor/haptics": "^4.0.0", 97 | "@capacitor/keyboard": "^4.0.0", 98 | "@capacitor/status-bar": "^4.0.0", 99 | "@ionic/angular": "^6.5.6", 100 | "@nrwl/eslint-plugin-nx": "^13.2.1", 101 | "@schematics/angular": "^15.1.6", 102 | "@vitejs/plugin-vue": "^4.0.0", 103 | "babel-eslint": "^10.1.0", 104 | "eslint-plugin-import": "2.26.0", 105 | "eslint-plugin-jsdoc": "^37.8.0", 106 | "eslint-plugin-prefer-arrow": "^1.2.3", 107 | "eslint-plugin-simple-import-sort": "^7.0.0", 108 | "husky": "^7.0.4", 109 | "license-checker": "^25.0.1", 110 | "lint-staged": "^12.1.1", 111 | "nx": "14.0.0", 112 | "phaser": "^3.55.2", 113 | "react": "18.2.0", 114 | "react-dom": "18.2.0", 115 | "rxjs": "~7.5.0", 116 | "tslib": "^2.0.0", 117 | "zone.js": "~0.11.4" 118 | }, 119 | "eslintIgnore": [ 120 | "*.spec.ts" 121 | ], 122 | "lint-staged": { 123 | "*.{js,ts,html,tsx}": ["eslint --fix"], 124 | "*.{css,scss}": [ 125 | "stylelint --fix" 126 | ] 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Pull request type 2 | 3 | - [ ] Bugfix 4 | - [ ] Feature 5 | - [ ] Code style update (formatting, renaming) 6 | - [ ] Refactoring (no functional changes, no api changes) 7 | - [ ] Build related changes 8 | - [ ] Documentation content changes 9 | - [ ] E2E Test(s) 10 | - [ ] Other (please describe): 11 | 12 | # What is the current behavior? 13 | 14 | # What is the new behavior? 15 | 16 | # Does this introduce a breaking change? 17 | 18 | - [ ] Yes 19 | - [ ] No 20 | 21 | # Other information 22 | -------------------------------------------------------------------------------- /tools/generators/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openforge/ionic-phaser-game-template/8514086c386c8e2fbb39920813b8c8fd35b1c7c3/tools/generators/.gitkeep -------------------------------------------------------------------------------- /tools/tsconfig.tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../dist/out-tsc/tools", 5 | "rootDir": ".", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": ["node"], 9 | "importHelpers": false 10 | }, 11 | "include": ["**/*.ts"] 12 | } 13 | -------------------------------------------------------------------------------- /tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "rootDir": ".", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "importHelpers": true, 11 | "target": "es2015", 12 | "module": "esnext", 13 | "lib": ["es2017", "dom"], 14 | "skipLibCheck": true, 15 | "skipDefaultLibCheck": true, 16 | "baseUrl": ".", 17 | "paths": { 18 | "@company-name/example-app-angular/ionic/ui-modals": ["libs/example-app-angular/ionic/ui-modals/src/index.ts"], 19 | "@company-name/example-app-angular/phaser/ui-modals": ["libs/example-app-angular/phaser/ui-modals/src/index.ts"], 20 | "@company-name/shared-phaser-singleton": ["libs/shared/phaser-singleton/src/index.ts"], 21 | "@company-name/shared/data-access-model": ["libs/shared/data-access-model/src/index.ts"] 22 | } 23 | }, 24 | "exclude": ["node_modules", "tmp"] 25 | } 26 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "rootDir": ".", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "importHelpers": true, 11 | "target": "es2015", 12 | "module": "esnext", 13 | "lib": [ 14 | "es2017", 15 | "dom" 16 | ], 17 | "skipLibCheck": true, 18 | "skipDefaultLibCheck": true, 19 | "baseUrl": ".", 20 | "paths": { 21 | "@company-name/example-app-angular/ionic/ui-buttons": [ 22 | "libs/example-app-angular/ionic/ui-buttons/src/index.ts" 23 | ], 24 | "@company-name/example-app-angular/ionic/ui-headers": [ 25 | "libs/example-app-angular/ionic/ui-headers/src/index.ts" 26 | ], 27 | "@company-name/example-app-angular/ionic/ui-modals": [ 28 | "libs/example-app-angular/ionic/ui-modals/src/index.ts" 29 | ], 30 | "@company-name/example-app-angular/phaser/singleton": [ 31 | "libs/example-app-angular/phaser/singleton/src/index.ts" 32 | ], 33 | "@company-name/example-app-angular/phaser/ui-modals": [ 34 | "libs/example-app-angular/phaser/ui-modals/src/index.ts" 35 | ], 36 | "@company-name/shared/data-access-model": [ 37 | "libs/shared/data-access-model/src/index.ts" 38 | ] 39 | } 40 | }, 41 | "exclude": [ 42 | "node_modules", 43 | "tmp" 44 | ] 45 | } 46 | --------------------------------------------------------------------------------