{"id":19466,"date":"2018-03-04T07:00:21","date_gmt":"2018-03-03T22:00:21","guid":{"rendered":"https:\/\/www.sssg.org\/blogs\/hiro345\/?p=19466"},"modified":"2018-03-02T18:18:09","modified_gmt":"2018-03-02T09:18:09","slug":"pygame%e3%81%aeexamples%e3%82%b2%e3%83%bc%e3%83%a0%e3%82%92%e3%83%a9%e3%82%ba%e3%83%91%e3%82%a4%e3%81%a7%e5%8b%95%e3%81%8b%e3%81%9d%e3%81%86%ef%bc%81","status":"publish","type":"post","link":"https:\/\/www.hiro345.net\/blogs\/hiro345\/archives\/19466.html","title":{"rendered":"Pygame\u306eexamples\u30b2\u30fc\u30e0\u3092\u30e9\u30ba\u30d1\u30a4\u3067\u52d5\u304b\u305d\u3046\uff01"},"content":{"rendered":"<p>\u300c<a href=\"https:\/\/www.hiro345.net\/blogs\/hiro345\/archives\/19416.html\">Python\u3067\u30b2\u30fc\u30e0\u30a2\u30d7\u30ea\u3092\u4f5c\u308a\u305f\u3044\u306a\u3089\u65e5\u7d4c\u30bd\u30d5\u30c8\u30a6\u30a8\u30a2 2018\u5e743\u6708\u53f7\u3092\u8aad\u3082\u3046\uff01 | hiro345<\/a>\u300d\u3067\u7d39\u4ecb\u3057\u307e\u3057\u305f\u304c\u3001\u3088\u3046\u3084\u304f\u3001<a type=\"amzn\" asin=\"B077VB1RWV\">\u65e5\u7d4c\u30bd\u30d5\u30c8\u30a6\u30a8\u30a2 2018\u5e743\u6708\u53f7<\/a>\u306ePython\u30b2\u30fc\u30e0\u30a2\u30d7\u30ea\u3092\u52d5\u304b\u3057\u3066\u307f\u307e\u3057\u305f\u3002\u30e9\u30ba\u30d1\u30a4\u3067\u304d\u3061\u3093\u3068\u52d5\u3044\u3066\u3001\u306a\u304b\u306a\u304b\u826f\u3044\u611f\u3058\u3067\u3059\u3002<br \/>\n<!--more--><br \/>\n<iframe loading=\"lazy\" style=\"width: 120px; height: 240px;\" src=\"\/\/rcm-jp.amazon.co.jp\/e\/cm?t=hiro345-22&amp;o=9&amp;p=8&amp;l=as1&amp;asins=B077VB1RWV&amp;ref=tf_til&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr\" height=\"240\" width=\"320\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>\u30dd\u30fc\u30ab\u30fc\u306e\u30b2\u30fc\u30e0(pocker.py)\u306fIPA\u306e\u30d5\u30a9\u30f3\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u4f7f\u3046\u3088\u3046\u306b\u66f8\u3044\u3066\u3042\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u6a19\u6e96\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308bDroidSansFallbackFull.ttf\u3092\u4f7f\u3048\u3070\u3044\u3044\u304b\u306a\u3001\u3068\u601d\u3063\u3066\u4e0b\u8a18\u306e\u3088\u3046\u306b\u4fee\u6b63\u3057\u3066\u52d5\u304b\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: bash; gutter: true\">\r\n#jfont = pygame.font.Font(&quot;ipag.ttc&quot;, 24)\r\njfont = pygame.font.Font(&quot;\/usr\/share\/fonts\/truetype\/droid\/DroidSansFallbackFull.ttf&quot;, 24)\r\n<\/pre>\n<p>\u57fa\u672c\u7684\u306b\u30b2\u30fc\u30e0\u5c02\u7528\u6a5f\u3067\u3057\u304b\u30b2\u30fc\u30e0\u3092\u904a\u3093\u3067\u3044\u306a\u3044\u306e\u3067\u3001\u30dd\u30fc\u30ab\u30fc\u3067\u30ab\u30fc\u30c9\u306e\u9078\u629e\u3084OK\u306e\u6c7a\u5b9a\u306b\u300cEnter\u300d\u30ad\u30fc\u3092\u4f7f\u3046\u3053\u3068\u306b\u3001\u306a\u304b\u306a\u304b\u6c17\u304c\u3064\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u305d\u3046\u3044\u3046\u3082\u306e\u306a\u3093\u3067\u3059\u306d\u3002<\/p>\n<p>\u4e00\u901a\u308a\u5b9f\u884c\u3057\u3066\u304b\u3089\u8a18\u4e8b\u3092\u8aad\u3082\u3046\u3068\u601d\u3063\u305f\u3089\u3001Pygame\u306f\u30a8\u30a4\u30ea\u30a2\u30f3\u30b2\u30fc\u30e0\u306a\u3069\u306e\u30b5\u30f3\u30d7\u30eb\u304c\u540c\u68b1\u3055\u308c\u3066\u3044\u308b\u6a21\u69d8\u3002\u30e9\u30ba\u30d1\u30a4\u3067\u3082\u65e9\u901f\u8a66\u3057\u3066\u307f\u3088\u3046\u3068\u601d\u3063\u305f\u3089\u3001\u898b\u5f53\u305f\u308a\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"brush: bash; gutter: true\">\r\n$ python3 -m pygame.examples.aliens\r\n\/usr\/bin\/python3: Error while finding module specification for &#039;pygame.examples.aliens&#039; (ImportError: No module named &#039;pygame.examples&#039;)\r\n<\/pre>\n<p>Pygame\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u53e4\u3044\u306e\u304b\u3001\u7701\u7565\u3055\u308c\u3066\u3044\u308b\u306e\u304b\u308f\u304b\u308a\u307e\u305b\u3093\u304c\u3001\u3053\u3046\u3044\u3046\u3068\u304d\u306f\u4eee\u60f3\u74b0\u5883\u3092\u4f7f\u3063\u3066\u7528\u610f\u3059\u308b\u306e\u304c\u3044\u3044\u3067\u3059\u306d\u3002<\/p>\n<p>\u6b21\u306e\u4f8b\u3067\u306fanenv\u3068\u3044\u3046\u4eee\u60f3\u74b0\u5883\u3092\u7528\u610f\u3057\u3066\u3001activate\u3067\u6709\u52b9\u5316\u3057\u3066\u304b\u3089\u3001pip\u30b3\u30de\u30f3\u30c9\u3067pygame\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304b\u3089\u3001pygame.examples.aliens\u30b2\u30fc\u30e0\u3092\u5b9f\u884c\u3057\u3066\u3044\u307e\u3059\u3002deactivate\u30b3\u30de\u30f3\u30c9\u306f\u4eee\u60f3\u74b0\u5883\u3092\u7d42\u4e86\u3059\u308b\u305f\u3081\u306e\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n<pre class=\"brush: bash; gutter: true\">\r\n$ python3 -m venv anenv\r\n$ . .\/anenv\/bin\/activate\r\n(anenv) pi@raspberrypi:~ $ pip install pygame\r\n(anenv) pi@raspberrypi:~ $ python -m pygame.examples.aliens\r\n(anenv) pi@raspberrypi:~ $ deactivate \r\n<\/pre>\n<p>pygame.examples.aliens\u30b2\u30fc\u30e0\u306e\u30b3\u30fc\u30c9\u306f anenv\/lib\/python3.5\/site-packages\/pygame\/examples\/aliens.py \u306b\u3042\u308a\u3001\u30c7\u30fc\u30bf\u306f anenv\/lib\/python3.5\/site-packages\/pygame\/examples\/data\/ \u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3061\u3087\u3063\u3068\u3057\u305f\u30b2\u30fc\u30e0\u3092\u4f5c\u6210\u3057\u3066\u307f\u305f\u3044\u4eba\u306e\u305f\u3081\u306b\u3001\u3053\u3046\u3044\u3063\u305f\u7d20\u6750\u3082\u542b\u3081\u3066\u914d\u5e03\u3055\u308c\u3066\u3044\u308b\u3068\u3044\u3046\u306e\u306f\u3042\u308a\u304c\u305f\u3044\u3053\u3068\u3067\u3059\u306d\u3002<\/p>\n<p>\u3042\u3001\u305d\u3046\u305d\u3046\u3001\u30e9\u30ba\u30d1\u30a4\u3060\u3068 \/home\/pi\/python_games\/ \u306b Pygame\u3092\u4f7f\u3063\u305f\u30b2\u30fc\u30e0\u306e\u30b5\u30f3\u30d7\u30eb\u304c\u3044\u304f\u3064\u304b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u3066\u3001\u305d\u3061\u3089\u3082\u53c2\u8003\u306b\u306a\u308a\u307e\u3059\u306d\u3002<\/p>\n<p>Scratch\u306b\u542b\u307e\u308c\u308b\u753b\u50cf\u30c7\u30fc\u30bf\u3084\u97f3\u697d\u30c7\u30fc\u30bf\u3082\u542b\u3081\u3066\u8003\u3048\u308b\u3068\u3001\u30e9\u30ba\u30d1\u30a4\u306f\u30b2\u30fc\u30e0\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5165\u9580\u6a5f\u3068\u3057\u3066\u3082\u5341\u5206\u306a\u6a5f\u80fd\u3092\u6301\u3063\u3066\u3044\u3066\u3001\u3044\u3044\u30de\u30b7\u30f3\u3060\u3068\u8003\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u300cPython\u3067\u30b2\u30fc\u30e0\u30a2\u30d7\u30ea\u3092\u4f5c\u308a\u305f\u3044\u306a\u3089\u65e5\u7d4c\u30bd\u30d5\u30c8\u30a6\u30a8\u30a2 2018\u5e743\u6708\u53f7\u3092\u8aad\u3082\u3046\uff01 | hiro345\u300d\u3067\u7d39\u4ecb\u3057\u307e\u3057\u305f\u304c\u3001\u3088\u3046\u3084\u304f\u3001\u65e5\u7d4c\u30bd\u30d5\u30c8\u30a6\u30a8\u30a2 2018\u5e743\u6708\u53f7\u306ePython\u30b2\u30fc\u30e0\u30a2\u30d7\u30ea\u3092\u52d5\u304b\u3057\u3066\u307f\u307e\u3057\u305f\u3002\u30e9\u30ba &hellip; <a href=\"https:\/\/www.hiro345.net\/blogs\/hiro345\/archives\/19466.html\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[1295,994,1227],"class_list":["post-19466","post","type-post","status-publish","format-standard","hentry","category-linux","tag-pygame","tag-raspberry-pi","tag-1227"],"_links":{"self":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts\/19466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/comments?post=19466"}],"version-history":[{"count":4,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts\/19466\/revisions"}],"predecessor-version":[{"id":19470,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts\/19466\/revisions\/19470"}],"wp:attachment":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/media?parent=19466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/categories?post=19466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/tags?post=19466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}