Windows での,cocos2d, pygame, pyglet のインストール手順を説明する. cocos2d は、 2次元のゲーム,グラフィックス,対話型のアプリケーションを作ることができるフレームワーク. Windows, OS X, Linux で動く.
Windows での Python 3.10,関連パッケージ,Python 開発環境のインストール: 別ページ »で説明
【サイト内の関連ページ】
Python のまとめ: 別ページ »にまとめ
【関連する外部ページ】
Python の公式ページ: https://www.python.org/
【外部ページへのリンク】 http://python.cocos2d.org/doc/programming_guide/installation.html の手順で行う.
コマンドプロンプトを管理者として実行: 別ページ »で説明
python --version
python -m pip install -U six msgpack pyglet pygame cocos2d
エラーメッセージが出ていないことを確認する
python -m pip show pyglet python -m pip show six python -m pip show pygame python -m pip show cocos2d
Python プログラムを実行する
import cocos from cocos.text import Label from cocos import scene from cocos.layer import Layer from cocos.director import director class HelloWorld(Layer): def __init__(self): super(HelloWorld, self).__init__() hello_world_label = Label( "Hello World!", font_name = "Times New Roman", font_size = 32, anchor_x = 'center', anchor_y = 'center' ) hello_world_label.position = 320, 240 self.add(hello_world_label) director.init() director.run( scene.Scene( HelloWorld() ) )
確認したら,右上の「x」をクリックして消す.