2010-04-14から1日間の記事一覧
新たにTargetクラスを作成し、標的の処理をTargetクラスのメソッドにする。 package sample.game; import static sample.game.utils.GraphicUtils.*; import javax.microedition.khronos.opengles.GL10; import android.content.Context; import android.uti…
タッチイベントの受け取りはActivityのonTouchEventをオーバーライド。EsGameRenderクラスにはタッチイベントの内容を受け取るメソッドを追加。 EsGameActivityクラスの修正部分。 //OpenGLESビュー private GLSurfaceView gLSurfaceView; private EsGameRen…
EsGameRenderクラスにハエの表示と移動の処理を追加。 GCが走ると一瞬、移動が止まる…。LogCatを見るとGCに100msほどかかっている。 package sample.game; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL…
第1章のサンプルは、ほぼそのままAndroidでも動かすことができました。 引き続き、ハエたたきゲームも移植してみます。 EsGameプロジェクトを作成し、EsGameActivityクラスとEsGameRenderクラスを作成。 GraphicUtilsクラスとTextureLoaderクラスを適当なパ…