Ya I was going to modify your class and add a part 2 of the game...
Basically i wanted to use your click-thingy program as part of the game. So that when people click and hit the targets a variable records that. Then im going to make it give points and update to the screen in real time. Afterwards (this is what im working on tonite) when the user has enough points he faces an "end guy" where he battles the end guy to the death. (thats what the health, chakra and all thats for). In the battle he/she clicks buttons that will show a gif in that box area with an animation.
The box area loads a .gif thats animated and unfortunately it was flickering and the while true loop that your saying that doesnt compile was my noob attempt to make it stop flickering. Oddly enough it made it stop flickering at school, but here at home it just doesn't get compiled.
Sorry i wasn't clear about where my vision was for the game. Our teacher let us use 1 other persons programs and we give them credit (thats your click game) and the end guy thing i have to do myself. The point system and all i will make as long as a variable records a click (shouldnt be hard.)
I have included one of the animations. (this is a standard moving eyes that loads when the game starts in the box area.) So you can see how it flickers.
Ya for your input i just wanted the target image to appear randomly on the tree area of the background so when people click it, it disappears and a variable records a hit. (i will do point system myself)
Sorry to take up your time so much, thanks a lot.
Once upon a time there was a lost java programmer...
that main method we dont need in the Master_Shinobi_Challenge hehe,
I got 3 options:
1) Somehow make your GamePanel as a class that is used to run the targetting part of the game.
2) Or make 3 classes, one an intro class that welcomes the user, then you start GamePanel for target shooting, then after you get a certain amount of points start the end guy battle class.
3) Tweak and change Gamepanel so there is a welcome screen then you target shoot and finally at a certain score the end guy battle starts.
Not totally sure what is the best option of the 3 or if some of them are possible.
Once upon a time there was a lost java programmer...
I have made the GamePanel a component in the applet (that I have used
a slightly abbrevated name for). There was a bug in my untested code that
I have fixed. As it is now it spawns new clickObjects in the same manner as
the initial click game. I have tested it as a local app, like you have, but the
code for doing remote uploads and running as an aplet is there.
I am a bit puzzled about the no-flicker issue; flickering is something that
occurs when the program performs a repeated screen update with graphics
that change rapidly, the code I saw just displayed an image, and that was
it. The FRAMEBITS variable is, to my knowledge there to signal when an
image is ready to be displayed/used and how that can substitute for double
buffering in an animation scenario,... well that beats me, but then again,
I have taken a lot of "beating" in my career..
Notice that the applet in this version is just a container for the GamePanel.
The GamePanel does all the work for loading and animating and the
DisplayList is where all the objects that are visible have their pointers stored.
If you introduce new classes for display you should do that by extending the
VisibleObject class.
// the target(s) (?)
private static String [] IMAGE_NAME={
"C:\\Documents and Settings\\family\\Desktop\\naruto_game\\images\\target.gif" // etc..... ?
};
private static String BG_IMAGE_NAME="C:\\Documents and Settings\\family\\Desktop\\naruto_game\\images\\trees_background.jpg";
// there is no space in trees_background.jpg in the code, not sure why it does that here
Hey Sjalle. Thanks a lot! It runs fine as an application but when i run it as an applet it says theres a URL error in those lines i pasted above. Is there anyway to load an image thats relative to the file? ie ("images/target.gif") and if i wanted to use a url I would use ie ("http://url.com/target.gif") correct?
Now what i have to change is the bounds so that the targets only spawn in the tree area of the GUI and spawn so theres only one at a time that disappears after x seconds.
Neato! ^_^
Once upon a time there was a lost java programmer...
Bookmarks