ã¿ãªãããããã«ã¡ã¯ãã©ãã¶ã©ãã³ã§ãã æ¬æ¥ã¯ã jsPDF 㨠html2canvas ã¨ãã2ã¤ã®ã©ã¤ãã©ãªã使ã£ã¦Webãã¼ã¸ãPDFã§ä¿åã§ããæ©è½ãä½ã£ã¦ã¿ã¾ãããï¼
ãã¡ã¤ã«åããã£ã¬ã¯ããªåã«ä½¿ç¨ã§ããªãæåãå«ã¾ãã¦ããªãããã§ãã¯ããããã«ãæ£è¦è¡¨ç¾ã使ã£ãã®ã§ã¾ã¨ãã¦ããã æ£è¦è¡¨ç¾ æ£è¦è¡¨ç¾ã¨ã¯ãç¹æ®ãªæåãè¨å·ã使ã£ã¦ããã¤ãã®æååã1ã¤ã®æååã§è¡¨ç¾ããæ¹æ³ã®ãã¨ãä»åæ£è¦è¡¨ç¾ã®è¨å·ã¨æå³ã«ã¤ãã¦ã®ç´¹ä»ã¯çç¥ãã¾ããJavaScriptã§æ£è¦è¡¨ç¾ã使ãæ¹æ³ã¯2種é¡ããã â æ£è¦è¡¨ç¾ãªãã©ã« ã»ã¹ã©ãã·ã¥(/)ã®ä¸ã«æ£è¦è¡¨ç¾ãã¿ã¼ã³ãç´æ¥æå®ããã ã»æ£è¦è¡¨ç¾ã®ãã¿ã¼ã³ãå¤åããªãæã«ä½¿ç¨ã â RegExpã®ã³ã³ã¹ãã©ã¯ã¿ ã»RegExp()ã®å¼æ°ã«æ£è¦è¡¨ç¾ãã¿ã¼ã³ãç´æ¥æå®ããã ã»å¤é¨ããã®å ¥åãªã©æ£è¦è¡¨ç¾ãã¿ã¼ã³ãå¤åããå ´åã«ä½¿ç¨ã
ä»åã¯Eventã使ç¨ãã¦ã¿ã¾ãã Events Events Eventã¯Phaser.Events.EventEmitterããä½ããã¨ãã§ãã¾ãã create() { //ã¤ãã³ãã¨ããã¿ this.emitter = new Phaser.Events.EventEmitter(); } onã§ã¨ãããããã¤ãã³ãã®keyã¨å®è¡ããå¦çãè¨å®ããemitã§ãã¼ãæå®ãã¦å®è¡ãã¾ãã create() { //ã¤ãã³ãã¨ããã¿ this.emitter = new Phaser.Events.EventEmitter(); //ã¤ãã³ããç»é² this.emitter.on("text", ()=>this.AddText(true), this); //ã¤ãã³ããå®è¡ this.emitter.emit("text"); } ã¾ãeventsã¯ãªãã¸ã§ã¯ãã«ãè¨å®ãããã¨ãã§ãã¾
Phaser3ã§ã¹ãã対å¿ãã©ã¦ã¶ã²ã¼ã ãä½ã JavaScript対å¿ã®ã²ã¼ã ã¨ã³ã¸ã³ãPhaser3ããç¨ãã¦ãã¹ãã対å¿ã®ãã©ã¦ã¶ã²ã¼ã ãä½ãéã®tipsãã¾ã¨ããWikiã§ãã ããããã¼ã¸ãã¼ã¸ä¸è¦§ã¡ã³ãã¼ç·¨é ãµã¦ã³ã æçµæ´æ°ï¼ID:zWGpEtugdQ 2022å¹´11æ07æ¥(æ) 23:16:18å±¥æ´ Tweet preloadå ã§ç»åã¨åãããã«èªã¿è¾¼ãã§ãcreateå ã§åçããã preload() { this.load.audio('bgm', 'bgm.wav'); } create(){ this.music = this.sound.add('bgm'); } javascriptã使ã£ã¦ãã©ã¦ã¶ä¸ã§é³æ¥½ãåçãããéã¯ã ã»ã¦ã¼ã¶æä½ï¼ã¿ãããªã©ï¼ãæ¤ç¥ãã¦ããåçããå¿ è¦ããã ã»ã¦ã¼ã¶ãä»ã®ã¿ãã«ç§»åããéã«é³æ¥½ãä¸æåæ¢ãããå ´åããblur|fo
2021å¹´1æ8æ¥ Pheser3ã®ãã¥ã¼ããªã¢ã«ã®ã©ãã試ãããã¨ã¿ã¦ãããã¨ã³ãã¬ã¹ã©ã³ãã¼ã¨ããã®ããã£ãã®ã§èªãã§ã¿ãã Stepã5段éã§èª¬æãã¦ããã¦ããã Step1: playerã¨platformãç½ãåè§ã§è¡¨ç¾ãplatformã¯ãªãµã¤ã¯ã«ãã¦ãããStep2: playerã¢ãã¡ã¼ã·ã§ã³Step3: ã³ã¤ã³ãç»å ´ãplatformãç»åã«ãStep4: èæ¯ã«å±±ãé ãã®ã§ç§»åé度ãä»ããé ããStep5: çç»å ´ãå½ããå¤å®ã表示ããå°ããã ã²ã¼ã å 容 ã¿ãããããã¯ã¯ãªãã¯ã«ããã¸ã£ã³ããããã¸ã£ã³ãã¯ã¸ã£ã³ãä¸ã«ããä¸åº¦ã ãã¸ã£ã³ãã§ãããçã«å½ããã¨ç¼ãæ»ã¬ãã³ã¤ã³ãåãããç»é¢ä¸ã¾ã§è½ã¡ãã¨çµãããã²ã¼ã ãèªåçã«éå§ããã 次ã®ãã¼ã¸ã§éã¹ãã ã³ã¼ã game.jsã®ã³ã¼ãã«ã³ã¡ã³ãã追å ããã // ã²ã¼ã ã¤ã³ã¹ã¿ã³ã¹ let game; // ã²ã¼ã
Phaser3 ã·ã¼ã³ç®¡ç ååã®è¨äº https://mijinc0.github.io/blog/post/20200820_phaser3_about/ Phaser3ã®ã·ã¼ã³ç®¡çã«ã¤ãã¦ã â» typesriptã§æ¸ããã¨ãåæã«ãã¦ãã¾ã åºæ¬ Phaserã®ã·ã¼ã³ãæ±ãæããã¥ã¼ããªã¢ã«ã«å¾ã£ã¦æ¸ãã¨Sceneãç¶æ¿ããã¯ã©ã¹ãèªåã§ç¨æãããã¨ã«ãªãã¨æãã Sceneã¯ã©ã¹ã«ã¯init,preload,create,updateãç¨æããã·ã¼ã³ãéå§ãã¦çµäºããã¾ã§ãããããã®ãã§ã¼ãºã§å¿ è¦ãªå¦çãããã«æ¸ãã¦ããã init : 主ã«preloadåã«ãã£ã¦ããããåæåå¦çãæ¸ã preload : 主ã«ã¢ã»ãã(ã¹ãã©ã¤ããé³æ¥½ãªã©)ãèªè¾¼ãå¦çãæ¸ã create : ã·ã¼ã³ã«ã¿ã¤ã«ããããã¹ãã©ã¤ããé ç½®ããå¦çãæ¸ã(ã·ã¼ã³ãä½ãã¡ã¤ã³ã¯ãã) update :
Phaser 3ã®è¨äºã§ç´¹ä»ãã¦ãããµã³ãã«ã³ã¼ãã«ä½¿ã£ã¦ããå ¨ä½çãªåºæ¬æ§é ã§ãã Phaser 3ã§ã¯ãã¼ã¹ã«ãªãã¹ã¯ãªããã®æ§é ã«æ§ã ãªæ¸ãæ¹ãããã極åå ±éã§ä½¿ããã³ã¼ãã«ãªãããã«èæ ®ã¯ãã¦ãã¾ãããå 容ã«ãã£ã¦ã¯ãµã³ãã«ã³ã¼ããæ£å¸¸ã«åããªãã±ã¼ã¹ãããããããã¾ããã ã²ã¼ã ã¹ã¯ãªããã®å ¨ä½åãç´¹ä»ãã¦ãããã¨ã§ãåé¡ã®è§£æ±ºã«ç¹ããã°ã¨æãã¾ãã ãµã³ãã«ã³ã¼ãã§å©ç¨ãã¦ããåºæ¬æ§é index.html <!DOCTYPE html> <html lang="jp"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1"> <title>ãµã³ãã«ã³ã¼ãã®åºæ¬æ§é </t
Phaser3 Loaderãã©ã°ã¤ã³ version : 3.52.0 Phaser3ã使ã£ã¦ãã¦ãç»åããµã¦ã³ããªã©ã®ã¢ã»ãããå¤é¨ãããã¼ãããã¨ããPhaser3ã®ãã¥ã¼ããªã¢ã«éãã«ã³ã¼ããæ¸ãã¦ããã¨ãåã·ã¼ã³ã® preload é¢æ°ã«ããã¨ãã°ä»¥ä¸ã®ããã«æ¸ãã¦ã¢ã»ããããã¼ããããã¨ã«ãªãã¨æãã // this === Phaser.Scene preload(): void { // loadã¯Phaser.Loader.LoaderPlugin this.load.json(...args); this.load.spritesheet(...args); } é常ã¯ããã§è¯ããããããããã¨ãã£ã¦ããã¨Phaser3ã®ããªã»ããã«ãªããã¡ã¤ã«å½¢å¼ã®ãã¡ã¤ã«ãèªåã§ãã¼ãããããªããã¨ããããä¾ãã°ä»¥ä¸ã®ãããªå ´åã å¤è¨èªå¯¾å¿ããããå ¨ã¦ã®è¨èªã§åããã©ã³ãã使ãã
ç¾å¨ï¼2022/12/30ï¼ãRecursionCSã«ã¦ä¸ç´è åãã®ãã¼ã éçºã«åãçµãã§ãã¾ãã ã²ã¼ã ç»é¢ã®æåã«CanvasAPIã¨Phaser3ã使ç¨ã ãã®ä¸ã§ãã1åã ãå½ããå¤å®ãè¡ããã¨ããã·ã³ãã«ãªå¦çã«æãã®å¤æéåã£ãã®ã§ã解決æ¹æ³ãè¨é²ã¨ãã¦æ®ãã¾ãã ã解決çãã¯ã©ã¹å¤æ°ã«å½ãã£ããã©ããã®ç¶æ ãæããã¦ãã export class GameScene extends Scene { private hit: boolean; constructor() { super({ key: 'GameScene' }); this.hit = true; // ããããããã©ããç¶æ ãå¤å¥ããå¤æ° } // ï½ï½ä¸ç¥ï½ï½ create() { // ï½ï½ä¸ç¥ï½ï½ this.physics.add.collider( this.player, this.explosio
var config = { type: Phaser.AUTO, width: 800, height: 600, scene: { preload: preload, create: create, update: update } }; var game = new Phaser.Game(config); function preload () { this.load.image( ... } function create () { this.add.image( ... } function update () { ... } class MyScene extends Phaser.Scene { constructor (config) { super(config); } preload () { this.load.image( ... } create () { th
ããã«ã¡ã¯ï¼ 次ã«çæãããã®ããã¾ãã¯åããã®ãä½ããããã¨ãããã¨ã§ã¿ã¤ã«ãããã®èªã¿è¾¼ã¿ã§ãã ã¿ã¤ã«ãããã¨ã¯ãæãªããã®2Dï¼3Dãããããã§ããï¼ã²ã¼ã ãä½ãã¨ãã®ããã¯ã®çµµã®ãã¨ã§ãã ã¹ã¼ãã¼ããªãªã®ãããã¯ã¨ãããã©ã¯ã¨ã®å°å³ãããã¨ãããããªã¤ã¡ã¼ã¸ã§ã SRPGä½ãã¨ãã«ãã¾ãå¿ è¦ã«ãªããããªæ°ããã¾ãã ãããä½æ(1) ãããä½æ(1) ãããã®ã¿ã¤ã«ããã ã©ã¤ããµã¤ã¯ã« GameScene.ts TilemapConfig ããè¤éãªãããã« éå»ã®æ¥è¨ ãããã®ã¿ã¤ã«ããã ã¾ãã¯ã¿ã¤ã«ããããåå¾ãã¦ç»åãã¡ã¤ã«ãèªã¿è¾¼ã¿ã¾ãã ä»åã¯ããããçµµä¸çãããèåã®ã¿ã¤ã«ãããããåããã¦ã¾ããã¾ããã èåããã yms.main.jp ç»åãã¡ã¤ã«(pngç)ã¯preload()é¢æ°ã®ä¸ã§èªã¿è¾¼ã¿ã¾ãã this.load.image("PLAIN_MAP
2021å¹´1æ7æ¥2021å¹´1æ9æ¥ Phaserã¯HTML5ã²ã¼ã ãä½æããããã«ä½¿ç¨ã§ãã2Dã²ã¼ã ãã¬ã¼ã ã¯ã¼ã¯ã ããã ãåãã®ãªãªã¼ã¹ã2013å¹´ã ãã2020å¹´ãæ´æ°ããã¦ããããã¥ã¼ããªã¢ã«ãã²ã¨ã¤ãã£ã¦ã¿ãã ããããã¼ã¸ã®[LEARN]ãã¯ãªãã¯ãã¦éããã¼ã¸ã§[Making your first Game]ã¨ãããã¥ã¼ããªã¢ã«ããã£ã¦ã¿ãããã®ãã¥ã¼ããªã¢ã«ã¯ã¨ã¦ã親åã§200è¡ã»ã©ã®ã³ã¼ãã10段éã«åãã¦èª¬æãã¦ããã¦ãããæ®å¿µãªããæ¥æ¬èªçããªãããã©ã¦ã¶ã®ç¿»è¨³æ©è½ã使ãã°å 容ã¯ç解ã§ãããzipãã¡ã¤ã«ããã¦ã³ãã¼ãããã°ã³ã¼ããå ¥åããªãã¦ã大ä¸å¤«ã ãpart10.htmlãå®æçã ã Local phaser3ãåããã®ã«ãã¼ã«ã«ã§ãWebãµã¼ãã¼ãå¿ è¦ã¨ã®ãã¨ã§ããã¤ãWordPressã§ä½¿ã£ã¦ããLocalã§åããã¦ã¿ãããµã¤ããä½ãã¨Phaserã§ã¯ãã
ä»åã¯ã·ã¼ã³ã®åºæ¬çãªæ§é ã«ã¤ãã¦ç´¹ä»ãããã¾ãã preload, create, update preload : ã¢ã»ããã®èªã¿è¾¼ã¿ãã·ã¼ã³ã®åæºå create : ã²ã¼ã ãªãã¸ã§ã¯ãã®ä½æã«é©ããã¿ã¤ãã³ã° update : æ¯ãã¬ã¼ã å®è¡ãããããã²ã¼ã ã«ã¼ãé¨å scene.getã§ä»ã®ã·ã¼ã³ã®ä¸èº«ãåå¾ãã scene.getã§ã·ã¼ã³ãåå¾ãã preload, create, update ååã®ã·ã¼ã³å®è¡ã®è¨äºã§ã¯èª¬æãçãã¾ãããã preload, create, updateã¯ã·ã¼ã³ã®åºæ¬æ§é ã§ãã ãããã使ã£ã¦åçãã¿ã³ã®å¨ããå転ããå弧ãä½ã£ã¦ã¿ã¾ãããã //å¥ã·ã¼ã³ããã¢ã¯ã»ã¹ã§ããããã«publicã«ãã¦ãã public sprite: Phaser.GameObjects.Sprite; constructor() { //Sceneãæ¡å¼µãã¦ã¯
ä»åã¯Phaser 3ã§è¿½å ãããæ°æ©è½ãSceneãç´¹ä»ãããã¾ãã Sceneã¯Phaserã®ã³ã³ãã¼ãã³ããç°¡åã«ä¸æ¬ç®¡çã§ããã®ã§é常ã«ä¾¿å©ã§ãã ã·ã¼ã³ãä½ããç»é²ãã start()ã§é·ç§»ãlaunchã§ä¸¦åå®è¡ startã«ããé·ç§» launchã«ãã並åå®è¡ ç·æ¬ããµã³ãã«ã³ã¼ãå ¨æ ååã®è¨äºã gpnotes.hatenablog.jp å ã®ãµã³ãã«ã³ã¼ãã§ã¯ãPhaser3ããåºåããSceneãä½ã£ã¦ãã¾ãã ä»åã¯ãã®ã³ã¼ããåºã«Sceneã®ç»é²ãå®è¡ãªã©ã®åºæ¬çãªæ±ãæ¹ãåå¼·ãã¦ããã¾ãã ã·ã¼ã³ãä½ããç»é²ãã ååã®ãµã³ãã«ã³ã¼ããå°ãå¤æ´ãã¾ããã ã·ã¼ã³ãè¤æ°è¨è¿°ããå ´åãå¼ã³åºãããã®ãã¼ãè¨å®ããå¿ è¦ãããããã ã³ã³ã¹ãã©ã¯ã¿å ã§è¨å®ãè¨è¿°ãã¦ãã¾ãã class MyScene1 extends Phaser.Scene { constructo
â ãã¤ã³ãï¼ç»åã¢ã»ãããæ¢ã«ãã¼ãããããã©ããã®ç¢ºèªæ¹æ³ ç»åã¢ã»ããããã¼ãããæã§ããã®ç»åã¢ã»ãããæ¢ã«ã²ã¼ã ãªãã¸ã§ã¯ãã«å²ãå½ã¦ããã¦ãããã©ããã確èªããå¿ è¦ãããã¾ãã ç»åã¢ã»ãããTextureManagerã«ä¿åããã¦ãã¾ãã®ã§ãTextureã¤ã³ã¹ã¿ã³ã¹ã¨ãã¦ã¢ã¯ã»ã¹ã§ãã¾ãã ã»æ¹æ³ï¼
tilemapãå©ç¨ãããããã®ä»çµã¿ ãããã¨ãã£ã¿ï¼Tiledï¼ã§ä½æããtilemapãå©ç¨ãã¦ãããããä½æãã¾ããåæ©çãªtilemapãå©ç¨ãããã¿ã¼ã³ã§ã ãããã®ä½¿ç¨ ã¿ã¤ã«ã¯64x64 横ã¯12ãã¹ã縦ã¯12ãã¹ ã¬ã¤ã¤ã¼ã¯1åã ããã¬ã¤ã¤ã¼åã¯stage ã¬ã¤ã¤ã¼stageã«ã¯ãã¬ã¤ã¤ã¼ã¯è¡çªãã ããã§ç®æããã® ã¨ããããtilemapã®è¡¨ç¤º ãã¬ã¤ã¤ã¼ã¯ä¸ä¸å·¦å³ã«ç§»åã1åã®ç§»åã§64移åãã ãã¬ã¤ã¤ã¼ã¯ç§»åæã«ã¢ãã¡ã¼ã·ã§ã³ãã ãããå ã«ã©ã¤ããå°å ¥ãã¦ãã¬ã¤ã¤ã¼ä½ç½®ãã©ã¤ãã§ç §ããä»çµã¿ã¯æ¬¡ã®èª²é¡ã«ãã å©ç¨ããã¹ãã©ã¤ãç»å 以ä¸ã®ç»åãå©ç¨ããtilemapã¨ãã¬ã¤ã¤ã¼ãä½æãã¾ãã1åã®ã¿ã¤ã«ã®ãµã¤ãºã¯æ¨ª64ã縦64ã§ã ãã¡ãã®ç»å preloadã¡ã½ãã this.load.spritesheetã§ã¹ãã©ã¤ãç»åãèªã¿è¾¼ã¿ã¾ããframeWidt
æ¦è¦# TiledMapEditor ã§ä½æããã¿ã¤ã«ãããã Phaser3 ã§èªã¿è¾¼ãæ¹æ³ãç´¹ä»ãã¾ãã ã¢ã»ããã®èªã¿è¾¼ã¿# ã¿ã¤ã«ãããã§ä½¿ç¨ããç»åãã¼ã¿ã¨ããããã¼ã¿ã® JSON ãã¡ã¤ã«ãèªã¿è¾¼ã¿ã¾ãã ãã¼ã¿ãèªã¿è¾¼ãé¢æ°ã®æåã®å¼æ°ã«ã¯ã®ã¡ã«å¥ã®é¢æ°ããå¼ã³åºãããã®ååã¨ãªããã¼ãæå®ãã¾ãã ããä¸ã¤ã®å¼æ°ã«ã¯ãã¡ã¤ã«ã®ãã¹ãå ¥ãã¾ãã preload() { this.load.image("tiles", "tiles/dungeon_tiles.png") this.load.tilemapTiledJSON("dungeon", "tiles/dugeon-01.json") } ç»é¢ã¸ã®æç»# èªã¿è¾¼ãã JOSN ãã¡ã¤ã«ã®ãã¼ã¿ã使ã£ã¦ã¿ã¤ã«ãããã®ã¤ã³ã¹ã¿ã³ã¹ãä½æãã¾ãã ããã¦ãã¤ã³ã¹ã¿ã³ã¹ã«ã¿ã¤ã«ã»ããã®ç»åãã¼ã¿ã渡ãã¾ãã æå¾ã«ãcreat
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}