Re: LZ: Programming question
[Prev][Next][Index][Thread]
In a message dated 96-10-14 08:47:29 EDT, cjo@pobox.com (C.J. Oster) writes:
<< >I got a question or two if someone can answer id appreciate it...
>1) If i know i am shooting a ball at a 15 degree angle (or any other
specific
>degree) how can i find the slope or path that the ball will follow?
>
>2) If i was to try to make pac-man how would be the best (easy) way to
setup
>the levels? (walls) so that the program knows where they are?
>
>Thanx ....
Here's how I'd do it, but don't take my word for it....
Ok to find the slope, use trig...
/|
/-|
B /--| Y
/---|
/----|
A /-----|
X
If you know x, and your angle is A, then you say B = X cos A, if you know
y, then you say B = Y sin A.
As for the walls, generate them however you want to, you can do it
randomly, or use a set of 3 or 5 bitmapped levels, and cycle through them.
To find out where they are, I'd test the space in front of pacman to see if
there is a wall. Just test the vram for a black square.
I don't mind helping you out, but do your own programming...
-C.J.- >>
C'mon man, go easy on the guy. He's just looking for advice, not trying to
get you to write his program.
Later,
~Steve~
References: