`
icrwen
  • 浏览: 263015 次
  • 性别: Icon_minigender_2
  • 来自: 济南
社区版块
存档分类
最新评论

andengine学习笔记

阅读更多

非常有道理的一篇文章

http://papermashup.com/steps-to-learning-a-new-programming-language/

 

BaseGameActivity:
The BaseGameActivity is the root of a game, that contains an Engine and manages to create a SurfaceView the contents of the Engine will be drawn into. There is always exactly one Engine for one BaseGameActivity. You can proceed from one BaseGameActivity to another using common Android mechanisms.

BaseGameActivety是游戏的根,包含一个引擎和负责生成画图的视图,如果您想正常使用AndEngine,那么当前Activity就必须继承自BaseGameActivity或其子类,否则你连初始化Engine也做不到。虽然它还有父类BaseActivity,但BaseActivity只提供了一些异步加载方法而无关AndEngine的主体实现。因此,BaseGameActivity就是实际上的AndEngine最基础用类无疑。


Engine:
The Engine make the game proceed in small discrete steps of time. The Engine manages to synchronize a periodic drawing and updating of the Scene, which contains all the content that your game is currently handling actively. There usually is one Scene per Engine, except for the SplitScreenEngines.

引擎使游戏处理时间,引擎管理同步

 



IResolutionPolicy:
An implementation of the IResolutionPolicy interface is part of the EngineOptions. It tells AndEngine how to deal with the different screen-sizes of different devices. I.e. RatioResolutionPolicy will maximize the SurfaceView to the limiting size of the screen, while keeping a specific ratio. That means objects won't be distorted while the SurfaceView has the maximum size possible.

Camera:
A Camera defines the rectangle of the scene that is drawn on the screen, as not the whole scene is visible all the time. Usually there is one Camera per Scene, except for the SplitScreenEngines. There are subclasses that allow zooming and smooth position changes of the Camera.


Scene:
The Scene class is the root container for all objects to be drawn on the screen. A Scene has a specific amount of Layers, which themselves can contain a (fixed or dynamic) amount of Entities. There are subclasses, like the CameraScene/HUD/MenuScene that are drawing themselves to the same position of the Scene no matter where the camera is positioned to.

Entity:
An Entitiy is an object that can be drawn, like Sprites, Rectangles, Text or Lines. An Entity has a position/rotation/scale/color/etc...

Texture:
A Texture is a 'image' in the memory of the graphics chip. On Android the width and height of a Texture has to be a power of 2. Therefore AndEngine assembles a Texture from a couple of ITextureSources, so the space can be used better.

ITextureSource:
An implmentation of the ITextureSource-interface like AssetTextureSource manages to load an image onto a specific position in the Texture.

TextureRegion:
A TextureRegion defines a rectangle on the Texture. A TextureRegion is used by Sprites to let the system know what part of the big Texture the Sprite is showing.

PhysicsConnector:
A PhysicsConnector manages to update the AndEngine-Shapes (like Rectangles/Sprites/etc...) when their physics representations "bodies" change. Once using Physics (and a PhysicsConnector) with an AndEngine-Shape you'd disable the Physics calculated by AndEngine itself, by calling setUpdatePhysics(false) to the Shape. Changes made to the AndEngine-Shape are not reflected in the Physics - you have to call the methods on the Body object you have used to create the PhysicsConnector

  • andengine的动画是更加纹理区域大小(Textture)和纹理区域的帧数设置数目createTiledFromAsset(行数和列数)然后来确定每帧的范围,所以在做sprite的动画时要算好每帧的尺寸,
  • .assets和res资源的不同: 在assets中保存的文件一般是原生的文件,通常很少用到,例如一个MP3文件,Android程序不能直接访问,必须通过AssetManager类以二进制流的形式来读取。而Res文件夹中的资源可以通过R资源类直接访问,经常使用。同样在res文件夹下还有一个文件夹raw也是用来存放原生文件的。
  •     在android中使用Asset或者res/raw时都要经过Asset Manager,使用这两种资源提供方式时,必须要注意文件大小。经过调试发 现,Asset或者res/raw中的资源文件的UNCOMPRESS_DATA_MAX取值为1048576字节,也就是最大为未压缩1MB。否则会在logcat下看到获取到Debug类型的信息,04-09 02:48:51.220: DEBUG/asset(10734): Data exceeds UNCOMPRESS_DATA_MAX (1905341 vs 1048576)可以看到接下产生了一个系统的错误,System.err,会发生java.io.IOException的异常






分享到:
评论

相关推荐

    Andengine笔记

    AndEngine基于libGDX框架开发,使用OpenGL ES进行图形绘制,底层使用C++编写,通过JNI调用来实现,因此比较高效,功能强大。同时集成了Box2D物理引擎,因此能实现一些较为复杂的物理效果。在Rokon(另一个Android 2D游戏...

    AndEngine学习

    AndEngine学习.docx

    AndEngine下载

    AndEngine下载 AndEngine

    andengine 类代码组织图

     AndEngine是一个开源项目。这使得开发者在遇到问题时可以直接从源码上找到答案,也能按照自己的需要对AndEngine进行修改和扩展。AndEngine的源码在github上托管[2]。 高效  AndEngine主要使用Java语言开发,但在...

    AndEngine 类 组织图

     AndEngine是一个开源项目。这使得开发者在遇到问题时可以直接从源码上找到答案,也能按照自己的需要对AndEngine进行修改和扩展。AndEngine的源码在github上托管[2]。 高效  AndEngine主要使用Java语言开发,但在...

    android andengine 代码 AnimatedSprite 实例

    android andengine 代码 AnimatedSprite 实例 大家一起学习android andengine 游戏开发吧

    andengine2.0开发的小游戏

    利用andengine2.0开发的一款小游戏,有兴趣的朋友可以研究下。

    AndEngine最新jar包

    AndEngine最新jar包 AndEngine最新jar包 AndEngine最新jar包

    andengine 中文

    andengine 中文文档

    andengine源码及demo

    andengine源码,源码扩展及demo,供14个project

    AndEngine入门篇

    AndEngine游戏引擎学习入门篇,如果你想学习Android游戏开发,请从这里开始!详细的注释

    AndEngine游戏开发示例

    AndEngine游戏开发示例 详情请链接至:http://blog.csdn.net/lan410812571/article/details/9716743

    Andengine全套git库

    Andengine全套的git库,包括 AndEngineAugmentedRealityExtension AndEngineLiveWallpaperExtension AndEngineMODPlayerExtension AndEngineMultiplayerExtension AndEngineMultiTouchExtension (Merged into the '...

    AndEngine自定义Button

    AndEngine实现自定义Button

    AndEngine 经典实例

    最新的AndEngine官方实例, 国内可能下载不了,共享供大家学习使用。

    andengine案例,jar包

    andengine.jar 2013最新,andengine+8个拓展jar包,两个案例apk. 包括andengineExample基于GLES2

    AndEngine游戏-DeliveryBoy-源代码

    AndEngine游戏 DeliveryBoy 源代码,可以用来做AndEngine游戏实例教程进行参考

    Andengine的jar包

    里面包含andengine.jar以及附属的8个jar扩展

    捕鱼海底捞andengine源代码

    andengine android 游戏 源代码 共享

    AndEngine的jar包

    Android开发中正确的AndEngine的jar包

Global site tag (gtag.js) - Google Analytics