arp绑定脚本:绑定HGE到AngelScript脚本系统



    有关脚本系统以前接触过GameMonkey当时感觉就是要结合进C处理类方面比较麻烦事实上大部分脚本语言要结合进C都存在这个问题后来知道了Angel Script稍微看了下文档发现其和C结合比较容易

    最近都在休息前天休息疯了就决定玩玩angel script后来突然就产生了把HGE和angel scrip结合起来想法也就是很多游戏引擎各类脚本wrappet的类东西就是通过些中间代码桥接使某个脚本语言也可以使用该引擎我所要做也就是在angel script脚本代码中也可以使用HGE来编写游戏

    看了些文档写了些实验代码就开始这个我认为比较有意思project整个过程还是比较顺利写到后来都是些体力活没什么意思

    封装了部分HGE接口用angel script重写了HGE第7个例子用来测试效率结果还算好效率比本地代码慢了几个FPS(绘制1000个zazaka)只是载入速度慢了点需要把脚本代码编译也许在发行时发行编译好字节码载入速度会快很多

    写好后整理了下API文档(即目前我封装了哪些HGE接口)就草草发到HGE官方论坛去了以下是我在HGE论坛发帖子:

    帖子原文:

    =postbody>Hi, all
i\'m glad that i can use hge engine to create games .Besides hge is an easybut powerful engine.

And yet AngelScript is also easy use script engine. It\'s a c-like script
language and it\'s very easy to embed o c native application .

And now i bind hge and AngelScript together . That means i wrapped some hge\'s functions es and you can write AngelScript to make your hge games.By using script language, your most convenient is you donot need compile your code and link your code like in c.

The most important thing is the speed, yes, i wrote hge tutorial 7(thousand of hares) in AngelScript (download below) and see what \'s the dference between them. The result _disibledevent=>http://blog.blogwhy.com/azjex/upload/ashge_demo_7.rar. And there is a file named apireference.txt that document the current api i wrapped. So you can change game.as whatever you want.

So, is there somebody erested in this project ? If somebody is erested in it i will continue this work, i mean continue to wrap more hge functions(es).

Best regards,
Kevin Lynx


=postbody>    DEMO演示下载(包含API文档):

=postbody>    http://blog.blogwhy.com/azjex/upload/ashge_demo_7.rar

=postbody>    比较有趣事是现在用HGE写游戏都不需要编译器了只需要例子可执行文件直接改game.as即可[Page]

Tags:  script脚本 angelscript angelscript arp绑定脚本

延伸阅读

最新评论

发表评论