android - Drawing line of sight between two actors -
i fresh learner of libgdx. trying learn libgdx developing demo game. in game when army , enemy visible each other want draw line of sight between them prove see each other. line of sight should increase gradually, when transfer file in windows 7 green portion increases gradually. working scene2d , have implemented screen interface of scene2d.
i have developed game using andengine , have used andengine box2d physics , update position between 2 players continuously follows: have 2 players 1 player , other enemy. have drawn line , end position of line given player , enemy positions. have done getting coordinates
//line of sight final line e1line = new line(player.getx(), player.gety(), enemy.getx(), enemy.gety())
and have used update handler continusely move line player moves follows:
iupdatehandler updatehand = new iupdatehandler(){ @override public void onupdate(float psecondselapsed) { // line of sight , notifier update e1line.setposition(player.getx(), player.gety(), enemy1.getx(), enemy1.gety()); } @override public void reset() {} };
Comments
Post a Comment