This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| abc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var game = require('../common/game'); | |
| class Camera extends Phaser.Group { | |
| constructor({x = 0, y = 0}) { | |
| super(game); | |
| var {world, physics, camera} = game; | |
| var {centerX, centerY, bounds} = world; | |
| this.scale.setTo(1, 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //... | |
| , game = new Phaser.Game(properties.size.x, properties.size.y, Phaser.AUTO, 'game'); | |
| // Automatically register each state. | |
| _.each(states, function(state, key) { | |
| game.state.add(key, state(game)); | |
| }); | |
| //... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Joystick extends Phaser.Sprite { | |
| constructor(x, y) { | |
| super(game, 0, 0, 'background'); | |
| this.anchor.setTo(0.5, 0.5); | |
| /* Pin indicator - what players think they drag */ | |
| this.pin = game.add.sprite(0, 0, pin); | |
| this.pin.anchor.setTo(0.5, 0.5); | |
| this.addChild(this.pin); | |
| /* Invisible sprite that players actually drag */ | |
| var dragger = this.dragger = game.add.sprite(0, 0, null); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| constructor(x, y) { | |
| ... | |
| this.isBeingDragged = false; | |
| dragger.events.onDragStart.add(this.onDragStart, this); | |
| dragger.events.onDragStop.add(this.onDragStop, this); | |
| ... | |
| } | |
| onDragStart(){ | |
| this.isBeingDragged = true; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var normalize = Phaser.Point.normalize; | |
| var zero = new Phaser.Point(0, 0); | |
| class Joystick extends Phaser.Sprite { | |
| constructor({x, y, holder, pin}) { | |
| super(game, 0, 0, holder); | |
| this.anchor.setTo(0.5, 0.5); | |
| this.fixedToCamera = true; | |
| this.cameraOffset.setTo(x, y); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** Config part */ | |
| var FIXED_SIZE = 600; | |
| var FIXED_MEASURE = 'Height'; | |
| /** Name maping */ | |
| var fixedName = FIXED_MEASURE; | |
| var resName = fixedName === 'Height' ? 'Width' : 'Height'; | |
| var FIXED_NAME = fixedName.toUpperCase(); | |
| var RES_NAME = resName.toUpperCase(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Phaser.Plugin.Inspector.DetailPlugin.add(Phaser.Plugin.Inspector.DetailPlugin.FrameRenderPlugin); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getRandomShapes(width, height) { | |
| var shapeArray = new Array(); | |
| for (var y = 0; y < height; y++) { | |
| for (var x = 0; x < width; x++) { | |
| var topTab = undefined; | |
| var rightTab = undefined; | |
| var bottomTab = undefined; | |
| var leftTab = undefined; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Datastore\Abstracts; | |
| class Type { | |
| const String = 1; | |
| const Integer = 2; | |
| const Datetime = 3; | |
| const Float = 4; | |
| const Boolean = 5; |
OlderNewer