Avatar billede alpapa Nybegynder
29. maj 2002 - 10:12 Der er 3 kommentarer og
1 løsning

Hjælp til omskrivning af lingo

Hej alle.
Hvordan omskriver jeg dette stykke lingo så det bliver lidt mere overskueligt.

property t

on beginSprite me
t=0
end beginSprite me

on exitFrame me

if t = 5 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 10 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 15 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 20 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 25 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 30 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 35 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 40 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 45 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 50 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 55 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 60 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 65 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 70 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 75 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 80 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 85 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 90 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 95 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 100 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 105 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 110 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 115 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 120 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 125 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if   
   
if t = 130 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 135 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 140 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 145 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 150 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 155 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 160 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 165 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 170 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 175 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 180 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 185 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 190 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 195 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if
   
if t = 200 then
set the locV of sprite(2) to the locV of sprite(2) - 1
end if

t=t+1
 
end exitFrame me

alpapa
 
Avatar billede jmc Nybegynder
29. maj 2002 - 10:18 #1
repeat with t = 5 to 200
set the locV of sprite(2) to the locV of sprite(2) - 1
t=t+5
end repeat
Avatar billede alpapa Nybegynder
29. maj 2002 - 12:50 #2
t er nød til at forblive 1, ellers sker tingene for hurtigt :-(
Kan man ikke skrive alle tallene 5,10,15,20 osv. i en eller anden form for liste: myList=[5,10,15,20,25,30,35...]og når t=myList så
set the locV of sprite(2) to the locV of sprite(2) - 1 ???

alpapa
Avatar billede jmc Nybegynder
29. maj 2002 - 13:48 #3
yep, men hvad er det du vil?

  tallist = []
  repeat with t = 5 to 200
    add tallist t
    t=t+4
  end repeat

repeat with t = tallist[1] to tallist[count(talllist)]
set the locV of sprite(2) to the locV of sprite(2) - t
end repeat
Avatar billede alpapa Nybegynder
30. maj 2002 - 12:12 #4
Takker :-)
alpapa
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester