I wrote a simple particle simulation program that has blue circles flying around the screen and colliding into each other. When two circles collide I want to display an "explosion" movie (currently implemented as a Movie object) at the location of the collision.
However, I can't get the full movie to display when the two circles collide - sometimes I don't see anything, and sometimes only a few random frames play. Has anyone done this before or know if there is a very specific way I need to display movie data? This is my first project so please bear with me.
Here is the "test" class, basically the main function in the program:
Here is the "Explosion" class. Since I couldn't get the explosions to display properly using standard serial execution, I implemented this class as an extension of the "Thread" class with a Runnable implementation. However the concurrent programming doesn't solve my problem, nor does it seem to effect the way the program was running before. :
import processing.video.*;
import java.util.concurrent.*;
class Explosion extends Thread implements Runnable {
This is my first processing project (and first java project), so please bear with me if I'm making some really noob mistakes here.
Basically, the program I wrote sends circles flying around and if they collide with each other, they "explode". For the explosion I've tried to use a .mp4 file as a Movie object and a .gif file as a Gif object, but both seem to just play the first frame of the movie/gif (if that). If I just play the movie/gif using the image function in draw() the playback is fine.
My main question is, if I'm trying to display a movie/gif but the function call to display the movie is buried in a few layers of code what can I do to correctly play the movie when the two particles collide with each other?
Also I know the double for loop in the ckCollisions function is not the best way to do that but the system is small enough that performance hasn't been an issue with it.