Adding Outline capabilities and a ActionableItem notion.
This commit is contained in:
parent
f7466994c5
commit
ed146226cf
18 changed files with 369 additions and 33 deletions
24
front/src/Phaser/Items/Computer/computer.ts
Normal file
24
front/src/Phaser/Items/Computer/computer.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
import * as Phaser from 'phaser';
|
||||
import {Scene} from "phaser";
|
||||
import Sprite = Phaser.GameObjects.Sprite;
|
||||
import {ITiledMapObject} from "../../Map/ITiledMap";
|
||||
import {ItemFactoryInterface} from "../ItemFactoryInterface";
|
||||
import {GameScene} from "../../Game/GameScene";
|
||||
import {ActionableItem} from "../ActionableItem";
|
||||
|
||||
export default {
|
||||
preload: (loader: Phaser.Loader.LoaderPlugin): void => {
|
||||
loader.atlas('computer', 'http://maps.workadventure.localhost/computer/computer.png', 'http://maps.workadventure.localhost/computer/computer_atlas.json');
|
||||
},
|
||||
create: (scene: GameScene): void => {
|
||||
|
||||
},
|
||||
factory: (scene: GameScene, object: ITiledMapObject): ActionableItem => {
|
||||
// Idée: ESSAYER WebPack? https://paultavares.wordpress.com/2018/07/02/webpack-how-to-generate-an-es-module-bundle/
|
||||
let foo = new Sprite(scene, object.x, object.y, 'computer');
|
||||
scene.add.existing(foo);
|
||||
|
||||
return new ActionableItem(foo, 32);
|
||||
//scene.add.sprite(object.x, object.y, 'computer');
|
||||
}
|
||||
} as ItemFactoryInterface;
|
Loading…
Add table
Add a link
Reference in a new issue