简体   繁体   English

Libgdx Platformer 2d开始添加敌人

[英]Libgdx Platformer 2d beginning adding enemies

I have read The guide to implementing 2D platformers http://higherorderfun.com/blog/2012/05/20/the-guide-to-implementing-2d-platformers/ 我已经阅读了实施2D平台程序的指南http://higherorderfun.com/blog/2012/05/20/the-guide-to-implementing-2d-platformers/

I want to develop the second way (Type #2: Tile Based (Smooth)) Collision is still determined by a tilemap, but characters can move freely around the world. 我想开发第二种方法(类型2:基于图块(平滑))碰撞仍然由图块地图确定,但是角色可以在世界各地自由移动。

I have made a class Enemy with position and velocity. 我做了一个位置和速度都很高的班级敌人。

How could I move the Enemy in the world when it is not visible in the screen yet? 当屏幕上还看不到敌人时,我该如何移动敌人? There is any GitHub example of this issue? 有这个问题的GitHub示例吗?

I am not using Box2D. 我没有使用Box2D。 I have started with the Super Koalio Example: https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests/src/com/badlogic/gdx/tests/superkoalio/SuperKoalio.java 我从超级Koalio示例开始: https : //github.com/libgdx/libgdx/blob/master/tests/gdx-tests/src/com/badlogic/gdx/tests/superkoalio/SuperKoalio.java

我有关渲染的问题已使用OrthogonalTiledMapRenderer解决

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM