DNGunpla Posted July 18, 2018 Share Posted July 18, 2018 I am working on a game that requires me to find the height of the triangle and draw the line for it from whichever base I click on. But so far, I have been encountering this issue. This is the code I am using to get the height of of triangle. Quote triangleformula: function(x1,x2,y1,y2,l1){ midx = (x1 + x2)/2; midy = (y2 - y1)/2 + y1; linetest = this.game.add.graphics(0, 0); linetest.lineStyle(3, 0x000000); linetest.moveTo(l1.x+2, midy); linetest.lineTo(l1.x+2, l1.y); } It is based on using the coordinates of 2 points. Anyway to resolve this? Link to comment Share on other sites More sharing options...
Recommended Posts