Example
Filler
Example 0104: Filler
  1. -- Example: Filler 
  2.  
  3. angle = 0 
  4.  
  5. function load() 
  6.     image = love.graphics.newImage("images/love-ball.png", love.image_optimize) 
  7. end 
  8.  
  9. function update(dt) 
  10.     angle = angle + dt 
  11.     x, y = 400 + math.cos(angle)*100300 + math.sin(angle)*100 
  12. end 
  13.  
  14. function draw() 
  15.     local rot = angle*180/math.pi 
  16.     local sx = math.cos(angle)*3 
  17.     local sy = math.sin(angle)*2 
  18.     love.graphics.draw(image, x, y, rot, sx, sy) 
  19. end 
  20.  
  21.  
Copyright © 2006-2008 LÖVE Development Team.