diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5536db3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# System and IDE files +Thumbs.db +.DS_Store +.idea +*.suo +*.sublime-project +*.sublime-workspace + +# Vendors +node_modules/ + +# Build +build/ +/npm-debug.log diff --git a/assets/logo.png b/assets/logo.png new file mode 100644 index 0000000..a37a23a Binary files /dev/null and b/assets/logo.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..a964ee0 --- /dev/null +++ b/index.html @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..03ac2a5 --- /dev/null +++ b/package.json @@ -0,0 +1,24 @@ +{ + "name": "phaser3-project-template", + "version": "1.0.0", + "description": "A Phaser 3 Project Template", + "main": "src/index.js", + "scripts": { + "build": "webpack" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/photonstorm/phaser3-project-template.git" + }, + "author": "Richard Davey (http://www.photonstorm.com)", + "license": "MIT", + "licenseUrl": "http://www.opensource.org/licenses/mit-license.php", + "bugs": { + "url": "https://github.com/photonstorm/phaser3-project-template/issues" + }, + "homepage": "https://github.com/photonstorm/phaser3-project-template#readme", + "devDependencies": { + "phaser": "^3.0.0-alpha.2", + "webpack": "^3.4.1" + } +} diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..7224581 --- /dev/null +++ b/src/index.js @@ -0,0 +1,34 @@ +import 'phaser'; + +var config = { + type: Phaser.AUTO, + parent: 'phaser-example', + width: 800, + height: 600, + scene: { + preload: preload, + create: create + } +}; + +var game = new Phaser.Game(config); + +function preload () +{ + this.load.image('logo', 'assets/logo.png'); +} + +function create () +{ + var logo = this.add.image(400, 150, 'logo'); + + this.tweens.add({ + targets: logo, + y: 450, + duration: 2000, + ease: 'Power2', + yoyo: true, + loop: -1 + }); + +} diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..9a8fe84 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,18 @@ +'use strict'; + +const webpack = require('webpack'); +const path = require('path'); + +module.exports = { + + entry: './src/index.js', + + output: { + path: path.resolve(__dirname, 'build'), + filename: 'project.bundle.js' + }, + + plugins: [ + ] + +};