Re: LZ: Programming question
[Prev][Next][Index][Thread]
>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.-
********************************************************************
Unsolicited commercial e-mail to the poster of this message
will be proofread at $70/hr, minimum charge $150. Submission
of such e-mail to this address will suffice as contractual assent
to the said charging schedule.
********************************************************************
References: