
-----------------------------------
pat1084
Tue Jan 13, 2009 5:54 pm

How to bounce a ball (oval) off a wall
-----------------------------------
I have a project due in a couple of days and i am trying to figure out how to make a ball move itself in a diagonal line, and when it hits a wall that it will be able to rebound back at the same angle that it hit the wall. i am completly new at turing and any help would be appreciated

-----------------------------------
saltpro15
Tue Jan 13, 2009 6:16 pm

Re: How to bounce a ball (oval) off a wall
-----------------------------------
here's some pseudo code to get you started

var velx, vely, posx, posy : int
if posx > maxx - 5 then
velx := -velx
elsif posx < 5
velx := -velx
end if


should be alone those lines to bounce it off walls
