Computer Science Canada Turing Game need help! |
Author: | ssks1012 [ Wed Jun 06, 2012 7:25 am ] |
Post subject: | Turing Game need help! |
Hi i have made this game and noticed that the game needs more improvement to be. as you open the file, if you start to play the game the ball passes through the blocks. please, i want to fix it. i want the ball whips back as it hits a block and the block will be diappeared. and you have an idea to put some more additions, please tell me!!! Please help me!!!! guys i need help plz send to me my e-mail my e-mail is gksgml1012@daum.net help me plz;; this is my code var x, y : int var x1, y1 : int var move : string (1) const movement := 22 const dist := 5 var xx := 100 var yy := 15 x := 200 y := 0 x1 := 310 y1 := 20 var ballx, bally, xmod, ymod : int := 300 xmod := 1 ymod := 1 drawfillbox (10, 363, 70, 380, black) drawfillbox (80, 363, 140, 380, black) drawfillbox (150, 363, 210, 380, black) drawfillbox (220, 363, 280, 380, black) drawfillbox (290, 363, 350, 380, black) drawfillbox (360, 363, 420, 380, black) drawfillbox (430, 363, 490, 380, black) drawfillbox (500, 363, 560, 380, black) drawfillbox (570, 363, 630, 380, black) drawfillbox (10, 333, 70, 350, black) drawfillbox (80, 333, 140, 350, black) drawfillbox (150, 333, 210, 350, black) drawfillbox (220, 333, 280, 350, black) drawfillbox (290, 333, 350, 350, black) drawfillbox (360, 333, 420, 350, black) drawfillbox (430, 333, 490, 350, black) drawfillbox (500, 333, 560, 350, black) drawfillbox (570, 333, 630, 350, black) drawfillbox (10, 303, 70, 320, black) drawfillbox (80, 303, 140, 320, black) drawfillbox (150, 303, 210, 320, black) drawfillbox (220, 303, 280, 320, black) drawfillbox (290, 303, 350, 320, black) drawfillbox (360, 303, 420, 320, black) drawfillbox (430, 303, 490, 320, black) drawfillbox (500, 303, 560, 320, black) drawfillbox (570, 303, 630, 320, black) drawfillbox (10, 273, 70, 290, black) drawfillbox (80, 273, 140, 290, black) drawfillbox (150, 273, 210, 290, black) drawfillbox (220, 273, 280, 290, black) drawfillbox (290, 273, 350, 290, black) drawfillbox (360, 273, 420, 290, black) drawfillbox (430, 273, 490, 290, black) drawfillbox (500, 273, 560, 290, black) drawfillbox (570, 273, 630, 290, black) drawfillbox (10, 243, 70, 260, black) drawfillbox (80, 243, 140, 260, black) drawfillbox (150, 243, 210, 260, black) drawfillbox (430, 243, 490, 260, black) drawfillbox (500, 243, 560, 260, black) drawfillbox (570, 243, 630, 260, black) loop if hasch then getch (move); %Get Input if move = chr (203) and x > 5 then drawfillbox (x, y, x1, y1, 0) x := x - 7 x1 := x1 - 7 elsif move = chr (205) and x < 520 then drawfilloval (x, y, x1, y1, 0) x := x + 7 x1 := x1 + 7 end if end if ballx += xmod bally += ymod if ballx + 10 >= maxx then xmod := -1 elsif ballx - 10 <= 0 then xmod := 1 end if if bally + 10 >= maxy then ymod := -1 elsif bally - 10 <= 0 then ymod := 1 end if drawfillbox (x, y, x1, y1, black) drawfilloval (ballx, bally, 10, 10, 12) delay (8) drawfilloval (ballx, bally, 10, 10, 0) end loop help me TT I CANT FIND WHATS WRONG tt |
Author: | Amarylis [ Wed Jun 06, 2012 8:24 am ] | ||
Post subject: | RE:Turing Game need help! | ||
First, let me introduce you to the syntax forum code, it'll make it easier for you to read code in forums in the future:
Now, as for the ball hitting the block and bouncing off, have you read into collisions? If not, just hold on a second and I'll edit in a link Edit: I couldn't find the link, so I'll just give a brief summary. You have to write some code that will change the direction of the moving objects if any of their x and y positions are the same as any of the x and y positions of another object. |
Author: | Aange10 [ Wed Jun 06, 2012 3:03 pm ] |
Post subject: | RE:Turing Game need help! |
http://compsci.ca/v3/viewtopic.php?t=13661 |
Author: | IshiggyDiggy [ Mon Dec 10, 2012 9:57 am ] |
Post subject: | RE:Turing Game need help! |
Can someone give me the code to just move the block by itself with nothing else on the screen. |
Author: | Insectoid [ Mon Dec 10, 2012 4:52 pm ] |
Post subject: | RE:Turing Game need help! |
Nope. We don't do your work for you. |