Distance
Blitz3D Forums/Blitz3D Programming/Distance
| ||
I tried something different and it says memory access violation, but when I remove CheckBox() from the loop it works just fine. If you have maplet just use the test.b3d because this is basicly test with some more stuff. P.S. And also if you can make so it will display the right player for the won thing please do so. Or if you can get it to accept more players please do so. |
| ||
You don't need the "Distance" function, just use EntityDistance. |
| ||
Not sure if this'll help but why are you using approximate distances? you can replace all of this Function CheckBox() If Distance(Player,Box) < 2 Then RuntimeError Name$ + "Won!!!!!" EndIf End Function Function Distance(Entity1,Entity2) Entity1Pos = EntityZ(Entity1) + EntityY(Entity1) + EntityX(Entity1) Entity2Pos = EntityZ(Enitiy2) + EntityY(Entity2) + EntityX(Entity2) Return Entity1Pos - Entity2Pos End Function with .. Function CheckBox() If entityDistance(Player,Box) < 2 Then RuntimeError Name$ + "Won!!!!!" EndIf Also, instead of your resize mesh function just use FITMESH. Not sure if this'll help just thought I'd point out a few things |
| ||
How'd you get your code in that scroll box? |
| ||
(codebox) (/codebox) [] instead of () |
| ||
I didn't know there was an EntityDistance! Thanks |