{"id":538,"date":"2026-06-09T14:49:44","date_gmt":"2026-06-09T05:49:44","guid":{"rendered":"https:\/\/software.satoshis.jp\/?p=538"},"modified":"2026-06-14T18:51:41","modified_gmt":"2026-06-14T09:51:41","slug":"java%e3%81%a7rpg%e3%82%92%e4%bd%9c%e3%82%8b%ef%bd%9c%e5%8b%87%e8%80%85%e3%82%92%e3%83%95%e3%82%a3%e3%83%bc%e3%83%ab%e3%83%89%e4%b8%8a%e3%81%a7%e5%8b%95%e3%81%8b%e3%81%9d%e3%81%86","status":"publish","type":"post","link":"https:\/\/software.satoshis.jp\/?p=538","title":{"rendered":"Java\u3067RPG\u3092\u4f5c\u308b\uff5c\u52c7\u8005\u3092\u30d5\u30a3\u30fc\u30eb\u30c9\u4e0a\u3067\u52d5\u304b\u305d\u3046"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/software.satoshis.jp\/wp-content\/uploads\/2026\/06\/rpg-java-3-300x158.png\" alt=\"\" width=\"300\" height=\"158\" class=\"alignnone size-medium wp-image-542\" srcset=\"https:\/\/software.satoshis.jp\/wp-content\/uploads\/2026\/06\/rpg-java-3-300x158.png 300w, https:\/\/software.satoshis.jp\/wp-content\/uploads\/2026\/06\/rpg-java-3-1024x538.png 1024w, https:\/\/software.satoshis.jp\/wp-content\/uploads\/2026\/06\/rpg-java-3-768x403.png 768w, https:\/\/software.satoshis.jp\/wp-content\/uploads\/2026\/06\/rpg-java-3-1536x807.png 1536w, https:\/\/software.satoshis.jp\/wp-content\/uploads\/2026\/06\/rpg-java-3.png 1731w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\u524d\u56de\u307e\u3067\u306e\u8a18\u4e8b\u3067\u306f\u3001\u52c7\u8005\u3084\u30b9\u30e9\u30a4\u30e0\u306a\u3069\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3092\u30af\u30e9\u30b9\u3068\u3057\u3066\u4f5c\u3063\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001\u5c11\u3057RPG\u3089\u3057\u304f\u3059\u308b\u305f\u3081\u306b\u3001\u52c7\u8005\u3092\u30d5\u30a3\u30fc\u30eb\u30c9\u4e0a\u3067\u52d5\u304b\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u6587\u5b57\u3060\u3051\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3082\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u306e\u8003\u3048\u65b9\u306f\u5b66\u3079\u307e\u3059\u304c\u3001RPG\u3092\u4f5c\u308b\u306a\u3089\u3001\u3084\u306f\u308a\u753b\u9762\u304c\u3042\u3063\u305f\u65b9\u304c\u697d\u3057\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u4eca\u56de\u306f\u3001Java\u306eGUI\u6a5f\u80fd\u3092\u4f7f\u3063\u3066\u3001\u8349\u539f\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8868\u793a\u3057\u3001\u305d\u306e\u4e0a\u3067\u52c7\u8005\u3092\u52d5\u304b\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001\u3053\u3053\u3067\u5927\u4e8b\u306a\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u753b\u9762\u3092\u8868\u793a\u3059\u308b\u30af\u30e9\u30b9\u306b\u3001\u30b2\u30fc\u30e0\u306e\u72b6\u614b\u3084\u51e6\u7406\u3092\u5168\u90e8\u66f8\u3044\u3066\u3057\u307e\u3046\u3068\u3001\u3042\u3068\u304b\u3089\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u5206\u304b\u308a\u306b\u304f\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001\u52c7\u8005\u306e\u4f4d\u7f6e\u3001\u6575\u3068\u306e\u906d\u9047\u3001\u6226\u95d8\u3001HP\u306e\u5909\u5316\u306a\u3069\u3092\u3001\u3059\u3079\u3066\u753b\u9762\u30af\u30e9\u30b9\u306b\u66f8\u3044\u3066\u3057\u307e\u3046\u3068\u3001\u753b\u9762\u30af\u30e9\u30b9\u304c\u3069\u3093\u3069\u3093\u5927\u304d\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u4eca\u56de\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u5f79\u5272\u3092\u5206\u3051\u3066\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<table>\n<tr>\n<th>\u30af\u30e9\u30b9<\/th>\n<th>\u5f79\u5272<\/th>\n<\/tr>\n<tr>\n<td>Rpg<\/td>\n<td>\u30b2\u30fc\u30e0\u306e\u72b6\u614b\u3092\u7ba1\u7406\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>RpgFrame<\/td>\n<td>\u30b2\u30fc\u30e0\u306e\u72b6\u614b\u3092\u753b\u9762\u306b\u8868\u793a\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>Hero<\/td>\n<td>\u52c7\u8005\u306e\u60c5\u5831\u3092\u6301\u3064<\/td>\n<\/tr>\n<tr>\n<td>HeroLabel<\/td>\n<td>\u52c7\u8005\u306e\u753b\u50cf\u3092\u8868\u793a\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>FieldLabel<\/td>\n<td>\u30d5\u30a3\u30fc\u30eb\u30c9\u753b\u50cf\u3092\u8868\u793a\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>GuiApp<\/td>\n<td>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u8d77\u52d5\u3059\u308b<\/td>\n<\/tr>\n<\/table>\n<p>Rpg \u306f\u3001\u52c7\u8005\u304c\u3069\u3053\u306b\u3044\u308b\u304b\u3092\u7ba1\u7406\u3057\u307e\u3059\u3002<\/p>\n<p>RpgFrame \u306f\u3001\u305d\u306e Rpg \u306e\u72b6\u614b\u3092\u898b\u3066\u3001\u753b\u9762\u3092\u63cf\u753b\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u30b2\u30fc\u30e0\u306e\u72b6\u614b\u3092\u6301\u3064\u30af\u30e9\u30b9\u3068\u3001\u753b\u9762\u3092\u8868\u793a\u3059\u308b\u30af\u30e9\u30b9\u3092\u5206\u3051\u3066\u304a\u304f\u3068\u3001\u3042\u3068\u304b\u3089\u6575\u3084\u6226\u95d8\u3092\u8ffd\u52a0\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>MVC\u3092\u5c11\u3057\u610f\u8b58\u3057\u3066\u4f5c\u308b<\/h3>\n<p>\u4eca\u56de\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f\u3001MVC\u306e\u8003\u3048\u65b9\u3092\u5c11\u3057\u610f\u8b58\u3057\u307e\u3059\u3002<\/p>\n<p>MVC\u3068\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5f79\u5272\u3092\u5927\u304d\u304f\u6b21\u306e3\u3064\u306b\u5206\u3051\u3066\u8003\u3048\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<table>\n<tr>\n<th>\u540d\u524d<\/th>\n<th>\u5f79\u5272<\/th>\n<\/tr>\n<tr>\n<td>Model<\/td>\n<td>\u30c7\u30fc\u30bf\u3084\u51e6\u7406\u3092\u7ba1\u7406\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>View<\/td>\n<td>\u753b\u9762\u306b\u8868\u793a\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>Controller<\/td>\n<td>\u5165\u529b\u3092\u53d7\u3051\u53d6\u308a\u3001Model\u3092\u64cd\u4f5c\u3059\u308b<\/td>\n<\/tr>\n<\/table>\n<p>\u4eca\u56de\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f\u3001Rpg \u304c Model \u306e\u5f79\u5272\u3092\u6301\u3061\u307e\u3059\u3002<\/p>\n<p>RpgFrame \u306f\u3001Rpg \u306e\u72b6\u614b\u3092\u753b\u9762\u306b\u8868\u793a\u3059\u308b\u306e\u3067 View \u306e\u5f79\u5272\u3092\u6301\u3061\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001RpgFrame \u306f\u30ad\u30fc\u5165\u529b\u3082\u53d7\u3051\u53d6\u308b\u306e\u3067\u3001Controller \u306b\u8fd1\u3044\u5f79\u5272\u3082\u5c11\u3057\u6301\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u672c\u683c\u7684\u306bMVC\u3092\u5206\u3051\u3088\u3046\u3068\u3059\u308b\u3068\u3001Controller\u7528\u306e\u30af\u30e9\u30b9\u3092\u5225\u306b\u4f5c\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001\u6700\u521d\u304b\u3089\u7d30\u304b\u304f\u5206\u3051\u3059\u304e\u308b\u3068\u3001\u304b\u3048\u3063\u3066\u5206\u304b\u308a\u306b\u304f\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u307e\u305a\u3001<\/p>\n<p>\u30b2\u30fc\u30e0\u306e\u72b6\u614b\u306f Rpg \u306b\u6301\u305f\u305b\u308b<br \/>\n\u753b\u9762\u8868\u793a\u306f RpgFrame \u306b\u4efb\u305b\u308b<br \/>\n\u30ad\u30fc\u5165\u529b\u3092\u53d7\u3051\u305f\u3089 Rpg \u306b\u547d\u4ee4\u3059\u308b<\/p>\n<p>\u3068\u3044\u3046\u5f62\u3067\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h3>Java\u3067GUI\u3092\u4f5c\u308b\u305f\u3081\u306eSwing\u3068\u306f<\/h3>\n<p>\u4eca\u56de\u306f\u3001\u753b\u9762\u3092\u4f5c\u308b\u305f\u3081\u306b Swing \u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>Swing \u306f\u3001Java\u3067GUI\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308b\u305f\u3081\u306e\u4ed5\u7d44\u307f\u3067\u3059\u3002<\/p>\n<p>GUI\u3068\u306f\u3001\u30a6\u30a3\u30f3\u30c9\u30a6\u3001\u30dc\u30bf\u30f3\u3001\u753b\u50cf\u3001\u30e9\u30d9\u30eb\u306a\u3069\u3092\u4f7f\u3063\u3066\u64cd\u4f5c\u3067\u304d\u308b\u753b\u9762\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u666e\u6bb5\u4f7f\u3063\u3066\u3044\u308b\u30a2\u30d7\u30ea\u306e\u591a\u304f\u306f\u3001\u6587\u5b57\u3060\u3051\u3067\u306f\u306a\u304f\u3001\u30dc\u30bf\u30f3\u3084\u753b\u50cf\u3092\u4f7f\u3063\u3066\u64cd\u4f5c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Swing\u3092\u4f7f\u3046\u3068\u3001Java\u3067\u3082\u305d\u306e\u3088\u3046\u306a\u753b\u9762\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u4f7f\u3046\u4e3b\u306a\u30af\u30e9\u30b9\u306f\u3001\u6b21\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<table>\n<tr>\n<th>\u30af\u30e9\u30b9<\/th>\n<th>\u5f79\u5272<\/th>\n<\/tr>\n<tr>\n<td>JFrame<\/td>\n<td>\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u8868\u793a\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>JLabel<\/td>\n<td>\u6587\u5b57\u3084\u753b\u50cf\u3092\u8868\u793a\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>ImageIcon<\/td>\n<td>\u753b\u50cf\u3092\u8aad\u307f\u8fbc\u3080<\/td>\n<\/tr>\n<tr>\n<td>GridBagLayout<\/td>\n<td>\u90e8\u54c1\u3092\u30de\u30b9\u76ee\u306e\u3088\u3046\u306b\u914d\u7f6e\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>KeyListener<\/td>\n<td>\u30ad\u30fc\u30dc\u30fc\u30c9\u5165\u529b\u3092\u53d7\u3051\u53d6\u308b<\/td>\n<\/tr>\n<\/table>\n<p>Swing\u306b\u306f\u305f\u304f\u3055\u3093\u306e\u30af\u30e9\u30b9\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u6700\u521d\u304b\u3089\u5168\u90e8\u899a\u3048\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001RPG\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u753b\u9762\u3092\u4f5c\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u3082\u306e\u3060\u3051\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<h3>\u4eca\u56de\u4f5c\u308b\u3082\u306e<\/h3>\n<p>\u4eca\u56de\u306f\u3001\u6b21\u306e\u3088\u3046\u306a\u753b\u9762\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u8349\u539f\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8868\u793a\u3059\u308b<\/li>\n<li>\u30d5\u30a3\u30fc\u30eb\u30c9\u4e0a\u306b\u52c7\u8005\u3092\u8868\u793a\u3059\u308b<\/li>\n<li>\u77e2\u5370\u30ad\u30fc\u3067\u52c7\u8005\u3092\u4e0a\u4e0b\u5de6\u53f3\u306b\u52d5\u304b\u3059<\/li>\n<li>\u52c7\u8005\u304c\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5916\u306b\u51fa\u306a\u3044\u3088\u3046\u306b\u3059\u308b<\/li>\n<\/ul>\n<p>\u307e\u3060\u6575\u306f\u51fa\u3066\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u6226\u95d8\u3082\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001\u52c7\u8005\u304c\u30d5\u30a3\u30fc\u30eb\u30c9\u4e0a\u3092\u79fb\u52d5\u3067\u304d\u308b\u3068\u3053\u308d\u307e\u3067\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<h3>Rpg\u30af\u30e9\u30b9\u3092\u4f5c\u308b<\/h3>\n<p>\u307e\u305a\u3001\u30b2\u30fc\u30e0\u306e\u72b6\u614b\u3092\u7ba1\u7406\u3059\u308b Rpg \u30af\u30e9\u30b9\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001\u52c7\u8005\u306e\u4f4d\u7f6e\u3092\u7ba1\u7406\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic class Rpg {\r\n    public static final int FIELD_WIDTH = 10;\r\n    public static final int FIELD_HEIGHT = 8;\r\n\r\n    private Hero hero;\r\n\r\n    private int heroX;\r\n    private int heroY;\r\n\r\n    public Rpg() {\r\n        hero = new Hero();\r\n        heroX = 0;\r\n        heroY = 0;\r\n    }\r\n\r\n    public Hero getHero() {\r\n        return hero;\r\n    }\r\n\r\n    public int getHeroX() {\r\n        return heroX;\r\n    }\r\n\r\n    public int getHeroY() {\r\n        return heroY;\r\n    }\r\n\r\n    public void moveLeft() {\r\n        if (heroX &gt; 0) {\r\n            heroX--;\r\n        }\r\n    }\r\n\r\n    public void moveRight() {\r\n        if (heroX &lt; FIELD_WIDTH - 1) {\r\n            heroX++;\r\n        }\r\n    }\r\n\r\n    public void moveUp() {\r\n        if (heroY &gt; 0) {\r\n            heroY--;\r\n        }\r\n    }\r\n\r\n    public void moveDown() {\r\n        if (heroY &lt; FIELD_HEIGHT - 1) {\r\n            heroY++;\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<p>FIELD_WIDTH \u306f\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u6a2a\u306e\u30de\u30b9\u6570\u3067\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic static final int FIELD_WIDTH = 10;\r\n<\/pre>\n<p>FIELD_HEIGHT \u306f\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u7e26\u306e\u30de\u30b9\u6570\u3067\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic static final int FIELD_HEIGHT = 8;\r\n<\/pre>\n<p>\u4eca\u56de\u306f\u3001\u6a2a10\u30de\u30b9\u3001\u7e268\u30de\u30b9\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u3057\u307e\u3059\u3002<\/p>\n<h3>\u52c7\u8005\u306e\u4f4d\u7f6e\u3092\u7ba1\u7406\u3059\u308b<\/h3>\n<p>heroX \u3068 heroY \u306f\u3001\u52c7\u8005\u306e\u4f4d\u7f6e\u3067\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nprivate int heroX;\r\nprivate int heroY;\r\n<\/pre>\n<p>\u4eca\u56de\u306f\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u30de\u30b9\u76ee\u3068\u3057\u3066\u8003\u3048\u307e\u3059\u3002<\/p>\n<p>\u5de6\u4e0a\u3092 (0, 0) \u3068\u3057\u307e\u3059\u3002<\/p>\n<p>\u53f3\u306b\u9032\u3080\u3068 heroX \u304c\u5897\u3048\u307e\u3059\u3002<\/p>\n<p>\u4e0b\u306b\u9032\u3080\u3068 heroY \u304c\u5897\u3048\u307e\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001\u52c7\u8005\u304c\u5de6\u4e0a\u306b\u3044\u308b\u3068\u304d\u306f\u3001\u6b21\u306e\u3088\u3046\u306a\u72b6\u614b\u3067\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nheroX = 0\r\nheroY = 0\r\n<\/pre>\n<p>\u53f3\u306b1\u30de\u30b9\u52d5\u304f\u3068\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nheroX = 1\r\nheroY = 0\r\n<\/pre>\n<p>\u4e0b\u306b1\u30de\u30b9\u52d5\u304f\u3068\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nheroX = 1\r\nheroY = 1\r\n<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u52c7\u8005\u306e\u4f4d\u7f6e\u3092\u6570\u5024\u3067\u7ba1\u7406\u3057\u307e\u3059\u3002<\/p>\n<h3>\u79fb\u52d5\u30e1\u30bd\u30c3\u30c9\u3092\u4f5c\u308b<\/h3>\n<p>\u52c7\u8005\u3092\u52d5\u304b\u3059\u305f\u3081\u306b\u3001\u6b21\u306e4\u3064\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4f5c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nmoveLeft()\r\nmoveRight()\r\nmoveUp()\r\nmoveDown()\r\n<\/pre>\n<p>\u5de6\u306b\u52d5\u304f\u51e6\u7406\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic void moveLeft() {\r\n    if (heroX &gt; 0) {\r\n        heroX--;\r\n    }\r\n}\r\n<\/pre>\n<p>heroX \u304c0\u3088\u308a\u5927\u304d\u3044\u3068\u304d\u3060\u3051\u3001\u5de6\u306b\u52d5\u304b\u3057\u307e\u3059\u3002<\/p>\n<p>\u3082\u3057 heroX \u304c0\u306a\u3089\u3001\u3059\u3067\u306b\u4e00\u756a\u5de6\u306b\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u72b6\u614b\u3067\u3055\u3089\u306b\u5de6\u3078\u52d5\u304f\u3068\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5916\u306b\u51fa\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001heroX > 0 \u306e\u3068\u304d\u3060\u3051 heroX&#8211; \u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u53f3\u306b\u52d5\u304f\u51e6\u7406\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic void moveRight() {\r\n    if (heroX &lt; FIELD_WIDTH - 1) {\r\n        heroX++;\r\n    }\r\n}\r\n<\/pre>\n<p>\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u6a2a\u5e45\u306f FIELD_WIDTH \u3067\u3059\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001\u5ea7\u6a19\u306f0\u304b\u3089\u59cb\u307e\u308a\u307e\u3059\u3002<\/p>\n<p>\u6a2a\u5e45\u304c10\u306a\u3089\u3001\u4f7f\u3048\u308b x \u306e\u5024\u306f\u30010\u304b\u30899\u307e\u3067\u3067\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u53f3\u7aef\u306f FIELD_WIDTH &#8211; 1 \u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4e0a\u306b\u52d5\u304f\u51e6\u7406\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic void moveUp() {\r\n    if (heroY &gt; 0) {\r\n        heroY--;\r\n    }\r\n}\r\n<\/pre>\n<p>\u4e0b\u306b\u52d5\u304f\u51e6\u7406\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic void moveDown() {\r\n    if (heroY &lt; FIELD_HEIGHT - 1) {\r\n        heroY++;\r\n    }\r\n}\r\n<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5916\u306b\u51fa\u306a\u3044\u304b\u3069\u3046\u304b\u306e\u5224\u5b9a\u3082 `Rpg` \u306b\u66f8\u3044\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f\u3001\u52c7\u8005\u306e\u4f4d\u7f6e\u3092\u7ba1\u7406\u3057\u3066\u3044\u308b\u306e\u304c `Rpg` \u3060\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>RpgFrame \u306f\u3001\u300c\u52c7\u8005\u304c\u3069\u3053\u306b\u3044\u308b\u304b\u300d\u3084\u300c\u79fb\u52d5\u3067\u304d\u308b\u304b\u3069\u3046\u304b\u300d\u3092\u5224\u65ad\u3057\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u306e\u5224\u65ad\u306f Rpg \u306b\u4efb\u305b\u307e\u3059\u3002<\/p>\n<h3>moveHero\u3067\u306f\u306a\u304f\u4e0a\u4e0b\u5de6\u53f3\u306e\u30e1\u30bd\u30c3\u30c9\u306b\u3059\u308b\u7406\u7531<\/h3>\n<p>\u79fb\u52d5\u51e6\u7406\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u4f5c\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic void moveHero(int dx, int dy) {\r\n    heroX += dx;\r\n    heroY += dy;\r\n}\r\n<\/pre>\n<p>\u3053\u306e\u5f62\u306b\u3059\u308b\u3068\u3001\u79fb\u52d5\u91cf\u3092\u5f15\u6570\u3067\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001\u4eca\u56de\u306f\u3053\u306e\u5f62\u306b\u306f\u3057\u307e\u305b\u3093\u3002<\/p>\n<p>\u306a\u305c\u306a\u3089\u3001\u6b21\u306e\u3088\u3046\u306a\u547c\u3073\u51fa\u3057\u3082\u3067\u304d\u3066\u3057\u307e\u3046\u304b\u3089\u3067\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nrpg.moveHero(2, 0);\r\nrpg.moveHero(1, 1);\r\nrpg.moveHero(100, 0);\r\n<\/pre>\n<p>\u4eca\u56de\u4f5c\u308a\u305f\u3044\u306e\u306f\u3001\u77e2\u5370\u30ad\u30fc\u3092\u62bc\u3057\u305f\u3089\u4e0a\u4e0b\u5de6\u53f3\u306b1\u30de\u30b9\u305a\u3064\u52d5\u304fRPG\u3067\u3059\u3002<\/p>\n<p>2\u30de\u30b9\u52d5\u3044\u305f\u308a\u3001\u659c\u3081\u306b\u52d5\u3044\u305f\u308a\u3001\u3044\u304d\u306a\u308a100\u30de\u30b9\u52d5\u3044\u305f\u308a\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u3053\u3067\u3001\u4eca\u56de\u306f\u79fb\u52d5\u65b9\u5411\u3054\u3068\u306b\u30e1\u30bd\u30c3\u30c9\u3092\u5206\u3051\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nrpg.moveLeft();\r\nrpg.moveRight();\r\nrpg.moveUp();\r\nrpg.moveDown();\r\n<\/pre>\n<p>\u3053\u306e\u65b9\u304c\u3001\u3067\u304d\u308b\u3053\u3068\u304c\u306f\u3063\u304d\u308a\u3057\u307e\u3059\u3002<\/p>\n<p>\u300c\u5de6\u306b\u52d5\u304f\u300d\u300c\u53f3\u306b\u52d5\u304f\u300d\u300c\u4e0a\u306b\u52d5\u304f\u300d\u300c\u4e0b\u306b\u52d5\u304f\u300d\u3068\u3044\u3046\u610f\u5473\u3082\u3001\u30e1\u30bd\u30c3\u30c9\u540d\u304b\u3089\u5206\u304b\u308a\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u5fc5\u8981\u4ee5\u4e0a\u306b\u81ea\u7531\u306a\u30e1\u30bd\u30c3\u30c9\u3092\u4f5c\u3089\u306a\u3044\u3053\u3068\u3082\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u3059\u308b\u305f\u3081\u306b\u306f\u5927\u5207\u3067\u3059\u3002<\/p>\n<h3>HeroLabel\u30af\u30e9\u30b9\u3092\u4f5c\u308b<\/h3>\n<p>\u6b21\u306b\u3001\u52c7\u8005\u306e\u753b\u50cf\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306e HeroLabel \u30af\u30e9\u30b9\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nimport java.awt.Image;\r\n\r\nimport javax.swing.ImageIcon;\r\nimport javax.swing.JLabel;\r\n\r\npublic class HeroLabel extends JLabel {\r\n    public HeroLabel() {\r\n        ImageIcon icon = new ImageIcon(&quot;hero.png&quot;);\r\n        Image image = icon.getImage().getScaledInstance(48, 48, Image.SCALE_SMOOTH);\r\n        setIcon(new ImageIcon(image));\r\n    }\r\n}\r\n<\/pre>\n<p>HeroLabel \u306f\u3001\u52c7\u8005\u306e\u753b\u50cf\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30b9\u3067\u3059\u3002<\/p>\n<p>JLabel \u306f\u3001\u6587\u5b57\u3084\u753b\u50cf\u3092\u8868\u793a\u3067\u304d\u308bSwing\u306e\u30af\u30e9\u30b9\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001JLabel \u3092\u7d99\u627f\u3057\u3066\u3001\u52c7\u8005\u5c02\u7528\u306e\u30e9\u30d9\u30eb\u3092\u4f5c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic class HeroLabel extends JLabel {\r\n<\/pre>\n<p>\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u306b\u306f\u3001`hero.png` \u3092\u4f7f\u3046\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nImageIcon icon = new ImageIcon(&quot;hero.png&quot;);\r\n<\/pre>\n<p>\u753b\u50cf\u30b5\u30a4\u30ba\u306f\u300148\u00d748\u30d4\u30af\u30bb\u30eb\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nImage image = icon.getImage().getScaledInstance(48, 48, Image.SCALE_SMOOTH);\r\n<\/pre>\n<p>\u6700\u5f8c\u306b\u3001\u8aad\u307f\u8fbc\u3093\u3060\u753b\u50cf\u3092\u30e9\u30d9\u30eb\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nsetIcon(new ImageIcon(image));\r\n<\/pre>\n<p>\u3053\u308c\u3067\u3001HeroLabel \u3092\u753b\u9762\u306b\u8ffd\u52a0\u3059\u308b\u3068\u3001\u52c7\u8005\u306e\u753b\u50cf\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<h3>FieldLabel\u30af\u30e9\u30b9\u3092\u4f5c\u308b<\/h3>\n<p>\u6b21\u306b\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u753b\u50cf\u3092\u8868\u793a\u3059\u308b FieldLabel \u30af\u30e9\u30b9\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nimport java.awt.Image;\r\n\r\nimport javax.swing.ImageIcon;\r\nimport javax.swing.JLabel;\r\n\r\npublic class FieldLabel extends JLabel {\r\n    public FieldLabel() {\r\n        ImageIcon icon = new ImageIcon(&quot;grass.png&quot;);\r\n        Image image = icon.getImage().getScaledInstance(48, 48, Image.SCALE_SMOOTH);\r\n        setIcon(new ImageIcon(image));\r\n    }\r\n}\r\n<\/pre>\n<p>FieldLabel \u306f\u3001\u8349\u539f\u306e\u753b\u50cf\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30b9\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001grass.png \u3068\u3044\u3046\u753b\u50cf\u3092\u4f7f\u3046\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u52c7\u8005\u304c\u3044\u306a\u3044\u5834\u6240\u306b\u306f\u3001\u3053\u306e FieldLabel \u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>HeroLabel \u3068 FieldLabel \u306f\u3001\u3069\u3061\u3089\u3082\u753b\u50cf\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30b9\u3067\u3059\u3002<\/p>\n<p>\u5c11\u3057\u4f3c\u3066\u3044\u307e\u3059\u304c\u3001\u4eca\u56de\u306f\u307e\u3060\u305d\u306e\u307e\u307e\u306b\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>\u4eca\u5f8c\u3001\u30b9\u30e9\u30a4\u30e0\u306a\u3069\u306e\u753b\u50cf\u3082\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u306a\u308b\u3068\u3001\u753b\u50cf\u8868\u793a\u306e\u5171\u901a\u51e6\u7406\u3092\u89aa\u30af\u30e9\u30b9\u306b\u307e\u3068\u3081\u305f\u304f\u306a\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u306e\u3068\u304d\u306b\u3001\u3042\u3089\u305f\u3081\u3066\u6574\u7406\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h3>RpgFrame\u30af\u30e9\u30b9\u3092\u4f5c\u308b<\/h3>\n<p>\u6b21\u306b\u3001\u753b\u9762\u3092\u8868\u793a\u3059\u308b RpgFrame \u30af\u30e9\u30b9\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<p>RpgFrame \u306f\u3001Rpg \u306e\u72b6\u614b\u3092\u898b\u3066\u753b\u9762\u3092\u63cf\u753b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nimport java.awt.GridBagConstraints;\r\nimport java.awt.GridBagLayout;\r\nimport java.awt.event.KeyEvent;\r\nimport java.awt.event.KeyListener;\r\n\r\nimport javax.swing.JFrame;\r\n\r\npublic class RpgFrame extends JFrame implements KeyListener {\r\n    private Rpg rpg;\r\n\r\n    public RpgFrame(Rpg rpg) {\r\n        super(&quot;RPG&quot;);\r\n\r\n        this.rpg = rpg;\r\n\r\n        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n        setLayout(new GridBagLayout());\r\n\r\n        drawField();\r\n\r\n        addKeyListener(this);\r\n        setFocusable(true);\r\n\r\n        pack();\r\n        setLocationRelativeTo(null);\r\n    }\r\n}\r\n<\/pre>\n<p>RpgFrame \u306f\u3001Rpg \u3092\u30d5\u30a3\u30fc\u30eb\u30c9\u3068\u3057\u3066\u6301\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nprivate Rpg rpg;\r\n<\/pre>\n<p>\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3067 Rpg \u3092\u53d7\u3051\u53d6\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npublic RpgFrame(Rpg rpg) {\r\n    this.rpg = rpg;\r\n}\r\n<\/pre>\n<p>\u3053\u3053\u304c\u5927\u4e8b\u306a\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n<p>RpgFrame \u306e\u4e2d\u3067 new Rpg() \u3057\u3066\u3082\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u52d5\u304d\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u753b\u9762\u30af\u30e9\u30b9\u304c\u30b2\u30fc\u30e0\u672c\u4f53\u3092\u52dd\u624b\u306b\u4f5c\u3063\u3066\u3057\u307e\u3046\u3068\u3001\u3042\u3068\u304b\u3089\u6226\u95d8\u753b\u9762\u306a\u3069\u3092\u8ffd\u52a0\u3059\u308b\u3068\u304d\u306b\u6271\u3044\u306b\u304f\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u3001Rpg \u306f\u5916\u304b\u3089\u6e21\u3059\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>RpgFrame \u306f\u3001\u6e21\u3055\u308c\u305f Rpg \u306e\u72b6\u614b\u3092\u753b\u9762\u306b\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u63cf\u753b\u3059\u308b<\/h3>\n<p>\u6b21\u306b\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u63cf\u753b\u3059\u308b drawField() \u30e1\u30bd\u30c3\u30c9\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n    private void drawField() {\r\n        Container pane = getContentPane();\r\n        pane.removeAll();\r\n        for (int y = 0; y &lt; FIELD_HEIGHT; y++) {\r\n           for (int x = 0; x &lt; FIELD_WIDTH; x++) {\r\n               if (x == heroX &amp;&amp; y == heroY) {\r\n                   add(pane, new HeroLabel(), x, y, 1, 1);\r\n               } else {\r\n                   add(pane, new FieldLabel(), x, y, 1, 1);\r\n               }\r\n           }\r\n        }\r\n        pane.revalidate();\r\n        pane.repaint();\r\n    }\r\n<\/pre>\n<p>\u753b\u9762\u4e0a\u306bHeroLabel\u3084FieldLabel\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306eadd()\u30e1\u30bd\u30c3\u30c9\u3092\u7528\u610f\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n    private static void add(\r\n        Container pane,\r\n        Component component,\r\n        int x,\r\n        int y,\r\n        int width,\r\n        int height) {\r\n            GridBagConstraints constraints = new GridBagConstraints();\r\n            constraints.fill = GridBagConstraints.BOTH;\r\n            constraints.gridx = x;\r\n            constraints.gridy = y;\r\n            constraints.gridwidth = width;\r\n            constraints.gridheight = height;\r\n            pane.add(component, constraints);\r\n        }\r\n    }\r\n<\/pre>\n<p>\u307e\u305a\u3001\u753b\u9762\u4e0a\u306b\u3042\u308b\u90e8\u54c1\u3092\u3059\u3079\u3066\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\ngetContentPane().removeAll();\r\n<\/pre>\n<p>\u305d\u306e\u3042\u3068\u3001\u4e8c\u91cd\u306e for \u6587\u3067\u30d5\u30a3\u30fc\u30eb\u30c9\u5168\u4f53\u3092\u63cf\u753b\u3057\u307e\u3059\u3002<\/p>\n<p>x \u3068 y \u306f\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u4e0a\u306e\u5ea7\u6a19\u3067\u3059\u3002<\/p>\n<p>GridBagConstraints \u3092\u4f7f\u3063\u3066\u3001\u90e8\u54c1\u3092\u914d\u7f6e\u3059\u308b\u4f4d\u7f6e\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3082\u3057\u73fe\u5728\u306e\u5ea7\u6a19\u304c\u52c7\u8005\u306e\u4f4d\u7f6e\u306a\u3089\u3001HeroLabel \u3092\u8868\u793a\u3057\u3001\u305d\u308c\u4ee5\u5916\u306e\u5834\u6240\u3067\u306f FieldLabel \u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n               if (x == rpg.getHeroX() &amp;&amp; y == rpg.getHeroY()) {\r\n                   add(pane, new HeroLabel(), x, y, 1, 1);\r\n               } else {\r\n                   add(pane, new FieldLabel(), x, y, 1, 1);\r\n               }\r\n<\/pre>\n<p>\u3053\u3053\u3067\u91cd\u8981\u306a\u306e\u306f\u3001RpgFrame \u304c\u52c7\u8005\u306e\u4f4d\u7f6e\u3092\u81ea\u5206\u3067\u6301\u3063\u3066\u3044\u306a\u3044\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u52c7\u8005\u306e\u4f4d\u7f6e\u306f\u3001Rpg \u304b\u3089\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nrpg.getHeroX()\r\nrpg.getHeroY()\r\n<\/pre>\n<p>\u3064\u307e\u308a\u3001RpgFrame \u306f Rpg \u306e\u72b6\u614b\u3092\u898b\u3066\u3001\u305d\u306e\u72b6\u614b\u3092\u753b\u9762\u306b\u8868\u793a\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>\u6700\u5f8c\u306b\u3001\u753b\u9762\u3092\u66f4\u65b0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nrevalidate();\r\nrepaint();\r\n<\/pre>\n<p>revalidate() \u306f\u3001\u90e8\u54c1\u306e\u914d\u7f6e\u3092\u3084\u308a\u76f4\u3059\u305f\u3081\u306e\u51e6\u7406\u3067\u3059\u3002<\/p>\n<p>repaint() \u306f\u3001\u753b\u9762\u3092\u518d\u63cf\u753b\u3059\u308b\u305f\u3081\u306e\u51e6\u7406\u3067\u3059\u3002<\/p>\n<h3>\u30ad\u30fc\u5165\u529b\u3067\u52c7\u8005\u3092\u52d5\u304b\u3059<\/h3>\n<p>\u6b21\u306b\u3001\u4e0a\u4e0b\u5de6\u53f3\u306e\u77e2\u5370\u30ad\u30fc\u3067\u52c7\u8005\u3092\u52d5\u304b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n@Override\r\npublic void keyPressed(KeyEvent e) {\r\n    if (e.getKeyCode() == KeyEvent.VK_LEFT) {\r\n        rpg.moveLeft();\r\n    }\r\n\r\n    if (e.getKeyCode() == KeyEvent.VK_RIGHT) {\r\n        rpg.moveRight();\r\n    }\r\n\r\n    if (e.getKeyCode() == KeyEvent.VK_UP) {\r\n        rpg.moveUp();\r\n    }\r\n\r\n    if (e.getKeyCode() == KeyEvent.VK_DOWN) {\r\n        rpg.moveDown();\r\n    }\r\n\r\n    drawField();\r\n}\r\n<\/pre>\n<p>\u5404\u30ad\u30fc\u304c\u62bc\u3055\u308c\u305f\u3089\u3001Rpg \u306b\u79fb\u52d5\u306e\u60c5\u5831\u3092\u4f1d\u3048\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u3082\u3001RpgFrame \u304c\u76f4\u63a5 heroX \u3084 heroY \u3092\u5909\u66f4\u3057\u3066\u3044\u306a\u3044\u3053\u3068\u306b\u6ce8\u76ee\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>RpgFrame \u306f\u3001\u30ad\u30fc\u5165\u529b\u3092\u53d7\u3051\u53d6\u3063\u3066\u3001Rpg \u306b\u300c\u5de6\u3078\u52d5\u3044\u3066\u300d\u300c\u53f3\u3078\u52d5\u3044\u3066\u300d\u3068\u4f1d\u3048\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306b\u52c7\u8005\u306e\u4f4d\u7f6e\u3092\u5909\u3048\u308b\u306e\u306f Rpg \u3067\u3059\u3002<\/p>\n<p>\u305d\u306e\u3042\u3068\u3001drawField() \u3092\u547c\u3073\u51fa\u3057\u3066\u3001\u753b\u9762\u3092\u63cf\u304d\u76f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\ndrawField();\r\n<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u3059\u308b\u3068\u3001\u51e6\u7406\u306e\u5f79\u5272\u304c\u5206\u304b\u308a\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u52c7\u8005\u306e\u4f4d\u7f6e\u3092\u7ba1\u7406\u3059\u308b\u306e\u306f Rpg<\/li>\n<li>\u30ad\u30fc\u5165\u529b\u3092\u53d7\u3051\u53d6\u308b\u306e\u306f RpgFrame<\/li>\n<li>\u753b\u9762\u3092\u63cf\u304d\u76f4\u3059\u306e\u3082 RpgFrame<\/li>\n<\/ul>\n<p>\u3068\u3044\u3046\u5206\u62c5\u3067\u3059\u3002<\/p>\n<h3>KeyListener\u306e\u6b8b\u308a\u306e\u30e1\u30bd\u30c3\u30c9<\/h3>\n<p>KeyListener \u3092\u4f7f\u3046\u5834\u5408\u306f\u3001keyPressed() \u4ee5\u5916\u306e\u30e1\u30bd\u30c3\u30c9\u3082\u66f8\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>KeyListener \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3067\u7528\u610f\u3057\u3066\u3044\u308b\u30e1\u30bd\u30c3\u30c9\u306f\u3001implements\u3057\u305f\u30af\u30e9\u30b9\u3067\u306f\u3001\u3059\u3079\u3066\u3092\u7528\u610f\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3068\u3044\u3046 Java \u306e\u304a\u7d04\u675f\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u4f7f\u308f\u306a\u3044\u306e\u3067\u3001\u4e2d\u8eab\u306f\u7a7a\u306b\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n@Override\r\npublic void keyReleased(KeyEvent e) {\r\n}\r\n\r\n@Override\r\npublic void keyTyped(KeyEvent e) {\r\n}\r\n<\/pre>\n<h3>RpgFrame\u306e\u5168\u4f53\u30b3\u30fc\u30c9<\/h3>\n<p>\u3053\u3053\u307e\u3067\u3092\u307e\u3068\u3081\u308b\u3068\u3001RpgFrame \u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nimport java.awt.GridBagConstraints;\r\nimport java.awt.GridBagLayout;\r\nimport java.awt.event.KeyEvent;\r\nimport java.awt.event.KeyListener;\r\n\r\nimport javax.swing.JFrame;\r\n\r\npublic class RpgFrame extends JFrame implements KeyListener {\r\n    private Rpg rpg;\r\n\r\n    public RpgFrame(Rpg rpg) {\r\n        super(&quot;RPG&quot;);\r\n\r\n        this.rpg = rpg;\r\n\r\n        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n        setLayout(new GridBagLayout());\r\n\r\n        drawField();\r\n\r\n        addKeyListener(this);\r\n        setFocusable(true);\r\n\r\n        pack();\r\n        setLocationRelativeTo(null);\r\n    }\r\n\r\n    private void drawField() {\r\n        getContentPane().removeAll();\r\n\r\n        for (int y = 0; y &lt; Rpg.FIELD_HEIGHT; y++) {\r\n            for (int x = 0; x &lt; Rpg.FIELD_WIDTH; x++) {\r\n                if (x == rpg.getHeroX() &amp;&amp; y == rpg.getHeroY()) {\r\n                    add(pane, new HeroLabel(), x, y, 1, 1);\r\n                } else {\r\n                    add(pane, new FieldLabel(), x, y, 1, 1);\r\n                }\r\n            }\r\n        }\r\n\r\n        revalidate();\r\n        repaint();\r\n    }\r\n\r\n    @Override\r\n    public void keyPressed(KeyEvent e) {\r\n        if (e.getKeyCode() == KeyEvent.VK_LEFT) {\r\n            rpg.moveLeft();\r\n        }\r\n\r\n        if (e.getKeyCode() == KeyEvent.VK_RIGHT) {\r\n            rpg.moveRight();\r\n        }\r\n\r\n        if (e.getKeyCode() == KeyEvent.VK_UP) {\r\n            rpg.moveUp();\r\n        }\r\n\r\n        if (e.getKeyCode() == KeyEvent.VK_DOWN) {\r\n            rpg.moveDown();\r\n        }\r\n\r\n        drawField();\r\n    }\r\n\r\n    @Override\r\n    public void keyReleased(KeyEvent e) {\r\n    }\r\n\r\n    @Override\r\n    public void keyTyped(KeyEvent e) {\r\n    }\r\n\r\n    private static void add(\r\n        Container pane,\r\n        Component component,\r\n        int x,\r\n        int y,\r\n        int width,\r\n        int height) {\r\n            GridBagConstraints constraints = new GridBagConstraints();\r\n            constraints.fill = GridBagConstraints.BOTH;\r\n            constraints.gridx = x;\r\n            constraints.gridy = y;\r\n            constraints.gridwidth = width;\r\n            constraints.gridheight = height;\r\n            pane.add(component, constraints);\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<p>\u3053\u306e RpgFrame \u306f\u3001\u52c7\u8005\u306e\u4f4d\u7f6e\u3092\u81ea\u5206\u3067\u306f\u7ba1\u7406\u3057\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>\u52c7\u8005\u306e\u4f4d\u7f6e\u306f Rpg \u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>RpgFrame \u306f\u3001Rpg \u306e\u72b6\u614b\u3092\u898b\u3066\u753b\u9762\u3092\u63cf\u304d\u3001\u30ad\u30fc\u5165\u529b\u304c\u3042\u308c\u3070 Rpg \u306b\u547d\u4ee4\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u8d77\u52d5\u3059\u308b<\/h3>\n<p>\u6700\u5f8c\u306b\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u8d77\u52d5\u3059\u308b\u30af\u30e9\u30b9\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nimport javax.swing.SwingUtilities;\r\n\r\npublic class GuiApp {\r\n    public static void main(String&#x5B;] args) {\r\n        SwingUtilities.invokeLater(() -&gt; {\r\n            Rpg rpg = new Rpg();\r\n            RpgFrame frame = new RpgFrame(rpg);\r\n            frame.setVisible(true);\r\n        });\r\n    }\r\n}\r\n<\/pre>\n<p>\u307e\u305a\u3001Rpg \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nRpg rpg = new Rpg();\r\n<\/pre>\n<p>\u6b21\u306b\u3001\u305d\u306e Rpg \u3092 RpgFrame \u306b\u6e21\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nRpgFrame frame = new RpgFrame(rpg);\r\n<\/pre>\n<p>\u3053\u308c\u3067\u3001RpgFrame \u306f Rpg \u306e\u72b6\u614b\u3092\u53c2\u7167\u3057\u306a\u304c\u3089\u753b\u9762\u306b\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>RpgFrame \u306e\u4e2d\u3067 new Rpg() \u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u5916\u3067\u4f5c\u3063\u305f Rpg \u3092\u6e21\u3057\u3066\u3044\u308b\u3068\u3053\u308d\u304c\u30dd\u30a4\u30f3\u30c8\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u3057\u3066\u304a\u304f\u3068\u3001\u3042\u3068\u304b\u3089\u6226\u95d8\u753b\u9762\u3092\u4f5c\u308b\u3068\u304d\u306b\u3082\u3001\u540c\u3058 Rpg \u3092\u6e21\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nBattleFrame battleFrame = new BattleFrame(rpg);\r\n<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u3059\u308c\u3070\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u753b\u9762\u3068\u6226\u95d8\u753b\u9762\u304c\u3001\u540c\u3058\u30b2\u30fc\u30e0\u306e\u72b6\u614b\u3092\u6271\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>## \u4eca\u56de\u306e\u30af\u30e9\u30b9\u306e\u95a2\u4fc2<\/p>\n<p>\u4eca\u56de\u306e\u30af\u30e9\u30b9\u306e\u95a2\u4fc2\u3092\u7c21\u5358\u306b\u8868\u3059\u3068\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>\r\n+---------+\r\n| GuiApp  |\r\n+---------+\r\n     |\r\n     | \u4f5c\u308b\r\n     v\r\n+-------------+\r\n|  Rpg        |  \u2190 Model\r\n+-------------+\r\n| hero        |\r\n| heroX       |\r\n| heroY       |\r\n+-------------+\r\n| moveLeft()  |\r\n| moveRight() |\r\n| moveUp()    |\r\n| moveDown()  |\r\n+-------------+\r\n     ^\r\n     | \u72b6\u614b\u3092\u898b\u308b\r\n     | \u64cd\u4f5c\u3059\u308b\r\n     |\r\n+------------------+\r\n|    RpgFrame      |  \u2190 View + \u5165\u529b\u53d7\u4ed8\r\n+------------------+\r\n| rpg              |\r\n+------------------+\r\n| drawField()      |\r\n| keyPressed()     |\r\n+------------------+\r\n<\/pre>\n<p>Rpg \u306f\u30b2\u30fc\u30e0\u306e\u72b6\u614b\u3092\u6301\u3061\u307e\u3059\u3002<\/p>\n<p>RpgFrame \u306f\u3001\u305d\u306e\u72b6\u614b\u3092\u898b\u3066\u753b\u9762\u3092\u63cf\u304d\u307e\u3059\u3002<\/p>\n<p>\u30ad\u30fc\u304c\u62bc\u3055\u308c\u305f\u3089\u3001RpgFrame \u306f Rpg \u306b\u300c\u52c7\u8005\u3092\u52d5\u304b\u3057\u3066\u300d\u3068\u4f1d\u3048\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u5206\u3051\u3066\u304a\u304f\u3068\u3001\u3042\u3068\u304b\u3089\u6575\u3084\u6226\u95d8\u3092\u8ffd\u52a0\u3059\u308b\u3068\u304d\u3082\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u6574\u7406\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>Model\u3068View\u3092\u5206\u3051\u308b\u30e1\u30ea\u30c3\u30c8<\/h3>\n<p>\u4eca\u56de\u306e\u3088\u3046\u306a\u5c0f\u3055\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u306a\u3089\u3001RpgFrame \u306b\u5168\u90e8\u66f8\u3044\u3066\u3082\u52d5\u304d\u307e\u3059\u3002<\/p>\n<p>RpgFrame \u306b heroX \u3084 heroY \u3092\u6301\u305f\u305b\u3066\u3001\u30ad\u30fc\u5165\u529b\u3067\u76f4\u63a5\u5024\u3092\u5909\u66f4\u3057\u3066\u3082\u3001\u52c7\u8005\u3092\u52d5\u304b\u3059\u3053\u3068\u306f\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3067\u3082\u3001\u305d\u308c\u3092\u7d9a\u3051\u308b\u3068\u3001\u3042\u3068\u304b\u3089\u56f0\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u6575\u3068\u306e\u906d\u9047\u3092\u8ffd\u52a0\u3057\u305f\u3044\u3002<\/li>\n<li>\u6226\u95d8\u753b\u9762\u3092\u8ffd\u52a0\u3057\u305f\u3044\u3002<\/li>\n<li>HP\u3092\u8868\u793a\u3057\u305f\u3044\u3002<\/li>\n<li>\u30a2\u30a4\u30c6\u30e0\u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u305f\u3044\u3002<\/li>\n<li>\u30b2\u30fc\u30e0\u30aa\u30fc\u30d0\u30fc\u3092\u5224\u5b9a\u3057\u305f\u3044\u3002<\/li>\n<\/ul>\n<p>\u3053\u306e\u3088\u3046\u306a\u51e6\u7406\u3092\u3059\u3079\u3066 RpgFrame \u306b\u66f8\u3044\u3066\u3044\u304f\u3068\u3001RpgFrame \u304c\u753b\u9762\u8868\u793a\u306e\u30af\u30e9\u30b9\u306a\u306e\u304b\u3001\u30b2\u30fc\u30e0\u672c\u4f53\u306a\u306e\u304b\u5206\u304b\u3089\u306a\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u3001\u30b2\u30fc\u30e0\u306e\u72b6\u614b\u3084\u30eb\u30fc\u30eb\u306f Rpg \u306b\u7f6e\u304d\u307e\u3059\u3002<\/p>\n<p>\u753b\u9762\u8868\u793a\u306f RpgFrame \u306b\u4efb\u305b\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u5206\u3051\u65b9\u3092\u3057\u3066\u304a\u304f\u3068\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u5c11\u3057\u5927\u304d\u304f\u306a\u3063\u3066\u3082\u3001\u3069\u3053\u306b\u4f55\u3092\u66f8\u304f\u3079\u304d\u304b\u5206\u304b\u308a\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>\u307e\u3068\u3081<\/h3>\n<p>\u4eca\u56de\u306f\u3001Java\u306eSwing\u3092\u4f7f\u3063\u3066\u3001\u52c7\u8005\u3092\u30d5\u30a3\u30fc\u30eb\u30c9\u4e0a\u3067\u52d5\u304b\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u305f\u3060\u753b\u9762\u306b\u52c7\u8005\u3092\u8868\u793a\u3059\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u30b2\u30fc\u30e0\u306e\u72b6\u614b\u3092\u7ba1\u7406\u3059\u308b Rpg \u30af\u30e9\u30b9\u3068\u3001\u753b\u9762\u3092\u8868\u793a\u3059\u308b RpgFrame \u30af\u30e9\u30b9\u3092\u5206\u3051\u3066\u4f5c\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>Rpg \u306f\u3001\u52c7\u8005\u306e\u4f4d\u7f6e\u3092\u7ba1\u7406\u3057\u307e\u3059\u3002<\/p>\n<p>RpgFrame \u306f\u3001Rpg \u306e\u72b6\u614b\u3092\u898b\u3066\u753b\u9762\u3092\u63cf\u753b\u3057\u307e\u3059\u3002<\/p>\n<p>\u77e2\u5370\u30ad\u30fc\u304c\u62bc\u3055\u308c\u305f\u3089\u3001RpgFrame \u306f Rpg \u306b\u52c7\u8005\u3092\u52d5\u304b\u3059\u3088\u3046\u306b\u4f1d\u3048\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u5909\u66f4\u3055\u308c\u305f Rpg \u306e\u72b6\u614b\u3092\u3082\u3068\u306b\u3001\u753b\u9762\u3092\u63cf\u304d\u76f4\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001Model\u3068View\u3092\u5206\u3051\u3066\u304a\u304f\u3068\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u5927\u304d\u304f\u306a\u3063\u3066\u3082\u6574\u7406\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u6700\u521d\u304b\u3089\u5b8c\u74a7\u306aMVC\u3092\u4f5c\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u30b2\u30fc\u30e0\u306e\u72b6\u614b\u3068\u753b\u9762\u8868\u793a\u3092\u5206\u3051\u3066\u8003\u3048\u308b\u3053\u3068\u306f\u3001\u57fa\u790e\u306e\u6bb5\u968e\u3067\u3082\u3068\u3066\u3082\u5927\u5207\u3067\u3059\u3002<\/p>\n<p>\u6b21\u56de\u306f\u3001\u52c7\u8005\u304c\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u6b69\u3044\u3066\u3044\u308b\u3068\u3001\u4e00\u5b9a\u306e\u78ba\u7387\u3067\u6575\u3068\u906d\u9047\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u6575\u3068\u906d\u9047\u3057\u305f\u3089\u3001\u6226\u95d8\u753b\u9762\u3092\u8868\u793a\u3059\u308b\u3068\u3053\u308d\u307e\u3067\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u307e\u3067\u306e\u8a18\u4e8b\u3067\u306f\u3001\u52c7\u8005\u3084\u30b9\u30e9\u30a4\u30e0\u306a\u3069\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3092\u30af\u30e9\u30b9\u3068\u3057\u3066\u4f5c\u3063\u3066\u304d\u307e\u3057\u305f\u3002 \u4eca\u56de\u306f\u3001\u5c11\u3057RPG\u3089\u3057\u304f\u3059\u308b\u305f\u3081\u306b\u3001\u52c7\u8005\u3092\u30d5\u30a3\u30fc\u30eb\u30c9\u4e0a\u3067\u52d5\u304b\u3057\u3066\u307f\u307e\u3059\u3002 \u6587\u5b57\u3060\u3051\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3082\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u306e &#8230; <\/p>\n","protected":false},"author":1,"featured_media":542,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[71,194,175],"tags":[198,75,197,11,182,177],"class_list":["post-538","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","category-uml","category-175","tag-gui","tag-java","tag-swing","tag-uml","tag-182","tag-177"],"nelio_content":{"autoShareEndMode":"never","automationSources":{"useCustomSentences":false,"customSentences":[]},"efiAlt":"","efiUrl":"","followers":[1],"highlights":[],"isAutoShareEnabled":true,"networkImageIds":[],"permalinkQueryArgs":[],"series":[],"suggestedReferences":[]},"views":107,"_links":{"self":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/538","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=538"}],"version-history":[{"count":9,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/538\/revisions"}],"predecessor-version":[{"id":555,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/538\/revisions\/555"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/media\/542"}],"wp:attachment":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}