Oxygen Basic

Programming => Problems & Solutions => Topic started by: Aurel on August 15, 2014, 06:46:03 AM

Title: Cannon ball ?
Post by: Aurel on August 15, 2014, 06:46:03 AM
Hi
I would like to know how plot cannon ball trajectory like is on picture.
i mean is there any simple formula for small program?
well i ask because i am so stupid for this mathematic things  :-\
thanks

.
Title: Re: Cannon ball ?
Post by: Charles Pegge on August 15, 2014, 07:01:52 AM
Hi Aurel,

To simulate gravity, apply a small constant decrement to the y velocity

for each animation frame:

if pos.y > 0
  pos.x += vel.x
  pos.y += vel.y
  vel.y   -= grav.y
else
  'landed!
  vel.x=0
  vel.y=0
end if
Title: Re: Cannon ball ?
Post by: Mike Lobanovsky on August 15, 2014, 07:10:09 AM
The World of Tanks on the horizon?

BTW WOT was created and is still being developed in Minsk, Belarus, actually in the same office building where my eldest son's office is located. :)
Title: Re: Cannon ball ?
Post by: Aurel on August 15, 2014, 07:53:50 AM
Quote
The World of Tanks on the horizon?

no Mike i just want calculate how to trow garbage into my neighbour backyard.. ;D ;D ;D

Charles
you can kill me if i understand anything ...and why UDT  ???