MIDP 2.0 开发J2ME游戏起步之二
日期:2007年5月4日 作者: 查看:[大字体 中字体 小字体]-
// Gets/sets
/**
* This tells the player to turn left or right.
* @param left whether the turn is toward the left.
*/
void setLeft(boolean left) {
myLeft = left;
}//-----------------------------------------------------
// Initialization and game state changes/**
* Constructor sets the data and constructs the graphical objects.
* @param x The X coordinate of the place on the game canvas where
* the LayerManager window should appear, in terms of the
* coordinates of the game canvas.
* @param y The Y coordinate of the place on the game canvas where
* the LayerManager window should appear, in terms of the
* coordinates of the game canvas.
* @param width The width of the region that is to be
* occupied by the LayoutManager.
* @param height The height of the region that is to be
* occupied by the LayoutManager.
*/
public JumpManager(int x, int y, int width, int height)
throws Exception {
CANVAS_X = x;
CANVAS_Y = y;
DISP_WIDTH = width;
DISP_HEIGHT = height;
myCurrentLeftX = Grass.CYCLE*Grass.TILE_WIDTH;
setViewWindow(0, 0, DISP_WIDTH, DISP_HEIGHT);
// Create the player:
if(myCowboy == null) {
myCowboy = new Cowboy(myCurrentLeftX + DISP_WIDTH/2, DISP_HEIGHT - Cowboy.HEIGHT - 2);
append(myCowboy);
}
// Create the tumbleweeds to jump over:
if(myLeftTumbleweeds == null) {
myLeftTumbleweeds = new Tumbleweed[2];
for(int i = 0; i < myLeftTumbleweeds.length; i++) {
myLeftTumbleweeds[i] = new Tumbleweed(true);
append(myLeftTumbleweeds[i]);
}
}
if(myRightTumbleweeds == null) {
myRightTumbleweeds = new Tumbleweed[2];
for(int i = 0; i < myRightTumbleweeds.length; i++) {
myRightTumbleweeds[i] = new Tumbleweed(false); - 上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] 下一页
-
- MIDP 2.0 开发J2ME游戏起步之二 相关文章:
- ·Web2.0在中国步入歧途 缺赢利模式VC有错
- ·C #中的几个线程同步对象方法
- ·简单七步最大限度优化你的博客文章
- ·江民教你五步远离“机器狗”病毒侵扰
- ·加强边界路由器安全防护的几个步骤
- ·教你两步彻底根除系统多余输入法
- ·改进SQL Server数据库系统安全五步走
- ·Photoshop调色 五步搞定军色效果
- ·ASP.NET AJAX中的异步Web Services调用
- ·Office文档打印成为TIFF图形文件的步骤
- MIDP 2.0 开发J2ME游戏起步之二 相关软件
- ·忧郁狐步
- ·《月球漫步》模拟器
- ·《独步武林》
- ·独步天下
- ·NDS《简单DS系列Vol.21 步兵》模拟器
- ·《交易》— 步入权利与欲望的死亡陷阱
- ·《文学散步》
- ·全年龄段言情主义大作《步步惊心》实体书版(全本)
- ·《步非烟作品全集》
- ·与孙子兵法同步思考
- 特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作
- 者.文章版权归文章原始作者所有.对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转
- 载的文章有版权问题请联系编辑人员,我们尽快予以更正. 转载请注明来源:http://www.hackhome.com
精品推荐
热点TOP10
- ·图象处理中的边缘检测------canny算子
- ·EZ-USB 68013A开发指南
- ·数值计算程序大放送-特征值和特征向量
- ·ARM的嵌入式Linux移植体验之BootLoader
- ·Visual C++ ADO数据库编程入门
- ·智能手机Smartphone开发导语
- ·利用 wordXP 实现自动排班
- ·[分形]DLA团簇模型的摸拟
- ·DENX U-Boot及Linux使用手册
- ·Static和Final修饰类属性变量及初始化
- ·BPEL的异常管理
- ·看Vue 5 Esprit函数的节点与链接详情
- ·初学者全面接触学习jquery(译文)
- ·LinQ学习之旅 从整型数组中找出偶数
- ·Enterprise Library 快速入门
- ·CVS源代码库服务器建立和权限配置
- ·Visual FoxPro 9.0 SP2正式版下载
- ·VS2005控件的问题解决办法
- ·Cookie是什么?用法是怎样?与SESSION有什么区别?
- ·J2SE API读取Properties文件的六种方法
