MarchaPinguinos's Code

Created by: Leonel Morales

world

Events

When the world starts
Do:
world.LlamaTodo


Let move camera


While world.Caminar is true
Begin: Nothing
During:
world.WalkArray
End: Nothing


While world.Caminar is true
Begin: Nothing
During:
world.CheckNearCamera
End: Nothing


Methods

  world.EnlistaPinguinos ( [Obj]]]] LaLista)
    No variables
       insert penguin at end of LaLista duration = 0 seconds 
  insert penguin2 at end of LaLista duration = 0 seconds 
  insert penguin3 at end of LaLista duration = 0 seconds 
  insert penguin4 at end of LaLista duration = 0 seconds 
  insert penguin5 at end of LaLista duration = 0 seconds 
  insert penguin6 at end of LaLista duration = 0 seconds 
  insert penguin7 at end of LaLista duration = 0 seconds 
  insert penguin8 at end of LaLista duration = 0 seconds 
  insert penguin9 at end of LaLista duration = 0 seconds 
  insert penguin10 at end of LaLista duration = 0 seconds 
  insert penguin11 at end of LaLista duration = 0 seconds 
  insert penguin12 at end of LaLista duration = 0 seconds 
  insert penguin13 at end of LaLista duration = 0 seconds 
  insert penguin14 at end of LaLista duration = 0 seconds 
  insert penguin15 at end of LaLista duration = 0 seconds 
  insert penguin16 at end of LaLista duration = 0 seconds 
  insert penguin17 at end of LaLista duration = 0 seconds 
  insert penguin18 at end of LaLista duration = 0 seconds 
  insert penguin19 at end of LaLista duration = 0 seconds 


  world.AlineaPinguinos ( [Obj]]]] LaLista, [123] DuracionXPinguino)
    PrimerPinguino = <None> , Retrocede = 3 , RetroAcumulado = 0 , DuracionQuinto = 1
       PrimerPinguino set value to ( first item from LaLista ) duration = 0 seconds 
  DuracionQuinto set value to ( ( DuracionXPinguino / 5 ) ) duration = 0 seconds 
  RetroAcumulado set value to Retrocede duration = 0 seconds 
  For all LaLista , one item_from_LaLista at a time
       If ( item_from_LaLista != PrimerPinguino )
       item_from_LaLista turn to face PrimerPinguino duration = DuracionQuinto seconds 
  item_from_LaLista move ( item_from_LaLista distance to PrimerPinguino ) toward target = PrimerPinguino duration = DuracionQuinto seconds 
  item_from_LaLista orient to PrimerPinguino duration = DuracionQuinto seconds 
  item_from_LaLista move backward RetroAcumulado meters  duration = DuracionQuinto seconds 
  RetroAcumulado set value to ( ( RetroAcumulado + Retrocede ) ) duration = DuracionQuinto seconds 
  Else
  Do Nothing


  world.LlamaTodo ( )
    Caminar = false
       world.Walking X = -10 WhoWalks = penguin
  world.Glide WhoGlides = penguin
  world.UnGlide WhoGlides = penguin
  world.EnlistaPinguinos LaLista = world.ListaPinguinos
  world.SaltaPinguinos LaLista = world.ListaPinguinos
  world.AlineaPinguinos LaLista = world.ListaPinguinos DuracionXPinguino = 0.5
  world.SaltaPinguinos LaLista = world.ListaPinguinos
  world.Caminar set value to true


  world.SaltaPinguinos ( [Obj]]]] LaLista)
    No variables
       Do together
       world.DelayedJump DelayFactor = 1 WhoJumps = penguin Height = 1
  world.DelayedJump DelayFactor = 2 WhoJumps = penguin2 Height = 1
  world.DelayedJump DelayFactor = 3 WhoJumps = penguin3 Height = 1
  world.DelayedJump DelayFactor = 4 WhoJumps = penguin4 Height = 1
  world.DelayedJump DelayFactor = 5 WhoJumps = penguin5 Height = 1
  world.DelayedJump DelayFactor = 6 WhoJumps = penguin6 Height = 1
  world.DelayedJump DelayFactor = 7 WhoJumps = penguin7 Height = 1
  world.DelayedJump DelayFactor = 8 WhoJumps = penguin8 Height = 1
  world.DelayedJump DelayFactor = 9 WhoJumps = penguin9 Height = 1
  world.DelayedJump DelayFactor = 10 WhoJumps = penguin10 Height = 1
  world.DelayedJump DelayFactor = 11 WhoJumps = penguin11 Height = 1
  world.DelayedJump DelayFactor = 12 WhoJumps = penguin12 Height = 1
  world.DelayedJump DelayFactor = 13 WhoJumps = penguin13 Height = 1
  world.DelayedJump DelayFactor = 14 WhoJumps = penguin14 Height = 1
  world.DelayedJump DelayFactor = 15 WhoJumps = penguin15 Height = 1
  world.DelayedJump DelayFactor = 16 WhoJumps = penguin16 Height = 1
  world.DelayedJump DelayFactor = 17 WhoJumps = penguin17 Height = 1
  world.DelayedJump DelayFactor = 18 WhoJumps = penguin18 Height = 1
  world.DelayedJump DelayFactor = 19 WhoJumps = penguin19 Height = 1


  world.WingsFlap ( [123] Times, [Obj] WhoFlapsWings)
    No variables
       Loop Times times  time
       Do together
       ( WhoFlapsWings 's part named rightWing ) roll left 0.1 revolutions  duration = 0.25 seconds 
  ( WhoFlapsWings 's part named leftWing ) roll right 0.1 revolutions  duration = 0.25 seconds 
  Do together
       ( WhoFlapsWings 's part named rightWing ) roll right 0.1 revolutions  duration = 0.25 seconds 
  ( WhoFlapsWings 's part named leftWing ) roll left 0.1 revolutions  duration = 0.25 seconds 


  world.Jumping ( [Obj] WhoJumps, [123] height)
    No variables
       Do together
       WhoJumps move up height meters  duration = 0.5 seconds 
  ( ( WhoJumps 's part named rightLeg ) 's part named foot ) turn backward 0.1 revolutions  duration = 0.5 seconds 
  ( ( WhoJumps 's part named leftLeg ) 's part named foot ) turn backward 0.1 revolutions  duration = 0.5 seconds 
  Do together
       WhoJumps move down height meters  duration = 0.5 seconds  style = abruptly
  ( ( WhoJumps 's part named rightLeg ) 's part named foot ) turn forward 0.1 revolutions  duration = 0.5 seconds  style = abruptly
  ( ( WhoJumps 's part named leftLeg ) 's part named foot ) turn forward 0.1 revolutions  duration = 0.5 seconds  style = abruptly


  world.TurnHead ( [Obj] WhoTurnsHead, [T/F] ToRight, [123] TurnDuration)
    TurnDurationThird = 1
       TurnDurationThird set value to ( ( TurnDuration / 3 ) ) duration = false seconds 
  If ToRight
       ( WhoTurnsHead 's part named head ) turn right 0.2 revolutions  duration = TurnDurationThird seconds 
  Wait TurnDurationThird seconds 
  ( WhoTurnsHead 's part named head ) turn left 0.2 revolutions  duration = TurnDurationThird seconds 
  Else
    ( WhoTurnsHead 's part named head ) turn left 0.2 revolutions  duration = TurnDurationThird seconds 
  Wait TurnDurationThird seconds 
  ( WhoTurnsHead 's part named head ) turn right 0.2 revolutions  duration = TurnDurationThird seconds 


  world.Glide ( [Obj] WhoGlides)
    No variables
       WhoGlides move up 0.5 meters  duration = 0.25 seconds 
  Do together
       WhoGlides turn forward 0.25 revolutions  duration = 0.5 seconds 
  ( WhoGlides 's part named head ) turn backward 0.18 revolutions  duration = 0.5 seconds 
  Do together
       WhoGlides move up 5 meters 
  world.WingsFlap Times = 2 WhoFlapsWings = WhoGlides


  world.Jump ( [123] Times, [Obj] WhoJumps)
    No variables
       Loop Times times  time
       Do together
       world.WingsFlap Times = 2 WhoFlapsWings = WhoJumps
  world.Jumping WhoJumps = WhoJumps height = 1


  world.Walk ( [123] MoveTimes, [Obj] WhoWalks)
    Move = 0.05 , Speed = 0.25 , Tilt = 0.01
       Loop MoveTimes times  time
       Do together
       ( WhoWalks 's part named rightLeg ) turn forward Move revolutions  duration = Speed seconds 
  ( WhoWalks 's part named leftLeg ) turn backward Move revolutions  duration = Speed seconds 
  WhoWalks roll right Tilt revolutions  duration = Speed seconds  style = gently
  WhoWalks move down Tilt meters  duration = Speed seconds 
  Do together
       ( WhoWalks 's part named rightLeg ) turn backward Move revolutions  duration = Speed seconds 
  ( WhoWalks 's part named leftLeg ) turn forward Move revolutions  duration = Speed seconds 
  WhoWalks roll left Tilt revolutions  duration = Speed seconds  style = gently
  WhoWalks move up Tilt meters  duration = Speed seconds 
  Do in order
       Do together
       ( WhoWalks 's part named rightWing ) roll left Move revolutions  duration = 0.12 seconds 
  ( WhoWalks 's part named leftWing ) roll right Move revolutions  duration = 0.12 seconds 
  Do together
       ( WhoWalks 's part named leftWing ) roll left Move revolutions  duration = 0.12 seconds 
  ( WhoWalks 's part named rightWing ) roll right Move revolutions  duration = 0.12 seconds 
  Do together
       ( WhoWalks 's part named rightLeg ) turn forward Move revolutions  duration = Speed seconds 
  ( WhoWalks 's part named leftLeg ) turn backward Move revolutions  duration = Speed seconds 
  WhoWalks roll left Tilt revolutions  duration = Speed seconds  style = gently
  WhoWalks move down Tilt meters  duration = Speed seconds 
  Do together
       ( WhoWalks 's part named rightLeg ) turn backward Move revolutions  duration = Speed seconds 
  ( WhoWalks 's part named leftLeg ) turn forward Move revolutions  duration = Speed seconds 
  WhoWalks roll right Tilt revolutions  duration = Speed seconds  style = gently
  WhoWalks move up Tilt meters  duration = Speed seconds 


  world.Walking ( [123] X, [Obj] WhoWalks)
    No variables
       Do together
       WhoWalks move forward X meters  ( ( 2 * X ) ) style = gently
  world.Walk ( ( X * 2 ) ) WhoWalks = WhoWalks


  world.DelayedJump ( [123] DelayFactor, [Obj] WhoJumps, [123] Height)
    No variables
       Wait ( ( 0.25 * DelayFactor ) )
  Do together
       world.Jumping WhoJumps = WhoJumps height = Height
  world.WingsFlap Times = 2 WhoFlapsWings = WhoJumps
  Do in order
       world.TurnHead WhoTurnsHead = WhoJumps ToRight = true TurnDuration = 0.5
  world.TurnHead WhoTurnsHead = WhoJumps ToRight = false TurnDuration = 0.5


  world.CaminaPinguinos ( )
    No variables
       Do together
       world.Walk MoveTimes = 3 WhoWalks = penguin
  world.Walk MoveTimes = 3 WhoWalks = penguin2
  world.Walk MoveTimes = 3 WhoWalks = penguin3


  world.UnGlide ( [Obj] WhoGlides)
    No variables
       Do together
       WhoGlides turn backward 0.25 revolutions  duration = 0.5 seconds 
  ( WhoGlides 's part named head ) turn forward 0.18 revolutions  duration = 0.5 seconds 
  WhoGlides move down 0.5 meters  duration = 0.25 seconds 


  world.WalkArray ( )
    No variables
       For all world.ListaPinguinos , every item_from_ListaPinguinos together
       world.Walking X = 1 WhoWalks = item_from_ListaPinguinos


  world.CheckNearCamera ( )
    No variables
       print ( ( ( first item from world.ListaPinguinos ) distance to camera ) as a string )
  If ( ( ( first item from world.ListaPinguinos ) distance to camera ) < 3 )
       remove item from beginning of world.ListaPinguinos
  Else
  Do Nothing