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).

Similar Messages

  • 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..

  • Java Game not working on phone

    Hello, Im using mpp sdk to compile and emulate java code. It works fine but when I download it to my phone, it doesnt work.
    Im sure the problem is somthing in the code that my doesnt support that the emulator does, I just dont know what it is.
    My phone is a sony ericsson k500i but Im hoping that this code will work on any phone with a jvm.
    The code is here
    http://www.geocities.com/ed72678954/Life.java
    http://www.geocities.com/ed72678954/LifeCanvas.java
    Thanks very much...

    No- I have a couple of java games apart from this one- but all other work fine. I even downloaded a free ad version of this game from Nokia store and even that gives the same problem. Why Cant Nokia check for compatibility before adding any app in its app store? Same is the case with quick office pro 7 which has compatibility issues with belle as agreed by quickoffice itself. Then why does the app continue to be available in store that too at a price?
    In Love With My C6-01:Now running on Nokia Belle!

  • Sound in a java game

    hy,
    is it possible to create a sound in a handy java game(J2ME)
    mfg pg

    In the MIDP 1.0 specification sound is not supported. You can only use the device specific API. The Siemens SL45i has its own classes for sound output. But when you use them, your program will not work on other devices.

  • How to make "Levels" in simple java game

    I just wanted to know if anybody knew how to make "Levels" in a java game. In my case, it is to change two polygons that are used in the background. I think you have to use an array of some kind, but i dont really know.
    Here is my source, the polygons are by the massive ///////// areas.
    I cut out the majority of the program, because it was too long.
    public class collision extends Applet implements MouseListener,MouseMotionListener
        private  Image rickImage,mazeImage;
       Image Buffer;
       Graphics gBuffer;
       int x, y;
       int[] LeftWallX = {0,204,204,149,149,162,162,243,260,235,259,232,260,230,207,207,0};
       int[] LeftWallY = {500,499,402,402,341,324,227,191,157,141,135,123,116,109,86,1,1};
       //int[] PlayAreaX = {204,204,149,149,162,162,243,260,235,259,232,260,230,207,207,263,263,245,282,262,274,257,273,250,184,184,170,170,208,216,216};
      // int[] PlayAreaY = {499,402,402,341,324,227,191,157,141,135,123,116,109,86,1,1,86,103,115,129,138,147,155,201,230,323,340,384,384,402,499};
       int[] RightWallX = {500,500,263,263,245,282,262,274,257,273,250,184,184,170,170,208,216,216};
       int[] RightWallY = {500,0,1,86,103,115,129,138,147,155,201,230,323,340,384,384,402,499};
       boolean mouseInside, collide;
       boolean rolled = false;
       boolean msg = true;
       int sX=204,sY=490,sW=12,sH=9;
       //Declare the rectangles
       Rectangle  movingRect,finshBloc,startBloc,oopsBloc;
       //Declare the polygons
       Polygon leftWall,playerArea,rightWall;
            ///Initiate
            public void init()
                 rickImage = getImage(getDocumentBase(), "rick.jpg");
                 mazeImage = getImage(getDocumentBase(), "maze1.jpg");
                 collide=false;
                 Buffer=createImage(getSize().width,getSize().height);
                 gBuffer=Buffer.getGraphics();
                 rightWall=new Polygon(RightWallX,RightWallY,18);
                 playerArea= new Polygon(PlayAreaX,PlayAreaY,31);
                 leftWall= new Polygon(LeftWallX,LeftWallY,17);
            public void paint(Graphics g)
                 drawStuff();
                 g.drawImage (Buffer,0,0, this);
    */

    I'm not exactly sure in your case what you are trying to accomplish. If all you want to do is make new polygons for your levels then you will simply need a Vector of type level (or polygon). Store multiple levels/polygons in that vector. This can be done many ways, probably the most efficient way would be to create a class Level of sorts and create each level object from there. This way you have all your levels stored into that vector.
    I have made programs where the levels/mazes are randomly generated based on certain parameters (this way you would not need to define any specific level). This can be done inside the Level class and added to the vector so that when a level is randomly generated there are literally infinite possibilities. I would suggest posting all your code or at least a breakdown UML diagram of what is going on in your entire program.

  • 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

  • The ever so savvy "creating a java game" post

    Hey, I'm creating a java game, and I did research, and found that this question has been asked many, many times. But my question unfortunately did not match up with any of these posts :( So here goes...
    Im creating a java game, which will run as....kind of a mix between a 2d game, and 3d game (no i am not insane). I dont want the original zelda look, and i dont want the first person shooter look, I want my character to be viewed from an angle, like tibia - if anyone has ever played that. And I also want to leave open the door to changing the view within the game. I figured I can just get my graphics friends to draw things in 3-d, (draw a house [draw the 4 sides and the roof]), and then somehow skew these images to accomodate for a different view.
    I am more than willing to code some kind of graphics engine if what I need is not available, I have looked at a couple and found no such luck.
    So what is the most efficient way to create this game? By just sortof getting all the graphics to be from a certain percpective, and then somehow modifying them with java.....
    or by using some kind of graphics engine that allows me to change views? If so any recomendations?
    Thanks a lot - wow this was long, oh yea a couple Dukes for this too thanks again
    -Mark

    you don't need to do any skewing. Here's what I'd do. I'd store all the tile information in a matrix (Object[][]) with a custom tile class that has the information it needs to retrieve its appropriate image, and certain game related data like slow down factor when a person walks over a certain type of tile, and whether it can be collided with. I'd draw them based on however you decide to angle your tiles. But the important part is you go in this order:
    [0, 0], [0, 1], [1, 0], [0, 2], [1, 1], [2, 0], etc., etc....
    The idea is if you're turning the floor 45 degrees clockwise, to give the correct illusion of depth, you'll want to draw the furthest back tile first, and the furthest tile forward last. Whether you start on the left or right depends on what angle you decide to work with. At a 45 degree angle, it obviously doesn't matter whether you start on the left or right. But if you guess wrong with your rendering, it will show because tiles that are closer to the "camera" will be overlapped by tiles further from the "camera".
    for (int i = 0; i < tiles.length; i++) {
         for (int j = 0; j < tiles.length; j++) {
              graphics2D.drawImage(tiles[i].getImage(), i*horizontalSpacing - camera.getX(), j*verticalSpacing, camera.getY(), null);
    }horizontalSpacing and verticalSpacing will be determined by the angle of your tiles. Set those to match however you make your art.
    Drawing moving sprites will be a bit trickier because you'll have to decide which set of axes to follow... meaning, do you follow the axes of the screen, or the axes of your "rotated world." Give that some thought and once you understand what's happening with the perspective here you'll be able to see which is easiest.
    So there's your engine ;)
    Now, as for the art itself, make them in png format, so that you can have the base of your images be diamond shape, but of course tiles for players and walls and stuff will extend above that diamond. Just don't let them get below the base of their diamond otherwise the tile that gets drawn below them will cut them off. And you don't want a character's feet cut off by the "floor" as he runs ;)
    For your final question, don't let java skew the sprite. The only possible way to make it decent is if when you pick an angle, a 3D render takes your 3D world and it's 3D models and re-renders them at that angle; skewing is simply not capable of creating that illusion. The closest you could get is to simply squish the hight of your art to give the illusion that the camera is moving up, but since you can't expose things higher, like the top of your character's head (since the data doesn't exist in the "lower" version), it will be obviously funny looking.
    Hope that answers your questions, and good luck! I would definitely like to see what you come up with.

  • 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!!

  • How to install outside java games in firefox os...(not from marketplace)

    Installing java games in firefox os

    Then can I install android apps in firefox os smartphone? If yes, then how?

  • 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!

  • 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

  • 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.

  • 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.

  • Can't download Java games. Certificate error conta...

    please can someone help me. each time i try to download java games via wap or cable i keep getting this certificate error message. i used to download just any game before until now. pls help

    If the so called root certificate against which the installation file was signed has expired, then a possible workaround is to set the phone date back far enough in the past for the duration of the installation (and then forward again to the correct date).
    Otherwise, the application developer needs to deal with it and have the installation file signed again with a digital certificate that has not expired.

Maybe you are looking for