Computer Science Canada

Help with my game program please....blinking problem, and music problem

Author:  GrimGreg [ Sun Feb 18, 2007 10:16 pm ]
Post subject:  Help with my game program please....blinking problem, and music problem

Please help me.
i am somewhat new to turing, but usually pretty good with computers. this is the code i have done so far. the music isnt playing for some reason, and yes im sure the parameters are correct....i also have a problem with the screen blinking, and stripes going across the screen. please let me know how i can fix it. thank you! Very Happy Canada

[Code]


import GUI
var x,y : int
x:=308
y:=215
var chars : array char of boolean




process trogdor
Music.PlayFile ("C:/Trogdor")
end trogdor
%Procedure of Trogdor Music




process circle
for a : 40 .. 1000
drawfilloval (a , 40, 40,40, red)
delay (10)
cls
if a = 1000 then
for decreasing b : 1000..40
delay(10)
cls
drawfilloval (b , 40, 40,40, red)
end for
end if
end for
end circle
procedure game

loop
Input.KeyDown (chars)

if chars (KEY_UP_ARROW) then
y:=y+5
end if
if chars (KEY_RIGHT_ARROW) then
x:=x+5
end if
if chars (KEY_LEFT_ARROW) then
x:=x-5
end if
if chars (KEY_DOWN_ARROW) then
y:=y-5
end if
drawfillbox (x, y, x+25, y+25, blue)
delay(10)
cls

fork circle
end loop
end game

%Procedure of game


fork trogdor

drawfillbox (0, 0, 640, 480, black)
Text.LocateXY (x-100, y)
Text.Color (white)
Text.ColorBack (black)
put "Squares Game, Made by Greg"
var button1:int:=GUI.CreateButton(x-50,y-100,0,"Click here to start!",game)
%Title Page and button



loop
exit when GUI.ProcessEvent
end loop

[Code]

Author:  Clayton [ Mon Feb 19, 2007 12:21 am ]
Post subject:  Re: Help with my game program please....blinking problem, and music problem

I suggest you read up on View.Set and View.Update in the Turing Walkthrough. Also, your music parameters are not correct. You have forgotten to put the music file's extension after the filename (ie. example.mp3 or foo.mid etc)

Author:  GrimGreg [ Mon Feb 19, 2007 7:29 am ]
Post subject:  Re: Help with my game program please....blinking problem, and music problem

Thanks a lot! i needed a step in the right direction


: