{"id":499,"date":"2024-04-26T23:55:11","date_gmt":"2024-04-26T14:55:11","guid":{"rendered":"https:\/\/chocottopro.com\/?p=499"},"modified":"2024-04-26T23:55:11","modified_gmt":"2024-04-26T14:55:11","slug":"%e3%80%90python%e5%88%9d%e5%bf%83%e8%80%85%e5%bf%85%e8%a6%8b%e3%80%91%e3%81%9f%e3%81%a3%e3%81%9f7%e3%82%b9%e3%83%86%e3%83%83%e3%83%97%e3%81%a7%e3%83%9e%e3%82%b9%e3%82%bf%e3%83%bc%e3%81%99%e3%82%8bpygl","status":"publish","type":"post","link":"https:\/\/chocottopro.com\/?p=499","title":{"rendered":"\u3010Python\u521d\u5fc3\u8005\u5fc5\u898b\u3011\u305f\u3063\u305f7\u30b9\u30c6\u30c3\u30d7\u3067\u30de\u30b9\u30bf\u30fc\u3059\u308bpyglet\u306b\u3088\u308b2D\u30b2\u30fc\u30e0\u958b\u767a\u5165\u9580"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Python\u3067\u30b2\u30fc\u30e0\u958b\u767a\u3092\u59cb\u3081\u308b\u306a\u3089\u3001pyglet\u304c\u304a\u3059\u3059\u3081\uff01\u30b7\u30f3\u30d7\u30eb\u306aAPI\u3068\u9ad8\u901f\u306a\u63cf\u753b\u6a5f\u80fd\u3092\u5099\u3048\u305f\u3053\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3048\u3070\u3001\u521d\u5fc3\u8005\u3067\u3082\u7c21\u5358\u306b2D\u30b2\u30fc\u30e0\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001pyglet\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u304b\u3089\u5fdc\u7528\u7684\u306a\u30c6\u30af\u30cb\u30c3\u30af\u307e\u3067\u3092\u4e01\u5be7\u306b\u89e3\u8aac\u3002\u5b9f\u969b\u306e\u30b3\u30fc\u30c9\u4f8b\u3092\u4ea4\u3048\u306a\u304c\u3089\u3001\u30b2\u30fc\u30e0\u958b\u767a\u306e\u6d41\u308c\u3092\u4e00\u901a\u308a\u5b66\u3093\u3067\u3044\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n\n\n\n<div class=\"wp-block-sgb-block-simple sgb-box-simple sgb-box-simple--title-normal sgb-box-simple--with-border\"><div style=\"background-color:var(--wp--preset--color--sango-main);color:#FFF\" class=\"sgb-box-simple__title\">\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3093\u3060\u3089\u308f\u304b\u308b\u3053\u3068<\/div><div class=\"sgb-box-simple__body\" style=\"border-color:var(--wp--preset--color--sango-main);background-color:#FFF\">\n<ul class=\"wp-block-list\">\n<li>pyglet\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u3068\u958b\u767a\u74b0\u5883\u306e\u8a2d\u5b9a <\/li>\n\n\n\n<li>\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u8868\u793a\u3068\u56f3\u5f62\u306e\u63cf\u753b\u65b9\u6cd5 <\/li>\n\n\n\n<li>\u30ad\u30fc\u30dc\u30fc\u30c9\u3068\u30de\u30a6\u30b9\u5165\u529b\u306e\u51e6\u7406\u65b9\u6cd5 <\/li>\n\n\n\n<li>\u30b9\u30d7\u30e9\u30a4\u30c8\u306e\u4f7f\u3044\u65b9\u3068\u885d\u7a81\u5224\u5b9a\u306e\u5b9f\u88c5 <\/li>\n\n\n\n<li>\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u4f5c\u6210\u65b9\u6cd5 <\/li>\n\n\n\n<li>\u97f3\u58f0\u306e\u518d\u751f\u3068\u52b9\u679c\u97f3\u306e\u8ffd\u52a0\u65b9\u6cd5 <\/li>\n\n\n\n<li>OpenGL\u3092\u4f7f\u3063\u305f\u9ad8\u5ea6\u306a\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u30b9\u51e6\u7406 <\/li>\n\n\n\n<li>pyglet\u3092\u4f7f\u3063\u305f2D\u30b2\u30fc\u30e0\u306e\u958b\u767a\u4e8b\u4f8b <\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<div class=\"toc\"><br \/>\n<b>Warning<\/b>:  Undefined array key \"is_admin\" in <b>\/home\/c7479301\/public_html\/chocottopro.com\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>116<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_category_top\" in <b>\/home\/c7479301\/public_html\/chocottopro.com\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>121<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_top\" in <b>\/home\/c7479301\/public_html\/chocottopro.com\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>128<\/b><br \/>\n    <div id=\"toc_container\" class=\"sgb-toc--bullets js-smooth-scroll\" data-dialog-title=\"Table of Contents\">\n      <p class=\"toc_title\">\u76ee\u6b21 <\/p>\n      <ul class=\"toc_list\">  <li class=\"first\">    <a href=\"#i-0\">pyglet\u3068\u306f\uff1f2D\u30b2\u30fc\u30e0\u958b\u767a\u306b\u6700\u9069\u306aPython\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5fb9\u5e95\u89e3\u8aac<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-1\">pyglet\u306e\u6982\u8981\u3068\u7279\u5fb4<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-2\">pyglet\u3092\u4f7f\u3046\u30e1\u30ea\u30c3\u30c8 \u2013 \u30b7\u30f3\u30d7\u30eb\u3055\u3001\u8efd\u91cf\u6027\u3001\u30af\u30ed\u30b9\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u5bfe\u5fdc<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-3\">pyglet\u3092\u4f7f\u3063\u305f2D\u30b2\u30fc\u30e0\u958b\u767a\u5165\u9580 \u2013 7\u30b9\u30c6\u30c3\u30d7\u3067\u30de\u30b9\u30bf\u30fc\u3057\u3088\u3046\uff01<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-4\">Step 1: pyglet\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u958b\u767a\u74b0\u5883\u306e\u8a2d\u5b9a<\/a>      <\/li>      <li>        <a href=\"#i-5\">Step 2: \u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u8868\u793a\u3068\u56f3\u5f62\u306e\u63cf\u753b<\/a>      <\/li>      <li>        <a href=\"#i-6\">Step 3: \u30ad\u30fc\u30dc\u30fc\u30c9\u3068\u30de\u30a6\u30b9\u5165\u529b\u306e\u51e6\u7406<\/a>      <\/li>      <li>        <a href=\"#i-7\">Step 4: \u30b9\u30d7\u30e9\u30a4\u30c8\u306e\u4f7f\u3044\u65b9\u3068\u885d\u7a81\u5224\u5b9a<\/a>      <\/li>      <li>        <a href=\"#i-8\">Step 5: \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u5b9f\u88c5\u30c6\u30af\u30cb\u30c3\u30af<\/a>      <\/li>      <li>        <a href=\"#i-9\">Step 6: \u97f3\u58f0\u306e\u518d\u751f\u3068\u52b9\u679c\u97f3\u306e\u4ed8\u3051\u65b9<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-10\">Step 7: \u5b9f\u8df5\uff01\u30b7\u30f3\u30d7\u30eb\u306a2D\u30b2\u30fc\u30e0\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-11\">pyglet\u306e\u5fdc\u7528\u7684\u306a\u4f7f\u3044\u65b9\u3068\u767a\u5c55\u7684\u30c8\u30d4\u30c3\u30af<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-12\">pyglet\u3068OpenGL\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u9ad8\u5ea6\u306a\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u30b9\u51e6\u7406<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-13\">pyglet\u3092\u4f7f\u3063\u305f2D\u30b2\u30fc\u30e0\u306e\u5b9f\u4f8b\u7d39\u4ecb<\/a>      <\/li>    <\/ul>  <\/li>  <li class=\"last\">    <a href=\"#i-14\">\u307e\u3068\u3081\uff1apyglet\u30672D\u30b2\u30fc\u30e0\u958b\u767a\u306e\u4e16\u754c\u3092\u5e83\u3052\u3088\u3046\uff01<\/a>  <\/li><\/ul>\n      \n    <\/div><\/div><h2 class=\"wp-block-heading\" id=\"i-0\">pyglet\u3068\u306f\uff1f2D\u30b2\u30fc\u30e0\u958b\u767a\u306b\u6700\u9069\u306aPython\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5fb9\u5e95\u89e3\u8aac<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-1\">pyglet\u306e\u6982\u8981\u3068\u7279\u5fb4<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">pyglet\u306f\u3001Python\u30672D\u30b2\u30fc\u30e0\u3084\u30de\u30eb\u30c1\u30e1\u30c7\u30a3\u30a2\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3059\u308b\u305f\u3081\u306e\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002\u30af\u30ed\u30b9\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001Windows\u3001Mac\u3001Linux\u306a\u3069\u591a\u69d8\u306a\u74b0\u5883\u3067\u52d5\u4f5c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">pyglet\u306e\u5927\u304d\u306a\u7279\u5fb4\u306f\u3001\u30b7\u30f3\u30d7\u30eb\u3067\u6271\u3044\u3084\u3059\u3044API\u3092\u63d0\u4f9b\u3057\u3066\u3044\u308b\u70b9\u3067\u3059\u3002\u5fc5\u8981\u6700\u5c0f\u9650\u306e\u30b3\u30fc\u30c9\u3067\u3001\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u8868\u793a\u3001\u56f3\u5f62\u306e\u63cf\u753b\u3001\u30a4\u30d9\u30f3\u30c8\u51e6\u7406\u306a\u3069\u306e\u57fa\u672c\u7684\u306a\u30b2\u30fc\u30e0\u8981\u7d20\u3092\u5b9f\u88c5\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3060\u3051\u3067\u3001\u753b\u9762\u4e0a\u306b\u56db\u89d2\u5f62\u3092\u63cf\u753b\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import pyglet\n\nwindow = pyglet.window.Window()\n\n@window.event\ndef on_draw():\n    window.clear()\n    pyglet.graphics.draw(4, pyglet.gl.GL_QUADS, ('v2f', [100, 100, 300, 100, 300, 200, 100, 200]))\n\npyglet.app.run()<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">pyglet\u306f\u3001\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u30b9\u51e6\u7406\u306bOpenGL\u3092\u63a1\u7528\u3057\u3066\u3044\u307e\u3059\u3002OpenGL\u306f\u3001\u30af\u30ed\u30b9\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3067\u9ad8\u901f\u306a2D\/3D\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u30b9\u3092\u5b9f\u73fe\u3059\u308b\u696d\u754c\u6a19\u6e96\u306eAPI\u3067\u3059\u3002pyglet\u306f\u3001\u3053\u306eOpenGL\u306e\u9ad8\u5ea6\u306a\u6a5f\u80fd\u3092\u3001\u5206\u304b\u308a\u3084\u3059\u3044Python\u306eAPI\u306b\u62bd\u8c61\u5316\u3059\u308b\u3053\u3068\u3067\u3001\u958b\u767a\u8005\u304c\u7c21\u5358\u306b\u9ad8\u901f\u306a\u63cf\u753b\u3092\u5b9f\u73fe\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-2\">pyglet\u3092\u4f7f\u3046\u30e1\u30ea\u30c3\u30c8 \u2013 \u30b7\u30f3\u30d7\u30eb\u3055\u3001\u8efd\u91cf\u6027\u3001\u30af\u30ed\u30b9\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u5bfe\u5fdc<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">pyglet\u3092\u4f7f\u3063\u30662D\u30b2\u30fc\u30e0\u3092\u958b\u767a\u3059\u308b\u30e1\u30ea\u30c3\u30c8\u306f\u3001\u4ee5\u4e0b\u306e3\u70b9\u306b\u307e\u3068\u3081\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30b7\u30f3\u30d7\u30eb\u3067\u6271\u3044\u3084\u3059\u3044API\n<ul class=\"wp-block-list\">\n<li>Python\u306e\u521d\u5fc3\u8005\u3067\u3082\u76f4\u611f\u7684\u306b\u7406\u89e3\u3057\u3084\u3059\u3044<\/li>\n\n\n\n<li>\u6700\u5c0f\u9650\u306e\u30b3\u30fc\u30c9\u91cf\u3067\u30b2\u30fc\u30e0\u306e\u57fa\u672c\u8981\u7d20\u3092\u5b9f\u88c5\u53ef\u80fd<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\u9ad8\u901f\u306a\u63cf\u753b\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\n<ul class=\"wp-block-list\">\n<li>OpenGL\u30d9\u30fc\u30b9\u306e\u63cf\u753b\u306b\u3088\u308a\u3001\u9ad8\u901f\u3067\u6ed1\u3089\u304b\u306a\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u30b9\u3092\u5b9f\u73fe<\/li>\n\n\n\n<li>CPU\u3084\u30e1\u30e2\u30ea\u306e\u8ca0\u8377\u304c\u5c0f\u3055\u304f\u3001\u30ea\u30bd\u30fc\u30b9\u3092\u52b9\u7387\u7684\u306b\u5229\u7528<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\u30af\u30ed\u30b9\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u5bfe\u5fdc\n<ul class=\"wp-block-list\">\n<li>Windows\u3001Mac\u3001Linux\u306a\u3069\u3001\u69d8\u3005\u306a\u74b0\u5883\u3067\u540c\u3058\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u53ef\u80fd<br>-\u7570\u306a\u308bOS\u30e6\u30fc\u30b6\u30fc\u9593\u3067\u30b2\u30fc\u30e0\u3092\u5171\u6709\u3057\u3084\u3059\u3044<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ed6\u306ePython\u306e\u30b2\u30fc\u30e0\u958b\u767a\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u6bd4\u8f03\u3057\u3066\u3082\u3001pyglet\u306f\u512a\u308c\u305f\u7279\u6027\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001Pygame\u3068\u6bd4\u3079\u308b\u3068\u3088\u308a\u30e2\u30c0\u30f3\u3067\u76f4\u611f\u7684\u306aAPI\u3092\u63d0\u4f9b\u3057\u3066\u304a\u308a\u3001OpenGL\u30d9\u30fc\u30b9\u306e\u63cf\u753b\u306b\u3088\u3063\u3066\u9ad8\u901f\u306a\u5b9f\u884c\u304c\u53ef\u80fd\u3067\u3059\u3002Kivy\u306f\u30e2\u30d0\u30a4\u30eb\u30a2\u30d7\u30ea\u306e\u958b\u767a\u306b\u9069\u3057\u3066\u3044\u307e\u3059\u304c\u3001pyglet\u306f\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u30b2\u30fc\u30e0\u306e\u958b\u767a\u306b\u7279\u5316\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u4e0a\u306e\u3088\u3046\u306b\u3001pyglet\u306f2D\u30b2\u30fc\u30e0\u958b\u767a\u306b\u6700\u9069\u306aPython\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u8a00\u3048\u307e\u3059\u3002\u521d\u5fc3\u8005\u304b\u3089\u4e0a\u7d1a\u8005\u307e\u3067\u3001\u5e45\u5e83\u3044\u5c64\u306e\u958b\u767a\u8005\u304cpyglet\u306e\u30e1\u30ea\u30c3\u30c8\u3092\u6d3b\u304b\u3057\u3066\u30aa\u30ea\u30b8\u30ca\u30eb\u306e\u30b2\u30fc\u30e0\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3067\u3057\u3087\u3046\u3002\u6b21\u306e\u7ae0\u3067\u306f\u3001\u5b9f\u969b\u306bpyglet\u3092\u4f7f\u3063\u305f\u30b2\u30fc\u30e0\u958b\u767a\u306e\u57fa\u672c\u3092\u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u3067\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-3\">pyglet\u3092\u4f7f\u3063\u305f2D\u30b2\u30fc\u30e0\u958b\u767a\u5165\u9580 \u2013 7\u30b9\u30c6\u30c3\u30d7\u3067\u30de\u30b9\u30bf\u30fc\u3057\u3088\u3046\uff01<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">pyglet\u3092\u4f7f\u3048\u3070\u3001Python\u3067\u3082\u672c\u683c\u7684\u306a2D\u30b2\u30fc\u30e0\u3092\u624b\u8efd\u306b\u958b\u767a\u3067\u304d\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u521d\u5fc3\u8005\u3067\u3082\u308f\u304b\u308a\u3084\u3059\u3044\u3088\u3046\u30017\u3064\u306e\u30b9\u30c6\u30c3\u30d7\u306b\u5206\u3051\u3066pyglet\u306e\u4f7f\u3044\u65b9\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u52d5\u304b\u3057\u306a\u304c\u3089\u3001\u30b2\u30fc\u30e0\u958b\u767a\u306e\u57fa\u790e\u3092\u8eab\u306b\u3064\u3051\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-4\">Step 1: pyglet\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u958b\u767a\u74b0\u5883\u306e\u8a2d\u5b9a<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305a\u306f\u3001pyglet\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u3087\u3046\u3002pip\u3092\u4f7f\u3048\u3070\u3001\u7c21\u5358\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip install pyglet<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b21\u306b\u3001\u958b\u767a\u74b0\u5883\u3092\u6574\u3048\u307e\u3059\u3002\u304a\u597d\u307f\u306e\u30a8\u30c7\u30a3\u30bf\u3084IDE\u3092\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002VSCode\u3084PyCharm\u304c\u304a\u3059\u3059\u3081\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-5\">Step 2: \u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u8868\u793a\u3068\u56f3\u5f62\u306e\u63cf\u753b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">pyglet\u3067\u30b2\u30fc\u30e0\u3092\u4f5c\u308b\u306b\u306f\u3001\u307e\u305a\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u304b\u3089\u59cb\u3081\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u3001800\u00d7600\u30d4\u30af\u30bb\u30eb\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import pyglet\n\nwindow = pyglet.window.Window(800, 600)\npyglet.app.run()<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u3067\u304d\u305f\u3089\u3001\u56f3\u5f62\u3092\u63cf\u753b\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u4ee5\u4e0b\u306f\u3001\u8d64\u3044\u56db\u89d2\u5f62\u3092\u63cf\u753b\u3059\u308b\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">@window.event\ndef on_draw():\n    window.clear()\n    pyglet.graphics.draw(4, pyglet.gl.GL_QUADS,\n        ('v2f', [200, 200, 400, 200, 400, 400, 200, 400]),\n        ('c3B', [255, 0, 0, 255, 0, 0, 255, 0, 0, 255, 0, 0]))<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-6\">Step 3: \u30ad\u30fc\u30dc\u30fc\u30c9\u3068\u30de\u30a6\u30b9\u5165\u529b\u306e\u51e6\u7406<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u30b2\u30fc\u30e0\u3067\u306f\u3001\u30ad\u30fc\u30dc\u30fc\u30c9\u3084\u30de\u30a6\u30b9\u304b\u3089\u306e\u5165\u529b\u3092\u51e6\u7406\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002pyglet\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3067\u3001\u5165\u529b\u3092\u691c\u51fa\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">@window.event\ndef on_key_press(symbol, modifiers):\n    if symbol == pyglet.window.key.LEFT:\n        print(\"\u5de6\u30ad\u30fc\u304c\u62bc\u3055\u308c\u307e\u3057\u305f\")\n    elif symbol == pyglet.window.key.RIGHT:\n        print(\"\u53f3\u30ad\u30fc\u304c\u62bc\u3055\u308c\u307e\u3057\u305f\")\n\n@window.event\ndef on_mouse_press(x, y, button, modifiers):\n    if button == pyglet.window.mouse.LEFT:\n        print(f\"\u30de\u30a6\u30b9\u5de6\u30dc\u30bf\u30f3\u304c({x}, {y})\u3067\u62bc\u3055\u308c\u307e\u3057\u305f\")<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-7\">Step 4: \u30b9\u30d7\u30e9\u30a4\u30c8\u306e\u4f7f\u3044\u65b9\u3068\u885d\u7a81\u5224\u5b9a<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u30b2\u30fc\u30e0\u306b\u306f\u6b20\u304b\u305b\u306a\u3044\u3001\u30b9\u30d7\u30e9\u30a4\u30c8\uff08\u753b\u50cf\uff09\u306e\u6271\u3044\u65b9\u3092\u898b\u3066\u3044\u304d\u307e\u3059\u3002pyglet\u3067\u306f\u3001<code>pyglet.sprite.Sprite<\/code>\u30af\u30e9\u30b9\u3092\u4f7f\u3063\u3066\u30b9\u30d7\u30e9\u30a4\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">player_image = pyglet.image.load('player.png')\nplayer = pyglet.sprite.Sprite(player_image, x=400, y=300)<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u30b9\u30d7\u30e9\u30a4\u30c8\u540c\u58eb\u306e\u885d\u7a81\u5224\u5b9a\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u77e9\u5f62\u306e\u91cd\u306a\u308a\u3092\u8abf\u3079\u308b\u3053\u3068\u3067\u5b9f\u88c5\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">def check_collision(sprite1, sprite2):\n    return (sprite1.x &lt; sprite2.x + sprite2.width and\n            sprite1.x + sprite1.width &gt; sprite2.x and\n            sprite1.y &lt; sprite2.y + sprite2.height and\n            sprite1.y + sprite1.height &gt; sprite2.y)<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-8\">Step 5: \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u5b9f\u88c5\u30c6\u30af\u30cb\u30c3\u30af<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3092\u52d5\u304b\u3059\u306b\u306f\u3001\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u306e\u5b9f\u88c5\u304c\u6b20\u304b\u305b\u307e\u305b\u3093\u3002pyglet\u3067\u306f\u3001\u30b9\u30d7\u30e9\u30a4\u30c8\u30b7\u30fc\u30c8\u3092\u4f7f\u3063\u3066\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">character_sheet = pyglet.image.load('character_sheet.png')\ncharacter_grid = pyglet.image.ImageGrid(character_sheet, rows=4, columns=3)\ncharacter_anim = pyglet.image.Animation.from_image_sequence(character_grid, duration=0.1, loop=True)\n\ncharacter = pyglet.sprite.Sprite(character_anim)<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-9\">Step 6: \u97f3\u58f0\u306e\u518d\u751f\u3068\u52b9\u679c\u97f3\u306e\u4ed8\u3051\u65b9<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">BGM\u3084\u52b9\u679c\u97f3\u306f\u3001\u30b2\u30fc\u30e0\u3092\u6f14\u51fa\u3059\u308b\u4e0a\u3067\u91cd\u8981\u306a\u8981\u7d20\u3067\u3059\u3002pyglet\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u97f3\u58f0\u30d5\u30a1\u30a4\u30eb\u3092\u518d\u751f\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">bgm = pyglet.media.load('bgm.mp3')\nbgm_player = pyglet.media.Player()\nbgm_player.queue(bgm)\nbgm_player.play()\n\nse = pyglet.media.load('sound_effect.wav', streaming=False)\nse.play()<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-10\">Step 7: \u5b9f\u8df5\uff01\u30b7\u30f3\u30d7\u30eb\u306a2D\u30b2\u30fc\u30e0\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u5f8c\u306b\u3001\u3053\u308c\u307e\u3067\u5b66\u3093\u3060\u77e5\u8b58\u3092\u6d3b\u304b\u3057\u3066\u3001\u7c21\u5358\u306a2D\u30b2\u30fc\u30e0\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u4ee5\u4e0b\u306f\u3001\u4e0a\u4e0b\u5de6\u53f3\u30ad\u30fc\u3067\u79fb\u52d5\u3067\u304d\u308b\u30d7\u30ec\u30a4\u30e4\u30fc\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3092\u5b9f\u88c5\u3057\u305f\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import pyglet\n\nclass Player(pyglet.sprite.Sprite):\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        self.velocity_x = 0\n        self.velocity_y = 0\n\n    def update(self, dt):\n        self.x += self.velocity_x * dt\n        self.y += self.velocity_y * dt\n\n        # \u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u5916\u306b\u51fa\u306a\u3044\u3088\u3046\u306b\u5236\u9650\n        self.x = max(0, min(self.x, window.width - self.width))\n        self.y = max(0, min(self.y, window.height - self.height))\n\nwindow = pyglet.window.Window(800, 600)\n\nplayer_image = pyglet.resource.image('player.png')\nplayer = Player(player_image, x=400, y=300)\n\n@window.event\ndef on_key_press(symbol, modifiers):\n    if symbol == pyglet.window.key.LEFT:\n        player.velocity_x = -200\n    elif symbol == pyglet.window.key.RIGHT:\n        player.velocity_x = 200\n    elif symbol == pyglet.window.key.UP:\n        player.velocity_y = 200\n    elif symbol == pyglet.window.key.DOWN:\n        player.velocity_y = -200\n\n@window.event\ndef on_key_release(symbol, modifiers):\n    if symbol in (pyglet.window.key.LEFT, pyglet.window.key.RIGHT):\n        player.velocity_x = 0\n    elif symbol in (pyglet.window.key.UP, pyglet.window.key.DOWN):\n        player.velocity_y = 0\n\n@window.event\ndef on_draw():\n    window.clear()\n    player.draw()\n\ndef update(dt):\n    player.update(dt)\n\nif __name__ == '__main__':\n    pyglet.clock.schedule_interval(update, 1\/60)\n    pyglet.app.run()<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u4e0a\u3001pyglet\u3092\u4f7f\u3063\u305f2D\u30b2\u30fc\u30e0\u958b\u767a\u306e\u57fa\u790e\u30927\u3064\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u5b9f\u969b\u306b\u52d5\u304b\u3057\u306a\u304c\u3089\u3001pyglet\u306e\u4f7f\u3044\u65b9\u3092\u4f53\u611f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u304b\u3089\u306f\u3001\u81ea\u5206\u306e\u601d\u3044\u63cf\u304f\u30aa\u30ea\u30b8\u30ca\u30eb\u30b2\u30fc\u30e0\u306e\u958b\u767a\u306b\u6311\u6226\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-11\">pyglet\u306e\u5fdc\u7528\u7684\u306a\u4f7f\u3044\u65b9\u3068\u767a\u5c55\u7684\u30c8\u30d4\u30c3\u30af<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3053\u307e\u3067\u306e\u7ae0\u3067\u3001pyglet\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3092\u30de\u30b9\u30bf\u30fc\u3057\u3066\u304d\u307e\u3057\u305f\u3002\u3057\u304b\u3057\u3001pyglet\u306e\u771f\u306e\u529b\u306f\u3001\u5fdc\u7528\u7684\u306a\u4f7f\u3044\u65b9\u3084\u767a\u5c55\u7684\u306a\u30c8\u30d4\u30c3\u30af\u306b\u3042\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001pyglet\u3068OpenGL\u306e\u9023\u3001\u5b9f\u969b\u306e\u30b2\u30fc\u30e0\u958b\u767a\u4e8b\u4f8b\u306a\u3069\u3092\u7d39\u4ecb\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-12\">pyglet\u3068OpenGL\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u9ad8\u5ea6\u306a\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u30b9\u51e6\u7406<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">pyglet\u306f\u3001OpenGL\u306e\u30e9\u30c3\u30d1\u30fc\u3068\u3057\u3066\u6a5f\u80fd\u3057\u3001OpenGL\u306e\u9ad8\u5ea6\u306a\u6a5f\u80fd\u3092\u7c21\u5358\u306b\u5229\u7528\u3067\u304d\u307e\u3059\u3002OpenGL\u3092\u76f4\u63a5\u4f7f\u3046\u3053\u3068\u3067\u3001\u30b7\u30a7\u30fc\u30c0\u30fc\u306e\u4f7f\u7528\u3001\u30c6\u30af\u30b9\u30c1\u30e3\u30de\u30c3\u30d4\u30f3\u30b0\u3001\u30e9\u30a4\u30c6\u30a3\u30f3\u30b0\u306a\u3069\u306e\u9ad8\u5ea6\u306a\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u30b9\u51e6\u7406\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u4e0b\u306f\u3001OpenGL\u3092\u4f7f\u3063\u3066\u4e09\u89d2\u5f62\u3092\u63cf\u753b\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import pyglet\nfrom pyglet.gl import *\n\nwindow = pyglet.window.Window()\n\n@window.event\ndef on_draw():\n    glClear(GL_COLOR_BUFFER_BIT)\n    glBegin(GL_TRIANGLES)\n    glVertex2f(0, 0)\n    glVertex2f(window.width, 0)\n    glVertex2f(window.width\/2, window.height)\n    glEnd()\n\npyglet.app.run()<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u3088\u3046\u306b\u3001pyglet\u3068OpenGL\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u9ad8\u5ea6\u3067\u67d4\u8edf\u306a\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u30b9\u8868\u73fe\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002\u30b2\u30fc\u30e0\u306e\u30d3\u30b8\u30e5\u30a2\u30eb\u9762\u3092\u5f37\u5316\u3057\u305f\u3044\u5834\u5408\u306f\u3001OpenGL\u306e\u77e5\u8b58\u3092\u6df1\u3081\u308b\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-13\">pyglet\u3092\u4f7f\u3063\u305f2D\u30b2\u30fc\u30e0\u306e\u5b9f\u4f8b\u7d39\u4ecb<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">pyglet\u3092\u4f7f\u3063\u3066\u958b\u767a\u3055\u308c\u305f2D\u30b2\u30fc\u30e0\u306e\u5b9f\u4f8b\u3092\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002\u3053\u308c\u3089\u306e\u4e8b\u4f8b\u304b\u3089\u3001\u30b2\u30fc\u30e0\u30b8\u30e3\u30f3\u30eb\u3054\u3068\u306e\u7279\u5fb4\u3084\u5b9f\u88c5\u30c6\u30af\u30cb\u30c3\u30af\u3092\u5b66\u3076\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u300cPyglet Snake\u300d\uff1a\u30b9\u30cd\u30fc\u30af\u30b2\u30fc\u30e0<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/mohtar\/ular\">https:\/\/github.com\/mohtar\/ular<\/a><\/li>\n\n\n\n<li>\u30b0\u30ea\u30c3\u30c9\u30d9\u30fc\u30b9\u306e\u30b2\u30fc\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5b9f\u88c5\u65b9\u6cd5\u304c\u308f\u304b\u308b<\/li>\n\n\n\n<li>\u30ad\u30fc\u5165\u529b\u306e\u51e6\u7406\u3084\u3001\u30b9\u30b3\u30a2\u7ba1\u7406\u306e\u65b9\u6cd5\u304c\u5b66\u3079\u308b<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u300cPyglet Pong\u300d\uff1a\u30d4\u30f3\u30dd\u30f3\u30b2\u30fc\u30e0<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/pythonprogramming.org\/making-pongpong-game-development-using-pyglet-part-1\/\">https:\/\/pythonprogramming.org\/making-pongpong-game-development-using-pyglet-part-1\/<\/a><\/li>\n\n\n\n<li>\u30dc\u30fc\u30eb\u306e\u7269\u7406\u6319\u52d5\u306e\u5b9f\u88c5\u4f8b\u3068\u3057\u3066\u53c2\u8003\u306b\u306a\u308b<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u308c\u3089\u306e\u5b9f\u4f8b\u3092\u53c2\u8003\u306b\u3001\u81ea\u5206\u306a\u308a\u306e\u30a2\u30a4\u30c7\u30a2\u3092\u53d6\u308a\u5165\u308c\u3066\u3001\u30aa\u30ea\u30b8\u30ca\u30eb\u306e2D\u30b2\u30fc\u30e0\u3092\u958b\u767a\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-14\">\u307e\u3068\u3081\uff1apyglet\u30672D\u30b2\u30fc\u30e0\u958b\u767a\u306e\u4e16\u754c\u3092\u5e83\u3052\u3088\u3046\uff01<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001pyglet\u3092\u4f7f\u3063\u305f2D\u30b2\u30fc\u30e0\u958b\u767a\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u3092\u4e00\u901a\u308a\u89e3\u8aac\u3057\u3066\u304d\u307e\u3057\u305f\u3002\u30b7\u30f3\u30d7\u30eb\u306aAPI\u3068\u3001Python\u306e\u89aa\u3057\u307f\u3084\u3059\u3055\u3092\u517c\u306d\u5099\u3048\u305fpyglet\u306f\u3001\u30b2\u30fc\u30e0\u958b\u767a\u306e\u5165\u9580\u306b\u6700\u9069\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">pyglet\u306e\u5b66\u7fd2\u3092\u901a\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u77e5\u8b58\u3068\u30b9\u30ad\u30eb\u304c\u8eab\u306b\u3064\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Python\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u5b9f\u8df5\u7684\u306a\u30b9\u30ad\u30eb<\/li>\n\n\n\n<li>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u7406\u89e3<\/li>\n\n\n\n<li>\u30b2\u30fc\u30e0\u306e\u57fa\u672c\u7684\u306a\u69cb\u6210\u8981\u7d20\uff08\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u30b9\u3001\u5165\u529b\u51e6\u7406\u3001\u97f3\u58f0\u306a\u3069\uff09\u306e\u6271\u3044\u65b9<\/li>\n\n\n\n<li>2D\u30b2\u30fc\u30e0\u306e\u4e00\u822c\u7684\u306a\u5b9f\u88c5\u30d1\u30bf\u30fc\u30f3<\/li>\n\n\n\n<li>\u30b2\u30fc\u30e0\u958b\u767a\u306e\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u3068\u3001\u958b\u767a\u74b0\u5883\u306e\u69cb\u7bc9\u65b9\u6cd5<\/li>\n\n\n\n<li>OpenGL\u3092\u4f7f\u3063\u305f\u9ad8\u5ea6\u306a\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u30b9\u51e6\u7406\u306e\u57fa\u790e<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u308c\u3089\u306e\u77e5\u8b58\u3068\u30b9\u30ad\u30eb\u306f\u3001pyglet\u3092\u4f7f\u3063\u305f\u30b2\u30fc\u30e0\u958b\u767a\u3060\u3051\u3067\u306a\u304f\u3001\u4ed6\u306e\u8a00\u8a9e\u3084\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u5b66\u3076\u969b\u306b\u3082\u5927\u3044\u306b\u5f79\u7acb\u3064\u306f\u305a\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">pyglet\u306e\u9b45\u529b\u306f\u3001\u4f55\u3068\u3044\u3063\u3066\u3082\u305d\u306e\u6271\u3044\u3084\u3059\u3055\u306b\u3042\u308a\u307e\u3059\u3002\u30af\u30ed\u30b9\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306b\u5bfe\u5fdc\u3057\u3001\u7121\u6599\u3067\u5229\u7528\u3067\u304d\u308b\u305f\u3081\u3001\u624b\u8efd\u306b2D\u30b2\u30fc\u30e0\u958b\u767a\u3092\u59cb\u3081\u3089\u308c\u307e\u3059\u3002\u307e\u305f\u3001OpenGL\u30d9\u30fc\u30b9\u306e\u9ad8\u901f\u306a\u63cf\u753b\u306b\u3088\u308a\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u9ad8\u3044\u30b2\u30fc\u30e0\u3092\u958b\u767a\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b7\u30f3\u30d7\u30eb\u306a\u30b3\u30fc\u30c9\u3067\u3001\u81ea\u5206\u3060\u3051\u306e\u30aa\u30ea\u30b8\u30ca\u30eb\u30b2\u30fc\u30e0\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import pyglet\n\nwindow = pyglet.window.Window(width=800, height=600)\n\n# \u30b2\u30fc\u30e0\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u521d\u671f\u5316\nplayer = Player()\nenemies = [Enemy() for _ in range(10)]\n\n@window.event\ndef on_draw():\n    window.clear()\n    # \u30b2\u30fc\u30e0\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u63cf\u753b\n    player.draw()\n    for enemy in enemies:\n        enemy.draw()\n\ndef update(dt):\n    # \u30b2\u30fc\u30e0\u306e\u72b6\u614b\u3092\u66f4\u65b0\n    player.update(dt)\n    for enemy in enemies:\n        enemy.update(dt)\n\nif __name__ == \"__main__\":\n    pyglet.clock.schedule_interval(update, 1\/60)\n    pyglet.app.run()<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">pyglet\u306e\u7fd2\u5f97\u306f\u3001\u30b2\u30fc\u30e0\u958b\u767a\u8005\u3068\u3057\u3066\u306e\u30ad\u30e3\u30ea\u30a2\u5f62\u6210\u306b\u3082\u5927\u304d\u304f\u5f79\u7acb\u3061\u307e\u3059\u3002\u81ea\u4f5c\u30b2\u30fc\u30e0\u3092\u958b\u767a\u3057\u3001\u30dd\u30fc\u30c8\u30d5\u30a9\u30ea\u30aa\u3092\u5145\u5b9f\u3055\u305b\u308b\u3053\u3068\u3067\u3001\u5c31\u8077\u3084\u8ee2\u8077\u306e\u969b\u306b\u30a2\u30d4\u30fc\u30eb\u30dd\u30a4\u30f3\u30c8\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002\u307e\u305f\u3001\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u3078\u306e\u53c2\u52a0\u30fb\u8ca2\u732e\u3092\u901a\u3058\u3066\u3001\u5b9f\u8df5\u7684\u306a\u958b\u767a\u7d4c\u9a13\u3092\u7a4d\u3080\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3055\u3089\u306b\u3001pyglet\u3092\u30d9\u30fc\u30b9\u306b\u72ec\u81ea\u306e\u30b2\u30fc\u30e0\u30a8\u30f3\u30b8\u30f3\u3092\u958b\u767a\u3057\u305f\u308a\u3001\u30e2\u30d0\u30a4\u30eb\u7aef\u672b\u3084Web\u3078\u306e\u5c55\u958b\u3092\u8996\u91ce\u306b\u5165\u308c\u305f\u30af\u30ed\u30b9\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u958b\u767a\u306b\u6311\u6226\u3057\u305f\u308a\u3068\u3001pyglet\u3092\u8d77\u70b9\u306b\u3088\u308a\u9ad8\u5ea6\u306a\u30b2\u30fc\u30e0\u958b\u767a\u3078\u3068\u30b9\u30c6\u30c3\u30d7\u30a2\u30c3\u30d7\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u305c\u3072\u3001\u3053\u306e\u8a18\u4e8b\u3067\u5b66\u3093\u3060\u3053\u3068\u3092\u6d3b\u304b\u3057\u3066\u3001pyglet\u3067\u81ea\u5206\u3060\u3051\u306e\u30aa\u30ea\u30b8\u30ca\u30eb\u30b2\u30fc\u30e0\u3092\u958b\u767a\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30ad\u30eb\u306e\u5411\u4e0a\u3068\u3001\u30b2\u30fc\u30e0\u958b\u767a\u306e\u697d\u3057\u3055\u3092\u540c\u6642\u306b\u5473\u308f\u3048\u308b\u7d4c\u9a13\u306b\u306a\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">pyglet\u306e\u4e16\u754c\u306f\u3001\u3042\u306a\u305f\u306e\u5275\u9020\u529b\u3092\u5f85\u3063\u3066\u3044\u307e\u3059\u3002\u3055\u3042\u30012D\u30b2\u30fc\u30e0\u958b\u767a\u306e\u6249\u3092\u958b\u3044\u3066\u3001\u305d\u306e\u53ef\u80fd\u6027\u3092\u5b58\u5206\u306b\u63a2\u6c42\u3057\u307e\u3057\u3087\u3046\uff01<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python\u3067\u30b2\u30fc\u30e0\u958b\u767a\u3092\u59cb\u3081\u308b\u306a\u3089\u3001pyglet\u304c\u304a\u3059\u3059\u3081\uff01\u30b7\u30f3\u30d7\u30eb\u306aAPI\u3068\u9ad8\u901f\u306a\u63cf\u753b\u6a5f\u80fd\u3092\u5099\u3048\u305f\u3053\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3048\u3070\u3001\u521d\u5fc3\u8005\u3067\u3082\u7c21\u5358\u306b2D\u30b2\u30fc\u30e0\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001pyglet\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u304b\u3089 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":501,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-499","post","type-post","status-publish","format-standard","has-post-thumbnail","category-python"],"_links":{"self":[{"href":"https:\/\/chocottopro.com\/index.php?rest_route=\/wp\/v2\/posts\/499","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chocottopro.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chocottopro.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chocottopro.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chocottopro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=499"}],"version-history":[{"count":1,"href":"https:\/\/chocottopro.com\/index.php?rest_route=\/wp\/v2\/posts\/499\/revisions"}],"predecessor-version":[{"id":500,"href":"https:\/\/chocottopro.com\/index.php?rest_route=\/wp\/v2\/posts\/499\/revisions\/500"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chocottopro.com\/index.php?rest_route=\/wp\/v2\/media\/501"}],"wp:attachment":[{"href":"https:\/\/chocottopro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chocottopro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=499"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chocottopro.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}