Making Java Game Help ^^

We're making a game for our Java course and we're thinking of making something like Flash Flash Revolution, only in Java. Is this anywhere near possible? Or should we just make a tile-based game like Spyhunter...?
I'd really appreciate some help or comments. ^^

This can 100% definetly be done.
The only real hard part is getting the arrows to perfectly sync up with the BPM of the music. Your going to have to write a routine that can change the scroll speed and timing of the arrows based on varying BPM values.
There are some free programs out there you can download that will give you the BPM of songs you feed it. The non free tools allow you to get a higher and more accurate BPM precision.
Of course if you simple make the game only have 1 song, and you already know the exact BPM, then you can code the initial arrow movement speed for that one song and pretty much the rest of the game is a cake walk to program.

Similar Messages

  • Java game app - need help on creating more adversaries

    HI all, this app is a simple game where the objective is to avoid incoming balls (adversaries) however at present I can only figure out how to get one ball on screen at a time. What I'd really like is, when a player hits 100 points, a second ball is spawned (thus making the game harder) I would like the same to occur at 200 points (3 balls), 400 pts (4 balls) and so forth. I am sure there is a simple way of doing this. what I have tried is creatin new instances of Ball, but to no avail.any help would be greatly appreciated.
    cheers
    /* A game that is Saucer-like
    * Phillip Wells
    //to do - make more balls when 100 points met
    import java.awt.*;
    import java.awt.Toolkit.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.geom.*;
    import java.util.concurrent.*;
    public class Saucer extends JFrame {
        public static final int WIDTH = 400;
        public static final int HEIGHT = 400;
        Image img;
        private PaintSurface canvas;
        public void init() {
            this.setSize(WIDTH, HEIGHT);
            this.setTitle("Saucer");
            canvas = new PaintSurface();
           img = Toolkit.getDefaultToolkit().getImage("space.gif");
            this.getContentPane().add(canvas, BorderLayout.CENTER);
            ScheduledThreadPoolExecutor executor =
                    new ScheduledThreadPoolExecutor(3);
            executor.scheduleAtFixedRate(new AnimationThread(this),
                    0L, 20L, TimeUnit.MILLISECONDS);
            setVisible(true);
        class AnimationThread implements Runnable {
            JFrame c;
            public AnimationThread(JFrame c) {
                this.c = c;
            public void run() {
                c.repaint();
        class PaintSurface extends JComponent {
            int saucer_x = 0; // start position of saucer
            int saucer_y = 180;
            int score = 0;
            Ball Ball;
            Color[] color = {Color.RED, Color.ORANGE,
            Color.MAGENTA, Color.ORANGE,
            Color.CYAN, Color.BLUE};
            int colorIndex;
            public PaintSurface() {
                addMouseMotionListener(new MouseMotionAdapter() {
                    public void mouseMoved(MouseEvent e) {
                        saucer_x = e.getX() -30;
                        saucer_y = e.getY() -0;
                Ball = new Ball(30);
            public void paint(Graphics g) {
                Graphics2D g2 = (Graphics2D)g;
                g2.setRenderingHint(
                        RenderingHints.KEY_ANTIALIASING,
                        RenderingHints.VALUE_ANTIALIAS_ON);
                        Shape saucer = new Ellipse2D.Float(
                        saucer_x, saucer_y, 60, 10); // saucer dimensions
                g2.drawImage(img, 0, 0, this);
                g2.setColor(color[colorIndex % 6]);
                if (Ball.intersects(saucer_x, saucer_y, 60, 10)
                && Ball.y_speed > 0) {
                    Ball = new Ball(20);
                    score -= 100;
                    colorIndex = 0;
                else if (Ball.getY() + Ball.getHeight() >= Saucer.HEIGHT)
                    Ball = new Ball(20);
                    score += 10;
                    colorIndex = 0;
                Ball.move();
                g2.fill(Ball);
                g2.setColor(Color.GREEN);
                g2.fill(saucer);
                g2.drawString("Score: " + score, 250, 20);      
                if (score == 20)
        class Ball extends Ellipse2D.Float {
            public int x_speed, y_speed;
            private int d;
            private int width = Saucer.WIDTH;
            private int height = Saucer.HEIGHT;
            public Ball(int diameter) {
                super((int)(Math.random() * (Saucer.WIDTH - 20) + 1),
                        0, diameter, diameter);
                this.d = diameter;
                this.x_speed = (int)(Math.random() * 5 + 5);
                this.y_speed = (int)(Math.random() * 5 + 5);
            public void move() {
                if (super.x < 0 || super.x > width - d)
                    x_speed = -x_speed;
                if (super.y < 0 || super.y > height - d)
                    y_speed = -y_speed;
                super.x += x_speed;
                super.y += y_speed;
    }

    On an off note, there are some things you can do here to make multiple balls much easier to create, track, and manage. One thing is that your Ball class should have a record of all properties that are in anyway related to a Ball object.
    I notice that you handle Ball color within your paint method. Your Ball class should have a Color field so every instance of Ball is aware of its color, and then your paint method can grab the necessary color from the object itself that it is painting. You wont need to keep a color index and color collection.
    Secondly, to track multiple balls you will need a collection object that holds multiple Ball objects. Everything in your paint method right now is looking at one instance of Ball because there is only one reference of Ball. Instead of doing it this way you can keep a number of Ball objects in an ArrayList lets say, and then create a for loop that iterates through element of the List, and performs operations on that ball, like grabbing its color, filling the shape, calling the Ball's move method.

  • Making a game with 3 layers of tiles; help

    Hi guys,
    I am busy making a game which will have 3 layers of tiles. Firstly, the terrain, then the buildings and finally the player (sprite).
    I was thinking of using JLayeredPane to achieve this. But, I was also thinking of just drawing all the layers onto one bufferedimage and then just showing that everytime? What would you say?

    Thanks, i am going to do that. question now is one of transparency.
    How do i make sure that Java treats my png properly? I have tried testing whether it treats the transparent pixels properly and it doesn't. How do i work around this?

  • Making some basic Java games

    Can anyone help on how to make some basic java games for my website if you could that would be helpful
    thanks,
    Louie

    Well, first of all you program the Framework, add Graphics / sounds / Data , then you put it in your HP - There you are!

  • Help with java games

    any ideas on dynomite-like games??
    where can i find online tutorials on how to make java games??

    honestly, it depends on your level! what can you program? can you use double-buffering? can you load and display images? i have a few classes i could supply you to help you make a game ( DoubleBufferedPane , SoundClip, MusicClip, Sprite, etc. ) owever i dunno where you are in leraning java...

  • JAVA Game DEV

    Does anyone know of a site which will walk a total newbie through making a very simple game in Java. It doesn't matter how crappy the game is, just something to get the newbie started.
    The website is for me :)
    Thanks,
    Christopher Gillis

    I recomend books like "Black Art of Java Game Programming". Although it is old. It is still very relevant.
    The sites that I learnt from are:
    http://www.gamejug.org/tutorials/
    http://www.electricfunstuff.com/jgdc/tutorials/jgdc_tutorials.htm
    http://blazinggames.com/books/jgd/ch01/page02.html
    They are good sites for amatures.
    I also found insparation and some code at:
    http://www.javaonthebrain.com
    Hope that helps!!

  • OPEN SOURCE JAVA GAME

    Hi, my name is Dydra and I have been programming an MMORPG in java this last two years. I want to publish an open source Java game to start a new generation of cross platform games, but I can´t do it by myself xD. So I want to share what I have done so far with everyone interested in programming games so that everyone can help making this game.
    All the code is not mine: some parts are from the book Killer Programming Games. I adapted the 3D MMO engine of that book to an 2D engine and customized some things.
    If anyone can tell me how to make this an open project here at sun forums, please tell me xD.
    Here is a youtube link with the game working so far:
    http://www.youtube.com/watch?v=CvNtx_pibwM
    PM me or email me if interested: [email protected]

    Do you know the best part? It is almost finished. The things that need to be finished are:
    -Leveling up and stats (no big deal)
    -GUI (like menus and invetaries. no big deal too)
    -NPC (this may be the most complex part)
    - Shop and Players Party/Trade
    -Drops
    THE REST OF THE GAME IS DONE! I already did a map editor with custom map objects and will be used to place Non Agressive NPCs. I also made a custom set up of menues and skills. To have a skill or item into the game you just need to open your wordpad and write the img file and what the item does (damage, heal, equip, instant spell, etc).
    I need help to improve animation of the sprites, skills, improve the GUI ( I did it all myself but it's kinda crappy, you know) and the NPC. As I want it to be a PVP oriented game because there is no real RPG PVP oriented game. Most PVPs are MMOFPS like GunZ.
    I eben have the host for the server! jajajajaj
    Need your help guy!!!! Di you hear me!!!??? jajaja
    Thanks for responding, I hope you'll join my PvP cause xD

  • Java game AI

    Hi there, I am currently creating a battleship game which allows you to play against a computer or a human or run the game as a spectator watching the computer battle its own AI. I am having trouble finding an efficient way to program the AI when I hit a ship on the opponents map.
    Current logic: I hit an enemy ship and add all the possible directions into a queue and resolve them in order, up down left right. If there is an 'o' (miss) or 'x' (hit), currently in one of the suggested directions, it will be removed (since it has already been searched) and move on to the next coordinate.
    Problem: The AI is extensive in it's checking. It finds a long ship, 10 char long, and checkes all around the the ship making sure nothing else is there. Although this method is very accurate, it takes too many turns to verify that it has found the whole ship, therefore losing almost all the time.
    Any ideas?
    -Thanks in advance
    EDIT: Sample from AI vs AI.
    x = hit
    o = miss
    Computer2's Map
    0123456789
    0 .......xxo
    1 .ooo..o.o.
    2 ....o.....
    3 ..........
    4 .....ooooo
    5 ...ooooxxo
    6 .ooxxxxxo.
    7 .oooooooo.
    8 .......o..
    9 .o........
    Edited by: Krytical on Jul 15, 2009 2:55 PM

    I think you are not putting enough into it.
    AI is hard, no matter how simple the game may seem. I have written about 16 games (I might have missed one or two in a hasty count) and worked on a couple open source game projects. Of those 16, 2 of them include an option to play against the computer, i.e. they have a good enough AI. The rest are all strictly multiplayer or single player with no opponents (simulations). Of those two, both are also and where first multiplayer games. That is because until I can play a game enough to fully understand it strategically (even though I wrote it), it is impossible to write a working AI.
    So here is my advice, play a few dozen games against other players, the more different people you play against the better. Jot down your strategies in every situation, and ask you opponent if they would be kind enough to do likewise (it helps to tell them it is for writing an AI, otherwise they think you are just trying to learn their secrets for the next time you play). Then try out some of the strategies you get from others and see if you understand it, when it is best to use that strategy, and how well it works.
    At this point, you should try to code several of those strategies and see how well the computer does with it. Then code a way for the computer to weigh the possible effectives of the different strategies and randomly choose between them based on the weighted scale. As in, if start A is 5 times more likely to succeed than strat B in situation X then the computer should have 5 times more likelihood of choosing strat A over strat B for situation X.
    As a starting point, here is my strat for battleship in a way that should help with how to code it. I always look at which direction has the longest distance to where I have previously fired. But I also limit it to 4 spaces as that is the length of the longest ship (plus the one hit). So if I choose say F6 (isn't it letters across the top?) and get a hit, then I look around F6. Looking down I have already gotten a miss on F9 leaving 2 blank spaces. Looking left I have recorded a miss on A6, leaving 4 spaces that way. Looking up I have a miss on F5, so there is definately not one that way and this makes it less likely the boat runs north and south (up and down). To the right the nearest shot was a hit on a boat I already sunk but it is 7 spaces away, so I exceed the limit and reduce it to 4 spaces. So what do we have, 2 spaces down, no spaces up and 4 spaces to both the left and the right. At this point I am just going to randomly choose to go left or right and keep going that way until I get a miss or my opponent announces I sunk a ship, if a miss with no sinking I go the other way until said declaration. Should I get a miss on both sides without an additional hit then I will re-evaluate and since the only way left to go in that case would be down, that is how I would go. If I got a hit going either way but missed on both sides then I know I have two ships and I simply put the new hit on the back burner until I have sunk the first.
    Now this should all be relatively easy to code and should make the AI much more formidable. But there is actually far more I do when playing that game. For example, if the 5 length ship has already been sunk and the longest left is 4 length, then I only go 3 blank spaces each way in weighing my options. Similarly if the 2 length ship and both 3 length ships are sunk then I first check to ensure there is a total of at least 4 spaces along either axes (there must be on at least one of them). This will be a little more coding work, but will make the computer AI even more robust and formidable.
    If I was playing against your AI I would always place my ships from left to right, because I know the AI is then always going to waste at least 2 shots whenever it gets a hit. In AI the more unpredictable the AI is the better, this is why it is important to keep things random, and give the computer as many strategy choices as possible to weigh and then semi-randomly choose from.
    Also, this is the wrong place on these forums for this question, there is actually a java games section here, I think it is under other. Also there is actually a fairly active java game forum, but I don't recall the url for it atm. You will have far better chances of getting a response in one of those more appropriate places.
    JSG

  • How can I download java game?

    Hi everyone, sorry for my english, it is not my native language.
    I have Game.Jar file, which is java game for Nokia ,and I uploaded this file into database.
    Now I have a filed, type of byte[] (array of bites)
    next, I generate URL like http://site.com/getfile.xxx?id=10, and then user go to this URL via WAP, and trying to send him byte[] array with java game data.
    But I don't know which Content-Type i must send :(
    I trying to send Content-Type: application/jar , but after downloading game into mobile phone, the game doesnt open :(((
    please help me!

    excuse me, it's actually application/java-archive
    This works for me (PHP) but unfortunately you have to rename the downloaded file to .jar:
    <?php
    $file = fopen("MimeTest.jar","r");
    header("Content-Type: application/java-archive");
    $text = fread($file,filesize("MimeTest.jar"));
    print $text;
    fclose($file);
    ?>You can try it out here: http://woogley.net/misc/MimeTest.php
    Download that and rename it to .jar and see if the data stayed in tact..

  • I'm getting this error: It looks like you've the new version of Firefox. Unfortunately, there is currently a bug that is preventing players from playing Java games with version 3.6.14 of Firefox.

    cant play on Pogo.com, error: theres a bug that prevents everyone from playing Java games with Firefox new version.

    You can update Firefox to the latest 3.6.15 version via "Help > Check for Updates"

  • Java Game Smart Card Implementation

    Hi,
    As an assignment i have been told to design a smart card application,(theory only). My idea was that of cross-platform java games that could be stored on a smart card,so for example:
    -the smart card could be used in PC and mobile (allowing games to be restarted at the same stage).
    -the card would store high scores, character info, and background environments
    - the card could send game data to friends, by either using the smart card in their devices or via the internet extracting and downloading from the card, or better still off the phone to anothers phone by selecting them from the address book
    I was wondering if there were any other ideas that i could use, and more importantly the technical details of how to implement such a card
    -ie which card
    -how much memory
    -the equipment required
    I would appreciate all the help you could give me, and it is quite an interesting topic.
    thanks
    jag

    http://forum.java.sun.com/thread.jsp?forum=23&thread=357393&tstart=0&trange=15

  • Firmware update on my Nokia E52 only run java game...

    Hi, I made that day Firmware update on my Nokia E52 and then update-s all right, only run java games and their sound is gone whether he shall be ON. Anybody have a similar problem and a solution for it?? Firmware-v 052.003 but the date is Cot. 29, 2010) will be happy if you give me an idea how to fix it! I tried quite moratoria preinstall, reset backup I have not done, unfortunately the old Firmware.

    Okay, you are using a MacBook so I am not sure how much help I can give since I use a PC with Vista. In the latest version of Ovi Suite, once the update file has been downloaded and the installation starts, the computer will give your prompts that the phone is disconnected via USB, the phone restarts, the screen flashes, etc. I just leave it alone and after the progress bar on the Ovi Suite ends my phone is updated. I currently have v40. The free maps is available only to v31 and above for 5800 if I remember correctly.
    If possible please use the Ovi Suite instead of PC suite (at least in my experience it works better), and do not in any way touch your phone during updates, even if it "disconnects" from the computer.
    However regarding to your query as to why it is not available via the *#0000# method (or FOTA), updates are generally released through NSU before FOTA, sometimes with as much as a month in difference because the files in FOTA are not the entire update file but rather extractions from it. For example, the v40 FOTA is 17mb (according to someone who said he had it already), while the v40 I downloaded through Ovi Suite was 128mb. 
    If you find my post helpful please click the green star on the left under the avatar. Thanks.

  • Rank in a java game

    Hi ppl,
    I'm newbie in this forum, I'm development a java game and now I would like to implements a rank for players.
    Basically, I have some players that play to the game and then (at game finish) game will write a .txt file with date, score and name player.
    How I can implements it?
    Thanks, regards.
    Michael.

    MichaelStu wrote:
    link is broken...The link works for me, but if for some reason it doesn't work for you, just google "java file IO". Read through the tutorial carefully. Ask a question when you get stuck, and make sure you post an [SSCCE |http://sscce.org] demonstrating the problem.
    then need help in how implements...such as write in a txt file and then apply a bubble sort algorithm?What? You are thinking about it all wrong. Why would you write to a file and then sort?
    One thing at a time. Split your problem up into smaller pieces. Sorting your data is a completely different issue than writing to a file, and for that I'd recommend googling comparators and looking up the sort functions of the Collections and Arrays classes in the API (since links don't work for you, go ahead and google those too).

  • I can't download java games

    Hi,
    I'm trying to download some cell-phone java games off the internet onto my laptop but a window pops up that says "Java Virtual Machine, Fail to load Main-Class manifest attribute from C:/Documents and Settings..... .jar". I have installed "J2SE Runtime Enviroment 5.0 Update 6". What can I do? PLEASE HELP!

    Search the App Store for "Java Browsers".
    Therw a re a few there, though support is not 100%, you might be able to find one that can play the games.

  • What methodogies should i consider for making a game?

    Im at the begining of making a game. I was wondering what design methodoligies i should use for constructing the game. The game will be in the form of a classic arcade stlye shoot-em up.

    In my workplace, we have identified five general methodologies; the waterfall, the v-shaped, the prototyping, the incremental and the spiral development patterns.
    For you, I would suggest doing the incremental (iterative) or the spiral pattern. What they have in common is that you start with a very basic, very rudimentary working system and add increasingly sophisticated functionality.
    Incremental (iterative) makes you add components. For example, a graphics framework, then sound code, then the ability to save games and so on. Presumably other components include support for joysticks and gamepads.
    Spiral on the other hand has you make a complete, rudimentary package from the start and you consider the risks involved in adding the next layer of sophistication. "Is it worth swapping out my sprite based 2D graphics system for a 3D model-based system?"
    But keep in mind that "design methodologies" are really nothing more than a way for you to organize your work such that you can offer a reasonable accurate schedule and a cost for implementing the project. For example, you could say it would take you about X number of days to switch from 2D to 3D and you can then determine if your game is going to be that much better for the work you put in.
    However, I suspect you're really done this for the fun of it, you just want to dabble in Java and have a bit of fun with it. In which case, I would not bother with a design method any more elaborate than a program logic flowchart and a crude schedule of what to code first.
    Hint: threads containing rudimentary controls and a basic 2D graphics framework that can move an image around the screen are probably the first thing you should code.

Maybe you are looking for

  • Help with exporting as an animated gif

    I've created a small banner ad and need to export it as an animated gif.  The problem is, when I open the gif after exporting it, there's no animation.  The way the animation is set up is 1 frame on the main timeline, and a scrolling movie clip as th

  • No sound in Keynote

    Today, when I play my slideshows, my embedded video clips and tunes cannot be heard. I have used Keynote for years and never had this problem. These slideshows previously sounded fine. My computer volume is up. Other applications (iTunes) sound fine.

  • Error in invoking target 'relink' of makefile on Solaris x64

    Hi, I'm installing Oracle 10g 10.2.0.1.0 on Sun Solaris 10 x64 11/06 release. The problem is a message Error in invoking target 'relink' of makefile ... The log file have a error message: INFO: ld.so.1: ld: fatal: relocation error: file /usr/ccs/bin/

  • Strange behaviour of the rangeSize - or is it desired?

    Hi there, as recently asked in Difference between VO Fetch Size, Iterator rangeSize and af:table Fetch Siz we have a problem with the rangeSize property of the iterator binding. First of all, we're currently working wit JDev version 11.1.2.2.0. So, w

  • Survey URL

    Hi Gurus, I have created the Customer Satisfaction Survey, know i have to create the URL for that survey? How can i generate the URL  for the created survey? Can any body brief the procedure step by step?