`
icrwen
  • 浏览: 266596 次
  • 性别: 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学习:环境配置与扩展包导入详解 AndEngine是一款专为Android平台设计的开源游戏开发框架,因其高效、灵活以及丰富的功能而备受开发者青睐。本文将详细解析AndEngine的环境配置步骤以及如何导入其扩展...

    AndEngine游戏开发示例

    通过学习AndEngine游戏开发示例,开发者可以掌握2D游戏开发的基本技巧,包括场景构建、精灵动画、物理引擎应用以及用户交互处理。无论你是初学者还是有经验的开发者,都能从中获益,快速构建出自己的Android游戏。

    andengine2.0开发的小游戏

    通过分析源代码和阅读教程,学习者可以掌握AndEngine的基本用法,例如设置场景、添加实体、实现物理行为、处理用户输入和更新游戏逻辑。 总的来说,这个压缩包文件提供了一个很好的机会,让对AndEngine感兴趣的...

    andengine源码及demo

    AndEngine源码的分析和理解对于想要深入学习Android游戏开发的人来说至关重要。 1. **AndEngine基础** AndEngine的核心在于其强大的渲染引擎,它支持精灵(Sprites)、纹理(Textures)、纹理区域(Texture ...

    andEngine > 学习1

    《AndEngine > 学习1》 AndEngine是一款开源的Android游戏开发框架,它基于OpenGL ES 2.0,提供了一套简洁、高效的游戏开发接口,使得开发者可以快速地创建2D游戏。这个主题的学习主要涵盖了AndEngine的基本概念、...

    AndEngine下载

    3. **简单易学**:AndEngine的API设计简洁,学习曲线相对较平缓,开发者可以通过阅读官方文档和示例代码快速上手。 4. **社区支持**:AndEngine拥有活跃的开发者社区,开发者可以在论坛上交流经验,获取帮助,同时...

    Andengine的jar包

    Andengine是一款专为Android平台设计的游戏开发引擎,它基于OpenGL ES,提供了丰富的图形渲染和物理模拟功能,使得开发者能够快速创建2D游戏。Andengine的jar包是其核心库,包含了实现游戏逻辑、动画效果、碰撞检测...

    andengine 类代码组织图

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

    andengine 中文

    AndEngine是一款专为Android平台设计的游戏开发框架,它基于OpenGL ES 1.1或2.0,提供了一套高效、易用的2D游戏开发工具。这个“andengine 中文”压缩包包含的是AndEngine的中文文档,对于想要在Android上进行游戏...

    AndEngine 类 组织图

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

    AndEngine入门篇

    AndEngine是一款专为Android平台设计的游戏开发引擎,它简化了2D游戏的创建过程,让开发者无需深入理解底层图形库,就能快速构建游戏。...随着学习的深入,你将掌握更多高级特性和技巧,创造出更加精彩的游戏世界。

    AndEngine游戏引擎JAR文件

    AndEngine游戏引擎是一款高效、开源的Android游戏开发框架,它基于OpenGL ES,使得开发者可以直接进行图形硬件加速的游戏编程。这个框架极大地简化了Android平台上2D游戏的开发过程,提供了丰富的功能,让开发者能够...

    andengine案例,jar包

    7. **示例应用**:包含的两个案例apk是AndEngine功能的直观展示,通过分析和学习这些示例,开发者可以快速掌握AndEngine的使用方法。 8. **易于上手**:AndEngine的设计目标之一就是易用性,它提供了清晰的API文档...

    AndEngine的官网下载的Demo

    这个Demo是AndEngine官方网站提供的示例集合,用于帮助开发者更好地理解和学习如何使用AndEngine来构建游戏。以下是对AndEngine及其Demo的详细介绍: 1. **AndEngine特性**: - **跨平台**:虽然主要针对Android,...

    AndEngine最新jar包

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

    AndEngine最新Jar包

    通过分析和运行这些例子,开发者可以学习到如何创建游戏对象、实现动画、处理用户输入、应用物理效果以及管理游戏状态等。 总之,AndEngine是一个强大的工具,它提供了丰富的功能来帮助开发者构建高质量的2D游戏。...

    AndEngine 中文文档

    AndEngine的中文文档是开发者学习和掌握该引擎的重要资源,尤其对于非英语背景的开发者来说,中文文档能帮助他们更好地理解和应用AndEngine。 在AndEngine的中文文档中,你可以找到以下几个关键知识点: 1. **安装...

    AndEngine的jar包

    5. **活跃社区**:AndEngine拥有一个活跃的开发者社区,提供了丰富的教程和示例代码,便于学习和交流。 在使用AndEngine的jar包进行开发时,你需要了解以下几个关键知识点: **1. 安装与集成** - 将下载的...

    AndEngine游戏-DeliveryBoy-源代码

    《AndEngine游戏-DeliveryBoy-源代码》是一个用于学习AndEngine游戏开发的示例项目,其主要内容涵盖了AndEngine的基本使用、游戏逻辑构建以及资源管理等多个方面。AndEngine是一款流行的开源Android游戏开发引擎,它...

Global site tag (gtag.js) - Google Analytics