// How fast does this go? Does UDP try to slow it down, or does
// You can join multiple groups here
// this cause network problems? (hint: yes for an unlimited send
// rate, unlike TCP). How do you know on the receiving side
// that you haven't received a duplicate UDP packet, out of
// How fast does this go? Does UDP try to slow it down, or does
// order packet, or dropped packet?
// this cause network problems? (hint: yes for an unlimited send
// rate, unlike TCP). How do you know on the receiving side
for(intidx=0;idx<100;idx++)
// that you haven't received a duplicate UDP packet, out of
{
// order packet, or dropped packet?
xPos=xPos+(Math.cos(Math.toRadians(direction))*velocity);//computes the horixontal displacement for each movement based on velocity - this is a fixed velocity and time increment
for(intidx=0;idx<100;idx++)
yPos=yPos+(Math.sin(Math.toRadians(direction))*velocity);//computes the vertical displacement for each movement based on velocity - this is a fixed velocity and time increment
xPos=xPos+(Math.cos(Math.toRadians(direction))*velocity);//computes the horixontal displacement for each movement based on velocity - this is a fixed velocity and time increment
DataOutputStreamdos=newDataOutputStream(baos);
yPos=yPos+(Math.sin(Math.toRadians(direction))*velocity);//computes the vertical displacement for each movement based on velocity - this is a fixed velocity and time increment