Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. blanc = Color.create(255,255,255)
  2. y_ligne = 100
  3. x_ligne = 55
  4. compteur = 0
  5.  
  6.  
  7. function ligne(x,y,color)
  8.  
  9.      g2d.BeginLines(g2d.STRIP)
  10.          g2d.SetColor(color)
  11.          g2d.SetCoordXY(x, y)
  12.          g2d.Add()
  13.                
  14.          g2d.SetCoordXYRelative(x_ligne, y_ligne)
  15.          g2d.Add()
  16.      g2d.End()
  17.  
  18. end
  19.  
  20.  
  21. while true do
  22.      g2d.Clear()
  23.      
  24.      pad = Ctrl.read()
  25.      
  26.      ligne(65,120,blanc)
  27.      
  28.          if compteur == 0 and y_ligne > 40 then
  29.              y_ligne = y_ligne-2
  30.              x_ligne = x_ligne-2
  31.          end
  32.          if y_ligne == 40 then compteur = 1 end
  33.          if compteur == 1 and y_ligne < 100 then
  34.              y_ligne = y_ligne+2
  35.              x_ligne = x_ligne+2
  36.          end
  37.      
  38.      
  39.      g2d.Flip()
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement