include DXOpal Image.register(:ufo, 'images/ufo.png') Window.load_resources do img = Image[:ufo] startdeg = 0 Window.loop do # Window.draw_box_fill(0, 0, Window.width, Window.height, [0, 0, 0]) bx = 0 by = Window.height / 2 tx = Input.mouse_x ty = Input.mouse_y nmax = 32 dw = tx - bx dh = ty - by deg = startdeg h = 100 nmax.times do |i| x = bx + (dw * i / nmax) - img.width / 2 y = by + (dh * i / nmax) - img.height / 2 hh = h * i / nmax y += hh * Math.sin(deg * Math::PI / 180.0) Window.draw(x, y, img) deg += 15 end startdeg += 10 end end