> 1) I know im gonna have to use a list. And im not very good at them and
not sure how to use it.
---------------------------------------------

The director help menu will tell you all the commands you need
to know.

---------------------------------------------
> 2) because the map is on an angle not sure how to calculate its path.
---------------------------------------------

Well, you'll need to use trig.  For example, if you want to move forward
96 pixels, but "forward" is 45 degress to the upper right, then you would
use this formula:

        on move_car

        moveDistance=96

        newpos = sqrt((moveDistance*MoveDitance)/2)

        sprite(carSprite).loch = sprite(carsprite).loch + newpos
        sprite(carsprite).locv = sprite(carsprite).locv - newpos

        end move_car

---------------------------------------------
> It also has to know that it is not allowed to turn at certain sprites as
they might be buildings or something.
---------------------------------------------

        Examine the map square it is about to enter before moving the
car.  Assuming your map is static, and exists in one sprite, then have a
list that contains the coordinates that are offlimits.  Whenever the user
tries to move, it examinss the list to see if the coordinates that it is
trying to move into are offlimits.

        For example, say you have two lists.  One holds the x cordinates
that are off limits (the locH), and the other the corrasponding Y cords
(the locV).

        list_loch=(30, 60, 90)
        list_locV=(5, 35, 65)

        <use the newpos lines from above>

        Repeat with i = 1 to list_locH.count
        if list_locH[i] = (sprite(carsprite).locH + newpos) then

                if list_locV[i] = sprite(carsprite).locV - newpos) then
                        alert "you can't drive in the building!"
                end if

        else
                move_car
        end if
        end repeat


This could get very complex, as you would need to have the above code
(both move_car, and the building checker) for each direction you were
going to allow movement.  If you use a sprite for each tile of the map,
then you can just generate a single list that contains the sprite numbers
that are off limits.  That will make the building checker easier to code,
as you wil only need to check for a sprite number, rather than various
different cords.

HTH
-jason


[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to