/    Sign up×
Community /Pin to ProfileBookmark

Attempting to find…

? Attempting to find program that deals with artillary. Give the bearing (degree) and fires over hill to hit a random target or drop object from plane traveling a speed then to land on target. Has anyone seen and can help lead me to it? Zillion thanks for help in this matter. ?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@MongusJul 06.2005 — This used to be a very popular type of game. We used to write them all the time! ?

It just takes a little physics and trigonometry. First you need to get the starting angle and velocity. Use cos and sin on the angle and multiply by velocity to get initial horizontal and vertical speeds respectively. Then if you have no wind, horizontal speed remains the same and you calculate vertical speed changing at 9.8m/s^2. Keep plotting till you hit something.

If you need more details than that I'm sure you can find lots of source code out there. Look for mortar or castles or even Microsoft's gorilla game that came with DOS.
×

Success!

Help @Boreas spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...