ð°MacOSXã§RPGãã¯ãŒã«MV補ã²ãŒã ãå¿«é©ã«éã¶ããã«ãã£ãããš
ãè©«ã³
Qiitaã®å
èšäºã«ãŠãåºåãç·ãã---ãã§æžããŠããå ŽæãããããããZennã®èšæ³ã«å¹²æžããŠäžéšããŸã衚瀺ã§ããªãèšäºãããäºãèªèããŠããŸãã
å
šãŠã®èšäºã粟æ»ããããŠããªãããããææ°ã§ãããèŠããã®éã¯æããŠããã ãããšå€§å€åã³ãŸãã
æ¬çš¿ã¯éãšã³ãžãã¢ã®RPGãã¯ãŒã«ã§ã®ã²ãŒã äœè
ïŒãã¯ã©ãŒïŒã®æ¹åãã«æžãçŽããŸããã
å
èšäº
éçºè ç®ç·ã§æžããŠããŸããããã¬ã€ã€ãŒãšããŠã䜿ããæ å ±ãããã¯ããã§ãã
RPGãã¯ãŒã«MV補ã®ã²ãŒã ãå®å šã»å®å®ããç°å¢ã§éã¶
RPGã¢ãããŒã«ïŒçŸåšã¯ééïŒã§éã¹ãŠãããããªãªãŒãã³ãªå Žæãããã°è¯ãã®ã§ãããplicyããµããŒã以å€ã®éžæè¢ãåã£ãå ŽåïŒèªãµã€ãã§ã®å
¬éãªã©ïŒã¯å®è¡ç°å¢ãèªåã§çšæããªããã°ãªããŸããã
PRGMVã ãšwwwãã£ã¬ã¯ããªïŒWindowsã²ãŒã ãæ³å®ããŠããã®ã§ãã©ã«ããšåŒã¶ã¹ãïŒïŒããããindex.htmlããã©ãŠã¶ã§éãã°ã²ãŒã ãå®è¡ããããšãã§ããŸãã
å°ãªããšãwineã䜿ãããã¯å®å®ãããæ©ãã§ãã
ããããæ®éã«éããšCORSãšã©ãŒãèµ·ããã®ã§ããµã¯ããšããŒã«ã«ã§WebãµãŒããŒãç«ãŠãŠåé¿ããŸãããããšããã¢ãããŒããæ€èšããŸãã
<details>
<summary>ç»åã§èŠãCORSãšã©ãŒãšã¯ïŒ</summary>
ãšã©ãŒã¡ãã»ãŒãžã¯ç°ãªãå¯èœæ§ããããŸã
URLæ¬ããfile://ã/ïŒãããžã§ã¯ãåïŒ/www/index.html
ãã ãšäžã®ããã«ãªããŸãã
</details>
æäœéå¿ èŠãªã³ãã³ãïŒã¿ãŒããã«ã䜿çšïŒ
npm install live-server # 1åã ãå®è¡ããã°ä»¥éã¯äžèŠ
npx live-server
ããã§å®è¡ã§ããŸãã
ã»ãŒãåŸã«ãµãŒããŒããã·ã³ãåèµ·åããŠãåœç¶ãããŒãããŠç¶ãããéã¹ãŸãã
äžå¿ãWindowsã§ãçå±çã«ã¯åãæ¹æ³ã䜿ããŸãããå ã exeãåãç°å¢ãªã®ã§ãã®æ¹æ³ãæ¡çšããã¡ãªããã¯èãã§ãã
finderããããã«ã¯ãªãã¯ã§èµ·åãããïŒ
ããŠãæ¬é¡ã§ãã
å
èšäºããã¹ãã³ã¢ãŠãããçç±ãšãèšããŸãã
ãã£ããã ãããªãã¡ãã£ãŠMac/Linux察å¿çãšããŠãããžã§ã¯ãã«ïŒã€ãã¡ã€ã«ãå ¥ããã°å®æããä»çµã¿ã眮ããŠãããŸãã
1. Game.exeãšåããã©ã«ãã«ä»¥äžã眮ããŠãã ãã
#!/bin/sh
cd $(dirname $0)/www
npx live-server
ãã®å
容ãã³ããããŠã¡ã¢åž³ãªã©ã«è²Œã£ãŠãGame.command
ããšããååã§ä¿åããŠãã ããã
2. Game.commandã«å®è¡æš©éãä»äžããŠãã ãã
Game.commandã«å®è¡æš©éãä»äžããããã«ã¯ã¿ãŒããã«ã䜿çšããŸãã
念ã®çºãWindowsã®å Žåã¯PowerShellã§ãã
npm install live-server
chmod +x Game.command
é çªã¯ãããŸããããã ããã©ã¡ããå®è¡ããŠãã ããã
2.ã¯ç¹ã«æ³šæãå¿
èŠã§ãGame.command
ãããå Žæã§å®è¡ããå¿
èŠãããã®ã§ããcdã³ãã³ãããšããã¡ã€ã«ãã¹ãã«ã€ããŠå°ã調ã¹ãå¿
èŠããããŸãã
ChatGPTã«èãã®ãäžçªãã¹ãã§ãã
3.ïŒéã¶äººïŒ ã²ãŒã ãèµ·åããŸã
Game.command
ãããã«ã¯ãªãã¯ã§å®è¡ããŸãã
ãã©ãŠã¶ãéããhttp://127.0.0.1:8080/
ãã«ã¢ã¯ã»ã¹ããã®ã§ãéåžžèµ·åããåŸã¯æãæãã«ãã¬ã€ïŒ
ãŠãã«ãªindex.htmlãçŽæ¥ã²ãããŠURLæ¬ããfile://ã/ïŒãããžã§ã¯ãåïŒ/www/index.html
ãã®ããã«ãªã£ãŠããŸããªãããã«ïŒ
4.(éçºè ) æ®éã«å§çž®ããŠé åžããŸã
ãããŸãã
Discussion