NaaLaa
Doodle - Printable Version

+- NaaLaa (https://www.naalaa.com/forum)
+-- Forum: NaaLaa (https://www.naalaa.com/forum/forum-1.html)
+--- Forum: NaaLaa 7 Code (https://www.naalaa.com/forum/forum-4.html)
+--- Thread: Doodle (/thread-166.html)



Doodle - johnno56 - 11-25-2024

This is a QB64 converted graphics demo by "Dav". It had no name... figured doodle is better than nothing... lol

Code:
' Open a window and enable double buffering.
set window "Doodle", 640, 640, false
set redraw off

visible i, t, x, y, w, h, pi

pi = 3.141592654
w = 640
h = 640

do
    t = t + 0.01
    set color 0, 0, 0, 25

    draw rect 0, 0, w, h, true
    for i = 1 to 8
        set color i * 32, i * 32 * 0.7, 0, i * 32
        for x = 0 to w
            y = 100 * sin(pi * x / w) * sin(1 * pi * x / w + t + i * t * pi * 0.1)
            draw ellipse x, h / 2 + y, i, i
            draw ellipse w / 2 + y, x, i, i
        next
    next

    redraw
    fwait 30
until keydown(KEY_ESCAPE, true)



RE: Doodle - kevin - 11-25-2024

Wow, that is awesome, and in such a small amount of code - thank you.


RE: Doodle - johnno56 - 11-25-2024

Thank you. But as I stated earlier, it's not mine... lol You don't think that "I" am clever enough to come up with something like this one, do you? lol but, yes. Awesome with only a little code...


RE: Doodle - oskarg - 11-26-2024

wow!! Incredible effect, sometimes I am impressed with what Naalaa is capable of.


RE: Doodle - 1micha.elok - 11-26-2024

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)



RE: Doodle - johnno56 - 11-26-2024

What did you do?!? Nah... Kidding... brilliant mod! Well done!


RE: Doodle - Marcus - 11-27-2024

Magnificent!


RE: Doodle - aurel - 11-28-2024

Looking really great
i will try translate to microA