Recent

Author Topic: walking lines :)  (Read 2264 times)

speter

  • Hero Member
  • *****
  • Posts: 532
walking lines :)
« on: March 21, 2024, 04:50:08 am »
Here is another (hopefully) interesting graphics program! :)

It may not be a Koala or a fractal; but the graphics "move".

The program has 2 sets of lines that bounce around the form - and is find of hypnotic.
It uses the Paint event, so should work on Mac's as well as Windows & Linux.

I think I based it on an Amiga program I saw in the 1980s.

cheers
S.
I climbed mighty mountains, and saw that they were actually tiny foothills. :)

tetrastes

  • Hero Member
  • *****
  • Posts: 769
Re: walking lines :)
« Reply #1 on: March 21, 2024, 02:25:17 pm »
I'm sorry to write this, but your program is buggy.
Did you debug it?
For example, closing window without pressing "Stop" button causes Access Violation (see attached picture).
Changing number of lines "on the go" causes different errors, such as Access to invalid memory, Invalid pointer operation, Floating point error ... Program hangs, and even if you close its window, it remains in background processes, and you have to use Task Manager to remove it from memory.

LV

  • Sr. Member
  • ****
  • Posts: 427
Re: walking lines :)
« Reply #2 on: March 21, 2024, 02:36:20 pm »
That's cool. It's not buggy. Laz 2.2.6 and FPC 3.2.2 Win11
P.S. As @tetrastes correctly noted, if you do not close the window without pressing the "Stop" button and do not change the number of lines "on the go".
« Last Edit: March 21, 2024, 03:03:03 pm by LV »

Thaddy

  • Hero Member
  • *****
  • Posts: 19398
  • Glad to be alive.
Re: walking lines :)
« Reply #3 on: March 21, 2024, 03:20:03 pm »
which means it is buggy by design...should never happen.
objects are fine constructs. You can even initialize them with constructors.

tetrastes

  • Hero Member
  • *****
  • Posts: 769
Re: walking lines :)
« Reply #4 on: March 21, 2024, 03:22:27 pm »
It's cool, yes, but it's buggy.

But I have to say that I forgot to add Range checking  :-[ , so the origin of all troubles is Range check error.

How to reproduce.
1.Major. Compile with Range check (-Cr). Run, press "Go" button, increase the "Num Lines". Get Range check error(s). Without Range checking it causes different troubles mentioned above.

2.Minor. Compile with Range check and Debugger info, run in Lazarus with debugger, press "Go", close program with mouse not pressing "Stop" button. Though may be this is debugger issue, as this doesn't happen without debugger.

Lazarus 3.2 fpc 3.2.2 Windows 10
« Last Edit: March 21, 2024, 03:24:53 pm by tetrastes »

LV

  • Sr. Member
  • ****
  • Posts: 427
Re: walking lines :)
« Reply #5 on: March 21, 2024, 03:43:57 pm »
I really liked this graphics program. @tetrastes. I agree the author has a lot to think about.
« Last Edit: March 21, 2024, 04:22:04 pm by LV »

speter

  • Hero Member
  • *****
  • Posts: 532
Re: walking lines :)
« Reply #6 on: March 21, 2024, 11:49:26 pm »
Thanks for the feedback everyone.

Clearly, I did not intend for the number of lines to be changed while running.
I'll clean that up and post a new version in a couple of hours.

cheers
S.
I climbed mighty mountains, and saw that they were actually tiny foothills. :)

lainz

  • Hero Member
  • *****
  • Posts: 4743
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: walking lines :)
« Reply #7 on: March 22, 2024, 03:23:16 am »
Great demo.

It looks like an old windows Screensaver from windows 9x.

speter

  • Hero Member
  • *****
  • Posts: 532
Re: walking lines :)
« Reply #8 on: March 22, 2024, 04:13:48 am »
Here is a new version. :)

The user can start/stop the lines by:
  + clicking on the button;
  + clicking on the (panel) drawing area; or
  + hitting a key.

Changing the number of lines now stops the lines.
Closing the program's window no longer gives an error.
If anyone spots any other issues, please post. :)

cheers
S.
I climbed mighty mountains, and saw that they were actually tiny foothills. :)

speter

  • Hero Member
  • *****
  • Posts: 532
Re: walking lines :)
« Reply #9 on: March 23, 2024, 04:31:14 am »
G'Day Folks,

I was inspired (became more insane? :o ) today and wrote a new version.

As you might see from the app capture below, if allows many "trails" of lines.

If you find the program is a big slow, you could comment out the "delay" code (but I'd suggest leaving the "application.processmessages" line).

cheers
S.
I climbed mighty mountains, and saw that they were actually tiny foothills. :)

 

TinyPortal © 2005-2018