Please specify what version of Turing you are using
not sure lol i guess the latest JUST NEED HELP please fix it for me step by step so i can learn from my mistakes!
Sponsor Sponsor
Nathan4102
Posted: Tue May 07, 2013 12:47 pm Post subject: RE:Need Help Asap
You need to call your process, simply creating it doesn't actually execute anything.
mirhagk
Posted: Tue May 07, 2013 1:06 pm Post subject: RE:Need Help Asap
The relevant term you want to look up in the help docs (you can use them from this site if your version doesn't have them working) is FORK.
btw to check your version in Turing (as well as nearly any program) go to help, then about. We don't necessarily need it for this question, but it's handy to have for questions.
Tony
Posted: Tue May 07, 2013 3:43 pm Post subject: Re: Need Help Asap
Ghostblade @ Tue May 07, 2013 12:13 pm wrote:
please fix it for me step by step so i can learn from my mistakes!
There is no learning from copying answers though. There _is_ learning if you are fixing those mistakes yourself (though our guidance could be beneficial here).
Among other problems, it would help you if you can explain how
Posted: Wed May 08, 2013 1:10 pm Post subject: RE:Need Help Asap
not sure i just added that hoping it would fix something but it didnt work out and btw what do you mean by "calling my process" nathan, im new to turing.
Nathan4102
Posted: Wed May 08, 2013 1:15 pm Post subject: RE:Need Help Asap
Font.Draw ( loadingMessage, 30, maxy div 2 + 40, loadingMessageFont, black )
% The actual bar and the percentage listed for it
Draw.FillBox (0, maxy div 2 + 15, maxx, maxy div 2 + 20, black )
Draw.FillBox (0, maxy div 2 - 15, maxx, maxy div 2 - 20, black )
Draw.FillBox (0, maxy div 2 - 15, round (maxx / 100 * loadPercent), maxy div 2 + 15, darkgrey)
Font.Draw ( intstr(loadPercent)+"%", maxx div 2 - 8, maxy div 2 - 8, loadingPercentFont, brightred )
exit when loadPercent >= 100
end loop
end loadGame
View.Set ("offscreenonly")
loadGame ()
%#################BACKGROUND################%
setscreen("graphics:max;max")
var font4 : int
var motorboat : int := Pic.FileNew ("motor boat.bmp")
var beach := Pic.FileNew ("beach.jpeg")
Pic.Draw (beach, 1, 50, picMerge)
process Boat
var posy1 :int:=200
var posx2 : int:= 200
Pic.Draw (motorboat,posx2,posy1,picMerge )
loop
posx2 := posx2-1
delay (100)
cls
end loop
end Boat
That is my entire code it works but only the boat doesnt show up??!!!?? ((
Nathan4102
Posted: Thu May 09, 2013 12:47 pm Post subject: RE:Need Help Asap
In your infinite loop, you change the coords, but never draw the boat. Also look into formatting your code a bit better. Give everything it's own procedure, and then your main loop will consist of procedure calls, much easier to read.
Ghostblade
Posted: Fri May 10, 2013 12:58 pm Post subject: RE:Need Help Asap
ok i got everything to work but one final problem ive encountered, my program ends too quickly and it flickers a bit. i want my boat to reach the end but it just ends expectantly
%############Loading Screen#############%
var loadPercent : int := 0
var loadingMessage : string := ""
Font.Draw ( loadingMessage, 30, maxy div 2 + 40, loadingMessageFont, black )
% The actual bar and the percentage listed for it
Draw.FillBox (0, maxy div 2 + 15, maxx, maxy div 2 + 20, black )
Draw.FillBox (0, maxy div 2 - 15, maxx, maxy div 2 - 20, black )
Draw.FillBox (0, maxy div 2 - 15, round (maxx / 100 * loadPercent), maxy div 2 + 15, darkgrey)
Font.Draw ( intstr(loadPercent)+"%", maxx div 2 - 8, maxy div 2 - 8, loadingPercentFont, brightred )
exit when loadPercent >= 100
end loop
end loadGame
loadGame
%####SETSCREEN###%
setscreen("graphics:max;max")
%#######BOAT MOVING + BACKGROUND#######%
var posy1 :int:=200
var posx2 : int:= 400
loop
var motorboat : int := Pic.FileNew ("motor boat.bmp")
Pic.Draw (motorboat,posx2,posy1,picMerge )
posx2 := posx2-1
delay (1)
var beach := Pic.FileNew ("beach.jpeg")
Pic.Draw (beach, 1, 50, picMerge)
end loop
cls
Nathan4102
Posted: Fri May 10, 2013 1:09 pm Post subject: RE:Need Help Asap
For the flickering, look into setscreen("offscreenonly") and View.Update. Try to declare all your variables at the top of the program, and NEVER declare them inside a loop, unless theres a reason you need to. What you're doing is loading the boat image every time the boat moves a pixel, which isn't needed.
Your cls should be inside the loop aswell, because you want to clear the screen every frame, not after all your frames have been drawn.
Ghostblade
Posted: Fri May 10, 2013 1:32 pm Post subject: RE:Need Help Asap
offscreenonly makes my whole screen white so its no good and it flickers like crazy when i put the cls inside the loop as for putting the var outside the loop, nothing changes it still ends randomly... ?
view.update isnt changing anything as i can see though.
Nathan4102
Posted: Fri May 10, 2013 1:38 pm Post subject: RE:Need Help Asap
You can't just call View.Set("offscreenonly") and expect it to solve all your problems. Read the "offscreenonly" section of http://compsci.ca/holtsoft/doc/view_set.html, it explains how to fix your flickering problem.
The variable thing isn't to fix your flickering, its to save memory. If you run that thing long enough, I'm pretty sure you'll fill all your RAM with those two images.
Ghostblade
Posted: Fri May 10, 2013 1:41 pm Post subject: RE:Need Help Asap