The applet that is there implements MouseMotionListener, and the animation only takes place when mouseMoved is called.
What I want is for a separate thread (or all the animation could take place in the same thread, that's ideal...) to animate a ball that bounces around the screen...I can figure the rest out, I'm making a breakout game.
Ok, this was my latest attempt, I put everything in the run() function.
Will the mouseMoved() event, when triggered, interrupt a thread?
It shouldn't...right?
The applet doesn't seem to get off the ground, I've attached the source, graphics files, and sampling html file to test run the applet.
Thanks,
Jeff C
PS. Do you have any sample source code of these two interfaces working together, I would appreciate it very much at this point, but I'm still looking to get it to run correctly.
]
PPS, when I do finally get it, i'll post the source code here too.
I have restructured your applet, there was a lot of things to change, but
instead of me spending time going into every detail I suggest that you
have a good look at what I've done here.
Basically I've divided the applet into methods that enables the correct
sequential processing that an imageLoading & animated applet is supposed to.
Note: a sleep(5) during the animation gives 200 ticks per second, ...how fast
is your screen/eyes ...... You will have to reconsider that.
I haven't tested it though, but I suspect that you have some more tweaking to do here.
not at first...there was a misspelling imageloader and imageLoader didn't match up...
...and the backg image was created originally to fill the entire screen, so I fixed that using getScaledInstance.
You are awesome, I will update you in this forum as to my progress.
Here is the final updated at this stage...I will still need to study your code so more also. That package thing was cool too, but I commented it out so my usual directory was updated, not the new package one.
Bookmarks