Computer Science Canada Turing Painting and song Game |
Author: | DeTrueMan [ Fri Jan 19, 2018 9:21 am ] |
Post subject: | Turing Painting and song Game |
HI, I just created a CompSci.ca account and I was wondering if this group could help me with a program I'm tying to make on Turing. (I am very much a beginner) It is a game where you simulate retirement by painting a wall in random shapes and colors. you might also recognize some of the code. ![]() here it is; -------------------------------start of code------------------------------------- Quote: setscreen ("graphics;640;480,nocursor,offscreenonly")
var move : string (1) var x, dx, dy, y, c, x2, y2, s : int x := 100 y := 300 dx := 0 dy := 0 var playagain : string (1) put "welcome to retirement simulator" put "your job is to paint the walls" put " Use the aroow keys to paint" put "enter y to reset when you have won the game" process playstuff loop Music.Play ("8<d>>def+<a>f+edadef+<a>f+edgef+g<b>dc+<b>c+ef+g<a>gf+ef+def+<a>c+<bab>def+<b>ag+f+g+ef+g+<b>dc+<ba>c+de<f+>edc+d<b>c+d<f+ag+f+g+b>c+d<e>dc+<b>c+<ab>c+<egf+ef+ab>c+<f+>ed+c+d+<b>c+d+<f+agf+egabc+>dc+<ba+ef+gc+gf+edb>c+d<f+ag+f+>") Music.Play ("<e+g+abe+>dc+<b>g+e+f+g+c+bag+af+g+ac+ed+c+d+f+ga<b>agf+gef+g<b>dc<b>cd+ef+<a>c<ba><g>ef+g<b>dc+<b>c+ef+g<a>gf+ef+def+<a>c<babgabc+bagf+def+<a>c<bab>def+<b>ag+f+g+ef+g+<b>dc<ba>cde<a>gf+ed+<ab>c<f+>c<bag>ef+g<b>dc+<b><a+>c+de<a+>gf+e>c+<a+b>c+<f+>edc+") Music.Play ("d<b>c+d<f+ag+f+g+b>cd<e>dc<b> c<ab>c<egf+ef+ab>c<d>c<ba bgabdbag>d<gabdbag> c<ab>c<egf+ef+ab>c<d>c<ba bgabdf+edegabe>dc+<b> c+<ab>c+<egf+edf+ga<b>agf+ gef+g<b>dc+<b>c+ef+g<a>gf+ef+def+<a>f+edaf+gad>c<babgabdbag>d<b>c+d<g+>fed c+<ab>c+<egf+ea>def+<b>agf+") Music.Play ("gc+de<a>gf+ef+<b>c+d<g+>f+edc+<gab-egfef>defc+edc+db-agfedc+dfedbg+ab fdef<bg+abef+g+ab>c+de fc+d<ab-g>e<gaf>d<fge>c+<e 6<<a>dfg+b>dfg+b>1d6c+<bag+f+ef+g+ab>cdefedc+<bag+f+ed cegb->ceg2b-p 6<dfg+b>dfg+2bp 6<<<a>ea>ea1>d 6<<<a>g1 6a>ec+1c+ 6<<df+a>f+a>1d") Music.Play ("2a 4afa 2a 4gab >2c 4c<b>c<b 2b 4b>cd 2f 4ddd 2e 4d-d+<b 2a f4fa") Music.Play ("ab>-d#d 2e 4eefg2a 4aagf2a4a2e 4e 2d4de2f 4ed") Music.Play ("2c4cd2e 4dc <2b4b>-d2-e 2#e 2e4") Music.Play ("<#4fff 1-a 2ae4eaab>-d#d2e 4eef 2a 4aagf2a4a2e 4e 2d4de2f 4ed") Music.Play ("2c4cd2e 4dc <2b4b>-d2-e 2#e 2e4") View.Update end loop end playstuff fork playstuff loop randint (c, 3, 255) randint (x2, 11, 31) randint (y2, 11, 31) x := x + dx y := y + dy drawfilloval (x, y, x2, y2, c) View.Update getch (move) if move = KEY_DOWN_ARROW then dy := -3 dx := 0 elsif move = KEY_UP_ARROW then dy := 3 dx := 0 elsif move = KEY_RIGHT_ARROW then dx := 3 dy := 0 elsif move = KEY_LEFT_ARROW then dx := -3 dy := 0 end if getch (playagain) if playagain = "y" then cls put "congratulations!!!" drawbox (30, 30, 100, 100, black) drawbox (50, 30, 80, 60, brightred) drawbox (35, 70, 55, 90, green) drawline (45, 70, 45, 90, green) drawline (35, 80, 55, 80, green) drawbox (75, 70, 95, 90, green) drawline (85, 70, 85, 90, green) drawline (75, 80, 95, 80, green) drawline (30, 100, 65, 135, brightblue) drawline (65, 135, 100, 100, brightblue) drawline (90, 110, 90, 150, black) drawline (75, 125, 75, 150, black) drawline (75, 150, 90, 150, black) locate (maxrow, 2) put "Home sweet home" .. delay (13000) cls put "welcome to retirement simulator" put "your job is to paint the walls" put "enter y to reset when you have won the game" x := 100 y := 300 end if end loop ---------------------------------------end of code-------------------------------------------------- I you guys have any suggestions please fell free to help. or just enjoy the game.[/b] |
Author: | TokenHerbz [ Sat Jan 20, 2018 2:56 am ] |
Post subject: | RE:Turing Painting and song Game |
i cant move diangley (NW) for example. suggestion easy fix to create that ability. |
Author: | DeTrueMan [ Sun Jan 21, 2018 1:59 pm ] |
Post subject: | RE:Turing Painting and song Game |
TokenHerbz- I currently do not know how to do that. but, do you have any other suggestions for me? DeTrueMan |