Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 I need help with my maze
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
g-uint




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
syntax_error




PostPosted: 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.
Tallguy




PostPosted: 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
petree08




PostPosted: 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
Tony




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Prince Pwn




PostPosted: Tue Apr 22, 2008 2:11 pm   Post subject: RE:I need help with my maze

Game runs fine for me.
isaiahk9




PostPosted: 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
rose1997




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: