Jump to content

Simulate the matrix

- - - - -

  • Please log in to reply
5 replies to this topic

#1
Mozana

Mozana

    Learning Programmer

  • Members
  • PipPipPip
  • 70 posts
Here something I think to be intresting, I want to use multithreading to simulte the matirx screensaver on a jpanel is that possible, like to have characters drop from top to bottom in slow motion as in the matrix movies, any tips will be much appreciated.:)

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Why do you want it to be multi-threaded? This should be easy enough to implement as a list of "falling characters" that leave a trail of "fading characters" behind. You can then loop through the falling and fading lists as needed.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Mozana

Mozana

    Learning Programmer

  • Members
  • PipPipPip
  • 70 posts

WingedPanther said:

This should be easy enough to implement as a list of "falling characters" that leave a trail of "fading characters" behind.

Im actually wondering how do I make the characters fall, I thought I would need multiple threads for the multiple columns. I would also upload a pic just I dont seem to figure out how that is done.

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
A falling character is just a character that changes it's position by moving one slot down on the screen periodically. Think of your screen as a grid. A falling character just moves down on the grid, and a fading character never moves.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#5
Mozana

Mozana

    Learning Programmer

  • Members
  • PipPipPip
  • 70 posts

WingedPanther said:

A falling character is just a character that changes it's position by moving one slot down on the screen periodically. Think of your screen as a grid. A falling character just moves down on the grid, and a fading character never moves.

I dont understand that, a fading character never moves. I dont get it.
Any way I have decided to add a number fof JLabels and place the characters within the JLabel but I dont know how to make them move.

#6
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
A fading character stays in one place, slowly getting darker. The falling character leaves a trail of fading characters behind it.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users