Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Doodle
#5
Modified version (add an interactivity)
- KEY-UP
- KEY-DOWN

Code:
'==================================
'Doodle (modified)
'originally written in QB64 by Dav
'converted to N7 by Johnno
'add interactivity in N7 by Micha
'==================================

'----------------
' INITIALIZATION
'----------------
#win32

w = 640
h = 640

set window "Doodle",w,h, false
set redraw off

'color definition
black = [0,0,0]

'interactivity
f = 100

'-------
' MAIN
'-------
do
    'timing
    t = t + 0.01
   
    'clear background
    set color black
    cls

    'interactivity control
    if keydown(KEY_UP) then
        f = f + 10
    elseif keydown(KEY_DOWN) then
        f = f - 10
    endif
   
    'draw waves
    for i = 1 to 8
        set color i*32,i*32*0.7,0 'color light transition
        for x = 0 to w           
            y = f * sin(PI * x/w ) * sin(PI * x/w  +  i * t * 0.3)
            draw ellipse x      , h/2 + y,i,i,true  'horizontal
            draw ellipse w/2 + y, x      ,i,i,true  'vertical
       next
    next
   
    redraw
    fwait 30
until keydown(KEY_ESCAPE, true)
Reply


Messages In This Thread
Doodle - by johnno56 - 11-25-2024, 07:23 PM
RE: Doodle - by kevin - 11-25-2024, 08:22 PM
RE: Doodle - by johnno56 - 11-25-2024, 08:41 PM
RE: Doodle - by oskarg - 11-26-2024, 11:28 AM
RE: Doodle - by 1micha.elok - 11-26-2024, 12:44 PM
RE: Doodle - by johnno56 - 11-26-2024, 05:49 PM
RE: Doodle - by Marcus - 11-27-2024, 07:31 AM
RE: Doodle - by aurel - 11-28-2024, 06:31 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)