Re: How to do a 3d movement in bgt?

You'll probably also want a way to check if there is something around that set of coords.
You can do that by doing this
if(power((targetX-tempa), 2)+power((targetY-tempb), 2)<=100)
This code takes the coords you got from the formula above and takes the target coords and checks the distance, if it's less than 10 tiles from the test coords, then it executes the code within the if statement.
If you are unsure how to get the target coords, you'll want to have an array of the objects on your map handy, then run it through a forloop, so it looks something like this.
for(int x<0; x<objects.length; x++)
{
if(power((objects[x].targetX-tempa), 2)+power((objects[x].targetY-tempb), 2)<=100)
{
//monipulation code goes here.
}
}
If you want to change the area in which it checks to something like 20 tiles from the point you want, just change the 100 to whatever the radius of the circle you want times 2, so in this case it would be uh, 400.

_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : vlad25 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Aprone via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : sneak via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : sneak via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : sneak via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : sneak via Audiogames-reflector

Reply via email to