Author |
Message |
shruti
|
Posted: Sat May 10, 2008 3:04 pm Post subject: Maze help |
|
|
i am making a maze for the final project. i did all other stuff but i dont know how to not let the user go through the lines. plzz help me or give me hints on how to do it ..plzzzzzzz
thanks |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
TheGuardian001
|
Posted: Sat May 10, 2008 3:24 pm Post subject: Re: Maze help |
|
|
the easiest way to do it would be with View.WhatDotColour, although im sure theres a more efficient way.
if you use View.WhatDotColour, you would just add it into your move buttons if lines.
eg:
if keys(KEY_LEFT_ARROW) and View.WhatDotColour(x-1,y) = backgroundcolour then
do this
end if |
|
|
|
|
 |
isaiahk9

|
Posted: Sat May 10, 2008 3:24 pm Post subject: RE:Maze help |
|
|
You can either hardcode it ;
If the player's x,y position is in the x,y coordinates of the walls, then the player is re-drawn outside of the wall.
Or you can soft-code it. This works relatively well when not using gravity in your game :
If View.WhatDotColor (characterx, charactery) = colorofwall then
re-draw character outside of walls |
|
|
|
|
 |
rose1997
|
Posted: Tue May 26, 2009 4:17 pm Post subject: RE:Maze help |
|
|
That helped me a little. but i also want to have the formula for it. can you show me the formula so i can understand it better.
plzzzz
ok thanks |
|
|
|
|
 |
Siavash
|
Posted: Tue May 26, 2009 9:40 pm Post subject: RE:Maze help |
|
|
you can use the whatdotcolor comand for maze and check for cordinates when at the end of the maze. good luck |
|
|
|
|
 |
|