Author Topic: Kurbis  (Read 2384 times)

Peter

  • Guest
Kurbis
« on: November 21, 2012, 02:25:09 PM »
Hi,

A little bit fun with Kurbis.
if Kurbis isn't moved, he spins around the mouse cursor.
Code: [Select]





local y,rot,vel,mx,my,v,dx,dy =0,0,0,0,0,0,0,0
local angle,dist,da,p1,p2,z,x =0,0,0,0,0,0,0

p1=loadimage("kurbis/kurbis.png")
p2=loadimage("kurbis/font32x.png")

repeat
k=getkey()
cls()
mx = mousex()
my = mousey()
dx = mx-x
dy = my-y
v=v+.4
if v>=1 then
   v=0
   z=z+1
   if z==16 then z=0 end
end
redraw()
wait (10)
until k==27
closewindow()
« Last Edit: January 27, 2013, 10:24:28 PM by Peter »

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: Kurbis
« Reply #1 on: November 21, 2012, 03:00:03 PM »
Oh, I see your font is ready for EGSL 1.6.0  ;)

Bereb

  • Guest
Re: Kurbis
« Reply #2 on: November 22, 2012, 04:39:43 PM »
I think you can use sync() instead of redraw(). Thus wait() after redraw() becomes unnecessary since you can manage speedness with setframetimer()  ;)
(I tried with setframetimer(25))
« Last Edit: November 22, 2012, 04:42:06 PM by Bereb »

Peter

  • Guest
Re: Kurbis
« Reply #3 on: November 22, 2012, 05:13:36 PM »
wait (10) is only for reducing of CPU power.
actually is not necessary, at all.
« Last Edit: November 22, 2012, 05:20:06 PM by Peter »