Ambiera ForumDiscussions, Help and Support. |
|
[ 1 2 ] Page 2 of 2 |
|
|||||
|
Very nice template..thanks for shareing. In file behavior_rtsGameController.js For the selection i added code for rectangle:To draw rectangle //all directions if (mX<=mouseX && mY<=mouseY ) { ccbDrawColoredRectangle(0x444BC050, mX, mY, mouseX, mouseY); } if (mX<=mouseX && mY>=mouseY ) { ccbDrawColoredRectangle(0x444BC050, mX, mouseY, mouseX, mY); } if (mX>=mouseX && mY<=mouseY ) { ccbDrawColoredRectangle(0x444BC050, mouseX, mY, mX, mouseY); } if (mX>=mouseX && mY>=mouseY ) { ccbDrawColoredRectangle(0x444BC050, mouseX, mouseY, mX,mY); } TO SELECT UNITS i added this.All directions. //if (this.isPointInside(point.x, point.y, mX, mY, mouseX, mouseY)) //if (this.isPointInside(point.x, point.y, mouseX, mouseY ,mX, mY)) //if (this.isPointInside(point.x, point.y, mX, mouseY, mouseX, mY)) //if (this.isPointInside(point.x, point.y, mouseX, mY ,mX, mouseY)) //////check2 if (this.isPointInside(point.x, point.y, mouseX, mouseY ,mX, mY)) { // select units ccbSetSceneNodeProperty(circle, 'Visible', true); // show property background if hidden ccbSetSceneNodeProperty(this.PropertyBackground, 'Visible', true); // check if there is other unit types within the selection rectangle than just worker var name = ccbGetSceneNodeProperty(this.SelectedUnit, 'Name'); if (name == "Army") hasarmy = true; // show the property image of the unit according to unit type this.showSelectedUnit(ccbGetSceneNodeProperty(this.SelectedUnit, 'Name')); } |
||||
|
Thanks. I have added some more controls of workers but could not update the files. I had an accident last year in August 28 and was in ICU for 8 days. Still recovering. I will post updates when I will recover. Regards |
||||
|
Great ! |
||||
|
Thanks for sharing, anyone tried using this for a full fledged rts game? |
[ 1 2 ] Page 2 of 2 |
|