
-----------------------------------
Ghostblade
Wed May 15, 2013 12:59 pm

need help to reduce flickering
-----------------------------------
What is it you are trying to achieve?
reduce flickering


What is the problem you are having?
flickering like a mofo


Describe what you have tried to solve this problem
added cls, view.update, offscreenonly all dont work when i try them.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)




%####SETSCREEN###%
setscreen("graphics:max;max")
View.Update

%#######VARS#######%
var posy1 :int:=200
var posx2 : int:= 400
var motorboat : int := Pic.FileNew ("motor boat.bmp")
var handwavex : int := maxx - 270
var handwavey : int := 265
var handwave : int := 5
var T : int := 14
var p, SunCount : int := 0

process boat
loop
cls
View.Update


    %%################ SUN ###############%
Draw.FillOval (300, 550, 85, 85, T)
    Draw.Oval (300, 550, 90, 90, T)
    Draw.Oval (300, 550, 97, 97, T)
    Draw.Oval (300, 550, 107, 107, T)

   if SunCount = 100 
        end loop 
    
    
end loadGame 


loadGame


%####SETSCREEN###%
setscreen("graphics:max;max")
View.Update
setscreen ("offscreenonly")
cls
%#######VARS#######%
var posy1 :int:=200
var posx2 : int:= 400
var motorboat : int := Pic.FileNew ("motor boat.bmp")
var handwavex : int := maxx - 270
var handwavey : int := 265
var handwave : int := 5
var newcolour : int := 205
var X, Y   : int := 700
var R1, R2 : int := 1    
var DX, DY : int := -1 

var A, B : int :=700
var C1, C2 : int :=1
var DA, DB : int :=-1

    %################ MOON ###############

    loop
    
loop
View.Update
Draw.FillOval (470,-20,900,200,66)
drawfillbox (0,425,maxx,120,9)
drawfillbox (0,800,maxx,400,104)

RGB.SetColor (newcolour, 0, 0, 53) 

for T : 44..68

Draw.FillOval (110,550,100,100, T)
Draw.FillOval (140,550,80,80,104)


newcolour -= RGB.AddColor (0, 0, 2) 


View.Update
delay (100)


end for
end loop


%####BOAT#####%


loop

Pic.Draw (motorboat,posx2,posy1,picMerge)
posx2 := posx2-1

delay (200)
end loop


View.Update

%#######PERSON#########%

loop

    drawfillbox (maxx - 200, 100, maxx - 250, 225, 2) %Top
    drawfilloval (maxx - 225, 225, 50, 50, 90) %Head
    Draw.ThickLine (maxx - 200, 170, maxx - 185, 125, 5, 7) %Left Arm
    drawfilloval (maxx - 245, 225, 5, 5, 7) %Left Eye
    drawfilloval (maxx - 205, 225, 5, 5, 7) %Right Eye
    drawarc (maxx - 225, 205, 5, 5, 180, 360, 7) %Smile
    drawarc (maxx - 220, 210, 5, 5, 180, 360, 7)
    drawarc (maxx - 230, 210, 5, 5, 180, 360, 7)
    Draw.ThickLine (maxx - 200, 100, maxx - 190, 50, 5, 7) %Left Leg
    Draw.ThickLine (maxx - 250, 100, maxx - 260, 50, 5, 7) %Right Leg
    
    delay (100)

    %######################Waving Arm####################%

    Draw.ThickLine (maxx - 250, 170, handwavex, handwavey, 5, 7)
    
   handwavex := handwavex - handwave

   handwavey := handwavey - handwave

if handwavex < maxx - 300 then
        handwave := -handwave

        elsif handwavex > maxx - 260 then
        handwave := -handwave
    
end if


end loop


%####SHOOTINGSTAR####%

loop

drawfilloval (X, Y, R1, R2, 31)
delay (2)
drawfilloval (X, Y, R1, R2, 31)
X := X + DX
Y := Y + DY
exit when X=400
end loop
delay (200)
loop
drawfilloval (A, B, C1, C2, 127)
delay (2)
drawfilloval (A, B, C1, C2, 127)
A :=A+DA
B :=B+DB
exit when A=400
end loop

end loop

-----------------------------------
DemonWasp
Fri May 17, 2013 1:56 pm

Re: RE:need help to reduce flickering
-----------------------------------
Is it possible to synchronize processes, tony?

Possible? Yes. You can use either Just use procedures.

Edit: had to fix up links because the forum doesn't seem to like apostrophes or brackets (') in URL entries.

-----------------------------------
Nathan4102
Fri May 17, 2013 3:04 pm

RE:need help to reduce flickering
-----------------------------------
@Demon, are you sure Turing uses a dedicated thread for forked music? I've made programs that run at 25% speed when music is playing, it's horrible!

@Ghost, could you put the code with indentation in turing syntax tags?

-----------------------------------
Tony
Fri May 17, 2013 3:12 pm

RE:need help to reduce flickering
-----------------------------------
One could also use a they don't really know what they are talking about.

-----------------------------------
DemonWasp
Fri May 17, 2013 9:03 pm

RE:need help to reduce flickering
-----------------------------------
No, I'm not sure that Turing uses a separate thread to play Music. It was just one of the most obvious reasons for Turing's process to be using 3-4 threads rather than 1.

@Tony: Huh, I didn't realize Turing had any concurrent/parallel constructs. Apparently they've got several, but it looks like most are only usable within a monitor. Still, not worth it.
