Timer der skal trække point
Harjsa..Jeg er ved at lave et mindre program i director, hvor en timer skal trække et point fra ens score hvert 10. sekund. Hvordan gøres dette?
Min kode ser således ud, men den virker ikke:
on exitFrame me
global p
member("Point").text="Point:" && p
tim=the timer / (60*60*60)
minut=(the timer / (60*60)) mod 60
sec=(the timer / 60) mod 60
lort=(p - (1 / 30))
member("tekststreng").text="Tid:" && tim & "timer" && minut & "minutter" && sec & "sekunder"
if sprite(10).intersects(2) then go to "tv4-crash"
if sprite(10).intersects(11) and sprite(11).visible=true then p = p + 1
if sprite(10).intersects(12) and sprite(12).visible=true then p = p + 1
if sprite(10).intersects(13) and sprite(13).visible=true then p = p + 1
if sprite(10).intersects(14) and sprite(14).visible=true then p = p + 1
if sprite(10).intersects(15) and sprite(15).visible=true then p = p + 1
if the timer = 600 then p = p - 1
repeat with ii=11 to 15
sprite(ii).visible=sprite(ii).visible and not sprite(10).intersects(ii)
end repeat
if sprite(10).intersects(11) then member("point").text="Point:"
if sprite(10).intersects(3) then go to "wow"
go to the frame
end