• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

phoboslab/TwoPointFive: 3D View Plugin for the Impact HTML5 Game Engine

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

phoboslab/TwoPointFive

开源软件地址:

https://github.com/phoboslab/TwoPointFive

开源编程语言:

JavaScript 97.3%

开源软件介绍:

TwoPointFive for Impact

TwoPointFive is a plugin for the Impact HTML5 Game Engine that provides a 3D viewport for the game world.

Demo

Super Blob Blaster

A demo game that uses this plugin is included in this repository.

Please note that you need a license for Impact to actually run the demo. The lib/impact/ and lib/weltmeister/ directories from Impact need to be copied into the lib/ directory of this demo.

Usage

The demo game and its sources in lib/game/ should give you a good overview on how to use the plugin.

The most importantant thing for your entities is to subclass them from tpf.Entity rather than from ig.Entity. The tpf.Entity provides some capabilities to position and draw them in 3D space. Each entity has an additional .z property for .pos and .vel that determines its vertical position and speed in the world.

The layers in your level need to be named in a certain way for TwoPointFive to recognize them. The tile layers for the graphics need to be named floor, ceiling and walls. An additional light layer provides an additional tint for each of the tiles in the level. Note that the tilesize for each of these layers must be the same. Again, have a look a the included lib/game/levels/base1.js for an example.

TwoPointFive comes with some additions to Impact's Debug Module. To load it, simply require the plugins.twopointfive.debug module in your main.js.

A note about Tile Seams

Whenever drawing parts of an image in WebGL, such is done here when drawing tiles, WebGL may sample pixels from a region of the image that is outside the one you specified. This happens mostly due to rounding errors and will result in ugly seams between tiles.

TwoPointFive attempts to work around this issue by redrawing your tileset into a slightly larger image and adding a 1 pixel border around each tile. This 1px border is a copy of the neighboring pixels. Whenever WebGL now samples a texture slightly outside the tile boundary, it will sample from this 1px border and thus avoid any seams in your map.

If you do not want this behaviour, you can disable it by setting tpf.Map.fixTileSeams = false; before calling ig.main().




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
linghuye/C3Engine: C3 Game Engine发布时间:2022-06-07
下一篇:
RanvierMUD/neuro: Websocket MUD client for the Ranvier MUD game engine发布时间:2022-06-07
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap