File tree Expand file tree Collapse file tree 12 files changed +1532
-883
lines changed
Expand file tree Collapse file tree 12 files changed +1532
-883
lines changed Original file line number Diff line number Diff line change 3737 "coin-runner" : " cd src/games/coin-runner && yarn && yarn run serve-dev" ,
3838 "endless-runner" : " cd src/games/endless-runner && yarn && yarn run serve-dev" ,
3939 "flappy-bird" : " cd src/games/flappy-bird && yarn && yarn run serve-dev" ,
40- "snake" : " cd src/games/snake && yarn && yarn run dev" ,
40+ "snake" : " cd src/games/snake && yarn && yarn run serve- dev" ,
4141 "space-invaders" : " cd src/games/space-invaders && yarn && yarn run dev" ,
4242 "space-shooter" : " cd src/games/space-shooter && yarn && yarn run dev" ,
4343 "super-mario-land" : " cd src/games/super-mario-land && yarn && yarn run dev" ,
Original file line number Diff line number Diff line change 11{
22 "name" : " snake" ,
3- "version" : " 2. 0.0" ,
3+ "version" : " 0.0.1 " ,
44 "description" : " Snake for Phaser 3 in TypeScript" ,
55 "keywords" : [],
6+ "scripts" : {
7+ "build-dev" : " webpack --mode development" ,
8+ "build-prod" : " webpack --mode production" ,
9+ "serve-dev" : " webpack --mode development && webpack serve --mode development"
10+ },
611 "devDependencies" : {
7- "expose-loader" : " 4.0.0" ,
8- "ts-loader" : " 9.3.1" ,
9- "typescript" : " 4.8.0-dev.20220730" ,
10- "webpack" : " 5.74.0" ,
11- "webpack-cli" : " 4.10.0" ,
12- "webpack-dev-server" : " 4.9.3"
12+ "@types/node" : " 20.11.25" ,
13+ "@types/webpack" : " 5.28.5" ,
14+ "copy-webpack-plugin" : " 12.0.2" ,
15+ "expose-loader" : " 5.0.0" ,
16+ "html-webpack-plugin" : " 5.6.0" ,
17+ "ts-loader" : " 9.5.1" ,
18+ "ts-node" : " 10.9.2" ,
19+ "typescript" : " 5.4.2" ,
20+ "webpack" : " 5.90.3" ,
21+ "webpack-cli" : " 5.1.4" ,
22+ "webpack-dev-server" : " 5.0.2"
1323 },
1424 "dependencies" : {
15- "phaser" : " 3.60.0-beta.9"
16- },
17- "scripts" : {
18- "dev" : " webpack --mode development && webpack serve --mode development"
25+ "phaser" : " 3.80.1"
1926 },
2027 "repository" : {
2128 "type" : " git" ,
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { MainMenuScene } from './scenes/main-menu-scene';
55export const GameConfig : Phaser . Types . Core . GameConfig = {
66 title : 'Snake' ,
77 url : 'https://github.com/digitsensitive/phaser3-typescript' ,
8- version : '2.0 ' ,
8+ version : '0.0.1 ' ,
99 width : 256 ,
1010 height : 224 ,
1111 zoom : 3 ,
Original file line number Diff line number Diff line change 22< html lang ="en ">
33 < head >
44 < meta charset ="UTF-8 " />
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1 " />
56 < meta name ="author " content ="digitsensitive " />
6- < title > Snake</ title >
7- < script src ="dist/bundle.js "> </ script >
7+ < title > < %= htmlWebpackPlugin.options.title %> </ title >
88 </ head >
99 < body >
10- < h1 > Snake</ h1 >
1110 < div id ="game "> </ div >
1211 </ body >
1312</ html >
Original file line number Diff line number Diff line change 1- export interface IGraphicsConstructor {
1+ export interface GraphicsConstructor {
22 scene : Phaser . Scene ;
33 options ?: Phaser . Types . GameObjects . Graphics . Options ;
44}
Original file line number Diff line number Diff line change 11import { CONST } from '../const/const' ;
2- import { IGraphicsConstructor } from '../interfaces/graphics.interface' ;
2+ import { GraphicsConstructor } from '../interfaces/graphics.interface' ;
33
44export class Apple extends Phaser . GameObjects . Graphics {
5- constructor ( aParams : IGraphicsConstructor ) {
6- super ( aParams . scene , aParams . options ) ;
7- this . x = aParams . options . x ;
8- this . y = aParams . options . y ;
5+ constructor ( params : GraphicsConstructor ) {
6+ super ( params . scene , params . options ) ;
7+ this . x = params . options . x ;
8+ this . y = params . options . y ;
99 this . fillStyle ( 0x61e85b , 0.8 ) ;
1010 this . fillRect (
1111 CONST . FIELD_SIZE ,
Original file line number Diff line number Diff line change 33 "target" : " ES6" ,
44 "module" : " CommonJS" ,
55 "moduleResolution" : " node" ,
6- "noImplicitAny" : true
6+ "noImplicitAny" : true ,
7+ "strict" : false ,
8+ "esModuleInterop" : true // webpack.config.ts
79 },
810 "include" : [" src/**/*" ],
911 "exclude" : [" node_modules" ]
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments