Thread: Some angle help
View Single Post
  #17  
Old 10-31-2007, 06:18 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
This is what I used when I was messing around with a pong thing:
PHP Code:
this.velocity={random(-1,1),random(-1,1)};
x+=this.velocity[0];
y+=this.velocity[1];
if (
onwall(x+this.velocity[0],y+.5)) this.velocity[0]=this.velocity[0]*-1//Assuming the center is half a tile in
if (onwall(x+.5,y+this.velocity[1])) this.velocity[1]=this.velocity[1]*-1
Of course, this script itself isn't going to work, but you can see where I'm going with it.
Reply With Quote