Latest OxygenBasic.zip at GitHub (Click on the Wizard)
0 Members and 1 Guest are viewing this topic.
' Peter's Lifetimeimport japi.basdeclare sub dllsecs alias "dllsecs" lib "DLLC"' j_setdebug(4)j_startwin = j_frame("Peter's Lifetime")can = j_canvas(win, 400, 300)j_pack(win)j_show(win)centerX = fix(j_getwidth(can) / 2)centerY = fix(j_getheight(can) / 2)totalLines = 20REPEATj_setnamedcolorbg(can, J_WHITE)For i = -20 to 20 offsetX = cos(dllsecs()*i*(0.25 / totalLines))*100 offsety = sin(dllsecs()*i*(0.25 / totalLines))*100 j_setcolor(can,16,128,200) j_drawline(can, centerX - offsetX, centerY - offsetY, centerX + offsetX, centerY + offsetY) offsetX = cos(dllsecs()*i*(0.50 / totalLines))*100 offsety = sin(dllsecs()*i*(0.50 / totalLines))*100 j_setcolor(can,200,128,16) j_drawline(can, centerX - offsetX, centerY - offsetY, centerX + offsetX, centerY + offsetY)Next j_sleep(250)UNTIL 0j_quit
#include "sw.inc"! timeGetTime Lib "winmm.dll" () As LongWindow 400,300,1sys centerX = GetWidth () /2sys centerY = GetHeight() /2sys totalLines=20, i, j single offsetX, offsetYwhile Key(27)=0Cls sw_whiteFor i= -totalLines to totalLines offsetX = cos(timeGetTime()*i*(0.25 / totalLines))*100 offsety = sin(timeGetTime()*i*(0.25 / totalLines))*100 Line centerX-offsetX,centerY-offsetY,centerX+offsetX,centerY+offsetY,1,RGB(16,128,200) offsetX = cos(timeGetTime()*i*(0.50 / totalLines))*100 offsety = sin(timeGetTime()*i*(0.50 / totalLines))*100 Line centerX-offsetX,centerY-offsetY,centerX+offsetX,centerY+offsetY,1,RGB(200,128,16) NextSyncSetFps 8wendCloseWindow