Computer Science Canada

I need help with my maze

Author:  g-uint [ Sat Apr 19, 2008 12:45 pm ]
Post subject:  I need help with my maze

hello,
I am new to this website and i thought you can help me. thank you.
I am doing turing and I would like you to help me out.

this is my code.


setscreen ('offscreenonly')
colorback (black)
cls
var xpoint : int := maxx - 15
var ypoint : int := maxy - 75
var colors : int := 218 % The color with the value of 218
var text : int := Font.New ("Times New Roman:25:Bold") % Makes a font and size and width in the variable text
var phrase : string
var key : array char of boolean


setscreen ('offscreenonly')
Input.Pause
colorback (white)
loop
cls
delay (10)
drawfilloval (xpoint, ypoint, 10, 10, brightred)
drawbox (0, 0, maxx, maxy, black)
drawfillbox (0, 0, 30, maxy, black)
drawfillbox (30, 0, maxx, 30, black)
drawfillbox (30, maxy - 30, 180, maxy, black)
drawfillbox (maxx - 30, 0, maxx, 310, black)
drawfillbox (maxx - 120, 250, maxx - 30, 280, black)
drawfillbox (maxx - 30, maxy - 60, maxx, maxy, black)
drawfillbox (maxx - 430, maxy - 30, maxx - 30, maxy, black)
drawfillbox (180, maxy - 30, 150, maxy - 120, black)
drawfillbox (120, maxy - 150, 300, maxy - 120, black)
drawfillbox (maxx - 400, maxy - 30, maxx - 430, maxy - 90, black)
drawfillbox (maxx - 400, maxy - 90, maxx - 60, maxy - 60, black)
drawfillbox (maxx - 280, maxy - 90, maxx - 310, maxy - 180, black)
drawfillbox (maxx - 280, maxy - 150, maxx - 150, maxy - 120, black)
drawfillbox (120, maxy - 60, 60, maxy - 90, black)
drawfillbox (90, maxy - 60, 60, maxy - 160, black)
drawfillbox (30, maxy - 190, 90, maxy - 160, black)
drawfillbox (maxx - 520, maxy - 210, maxx - 60, maxy - 180, black)
drawfillbox (120, 0, 150, 160, black)
drawfillbox (60, 130, 130, 160, black)
drawfillbox (60, 60, 90, 130, black)
drawfillbox (maxx - 120, maxy - 340, maxx - 90, maxy - 210, black)
drawfillbox (maxx - 60, maxy - 270, maxx - 30, maxy - 240, black)
drawfillbox (maxx - 90, maxy - 330, maxx - 60, maxy - 300, black)
drawfillbox (maxx - 180, maxy - 370, maxx - 150, maxy - 240, black)
drawfillbox (maxx - 210, maxy - 210, maxx - 240, maxy - 340, black)
drawfillbox (maxx - 330, maxy - 370, maxx - 300, maxy - 240, black)
drawfillbox (maxx - 300, maxy - 330, maxx - 270, maxy - 300, black)
drawfillbox (maxx - 240, maxy - 240, maxx - 270, maxy - 270, black)
drawfillbox (maxx - 460, maxy - 210, maxx - 430, maxy - 340, black)
drawfillbox (maxx - 430, maxy - 340, maxx - 360, maxy - 310, black)
drawfillbox (maxx - 390, maxy - 270, maxx - 330, maxy - 240, black)
Input.KeyDown (key)
if key (KEY_UP_ARROW) then %up arrow
if whatdotcolour (xpoint, ypoint + 10) not= black then
ypoint += 2
elsif whatdotcolour (xpoint, ypoint + 10) = black then
xpoint := maxx - 10
ypoint := maxy - 75
end if
elsif key (KEY_RIGHT_ARROW) then %right arrow
if whatdotcolour (xpoint + 10, ypoint) not= black then
xpoint += 2
elsif whatdotcolour (xpoint + 10, ypoint) = black then
xpoint := maxx - 10
ypoint := maxy - 75
end if

elsif key (KEY_LEFT_ARROW) then %left arrow
if whatdotcolour (xpoint - 10, ypoint) not= black then
xpoint -= 2
elsif whatdotcolour (xpoint - 10, ypoint) = black then
xpoint := maxx - 10
ypoint := maxy - 75
end if

elsif key (KEY_DOWN_ARROW) then %down arrow
if whatdotcolour (xpoint, ypoint - 10) not= black then
ypoint -= 2
elsif whatdotcolour (xpoint, ypoint - 10) = black then
xpoint := maxx - 10
ypoint := maxy - 75
end if


end if

View.Update
end loop



This is my problem. The thing is, that the ball is covered by the black block. when i am trying to go down or left or right and it touches the black block block , nothing happens, like it does not go back to the start.
I don't want the ball to be touching the black bar or going through it.
I hope you can if the problem. Thank you for your time. If you could sovle this you are a genius.

Author:  syntax_error [ Sat Apr 19, 2008 3:54 pm ]
Post subject:  RE:I need help with my maze

please use code tags then I can read your code with ease; however, form reading your problem at the bottom, I suggest you think boarders. Like how you have maxx and maxy think along the same lines for making them for the black bar, think about that.

Author:  Tallguy [ Tue Apr 22, 2008 11:26 am ]
Post subject:  RE:I need help with my maze

what r u using to set ur boarders for this?, its a good start though

Author:  petree08 [ Tue Apr 22, 2008 1:36 pm ]
Post subject:  RE:I need help with my maze

I thought it would be good for someone to point out that this is the submission section and not the turing help section.

Anyway, decent start, good luck

Author:  Tony [ Tue Apr 22, 2008 1:42 pm ]
Post subject:  Re: RE:I need help with my maze

petree08 @ Tue Apr 22, 2008 1:36 pm wrote:
I thought it would be good for someone to point out that this is the submission section and not the turing help section.

done.

Author:  Prince Pwn [ Tue Apr 22, 2008 2:11 pm ]
Post subject:  RE:I need help with my maze

Game runs fine for me.

Author:  isaiahk9 [ Fri May 09, 2008 3:37 pm ]
Post subject:  RE:I need help with my maze

what's wrong with it? same as Prince Pwn

Author:  rose1997 [ Tue May 26, 2009 4:22 pm ]
Post subject:  RE:I need help with my maze

ok this is my problem. i want to build a maze but i dont know how????? Can you help me with it plzz.
thanks


: