Retrogamecoding(.org) > Examples

Kurbis

(1/1)

Peter:
Hi,

A little bit fun with Kurbis.
if Kurbis isn't moved, he spins around the mouse cursor.

--- Code: ---




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()

--- End code ---

Cybermonkey:
Oh, I see your font is ready for EGSL 1.6.0  ;)

Bereb:
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))

Peter:
wait (10) is only for reducing of CPU power.
actually is not necessary, at all.

Navigation

[0] Message Index

Go to full version