Re: Highscore for onlinegame

>I just want to check if I'm thinking right:
> To make the database I use MySQL (if I get it to work).
And then I store
> the
> database on a server (Can I use my homecomputer for this
- until the game
> is
> finished?)
Yes, you are thinking right.
You can use your local computer running mySQL. Version 5
should work after
default installation - use localhost or 127.0.0.1 as your
serverhost, and no
username/password when connecting with MySQL Administrator.
> Communication between the database and the game is done
with netLingo?
Yes.
> Communication between the homepage and the database is
done with PHP?
(I normally use asp locally for testing, running on MS IIS
server,
connecting from lingo with postNetText - it works fine.)
I think you have to run some server service to use PHP
locally.
With the services that most ISP have, it can be a good
alternative to use a
hosted mySQL/PHP, and test it directly on that. You don't
have to mess with
the serversetup, and you normally get a administration area
for mySQL - the
basics are allready taken care of (including easy build of
tables and
connectionstring)

>it was too late to make it into the book... You can find
it here however:
>
http://www.peachpit.com/bookstore/product.asp?isbn=0321223659&rl=1
That is a very good tutorial.
I came across this also:
http://www.lingoworkshop.com/Articles/GET_and_POST.php
http://www.lingoworkshop.com/Articles/PHP_and_MySQL.php

Similar Messages

  • Creating HighScores for my game..

    Well, Im kinda new at java and have been working on a game... it is mulitplayer but i need help on making highscores... I know you can use CGI scirpt or something similiar? can anyone help me thanks.. here is where i wanna added it in the middle of this part of code...
    else     if (talkhandle == 192 && dd == 192159 && Questdone == 1)
              sendMsg("@yel@Thank You For Saving me "+playerName+"! ");
    Message was edited by:
    Null

    1. Yes I am trying to do it serverside
    2. Yes its in java
    3. I am stuck mostly because i dont know much about
    it... Ive looked at some code dealing with serlvets
    and I dont know if thats what i need..How much Java do you know?
    I don't think you're ready for servlets yet.
    4. Also how do I extends HttpServlet If Ive already
    extends Player at the start of my client.You can't. You can only extend one class. Java does not support multiple inheritance.
    5. I Want this to be viewed (the scores) from a
    webpage...Yes i know.
    Would this work? notice I added
    HttpServlet
    public class client extends Player &&
    HttpServlet  implements Runnable
    No that's not going to work.
    >
    Please Help Ill give you points or whatever tooPoints aren't needed it's okay.
    Can I make a suggestion here? Is your game actually done? I would work on that first. Servlets are a whole new ball of wax for you to learn. Not that you can't but it seems a little ambitious for you at the moment.

  • Can't figure out how to read from .txt file...

    It looks so simple:
    I have a txt file with one line in it:
    1038It is actually a highscore for a little game. But how do get this out of the file into an int?
    Thank you.

    this reads out a complete text file:
    try
    FileInputStream fis = new FileInputStream(fileName);
    BufferedInputStream bis = new BufferedInputStream(fis);
    DataInputStream dis = new DataInputStream(bis);
    String tmp = "";
    while ( dis.available() > 0 ) { tmp += dis.readLine() + "\n"; }
    dis.close();
    bis.close();
    fis.close();
    } catch (Exception e) { e.printStackTrace(); }
    if you want to convert string to int use
    int i = Integer.parseInt( String );

  • Anyone know of a free working highscore system for Adobe air iOS?

    I used to use Mochi Leaderbords before starting coding Adobe Air games for iPhone and Android. As the Mochi API doesn't have mobile support I had to find something else and found Playtomic. Playtomic is great and easy to use, BUT it's constantly down
    My players are complaing on how often the highscore server is down. For me it's like 6/10 times I try to view scores that it doesn't show.
    Anyone know of an alternative free highscore system that works with Adobe Air for mobile?

    Hi TenchMyo,
    Just say this post, I'm Almog one of the fonders and developers for Scoreoid I'm also an Adobe ACP and UGM if you need help with anything let me both with Scoreoid or Adobe AIR.

  • How to compare the data in a highscore file(.txt)  for a game?

    As mention above,i would like to check the highscore everytime the game has finished,and updates it, what classes should be used? FileReader, FileWriter, or Properties? If so, how the codes is likely to be? Thanks a lot.

    I would discourage you from using a plain old text file to save your high scores in. The obvious reason being is that your little brother can just edit the file in notepad, then run to you and taunt, "I've got the highest score, nyah nyah nyah!"
    If you must do it, I would use PrintWriter and simply print out each line as needed. Reading the lines back into the game is only a tad more difficult, but you can simply read in each line as a String, and store each String in an array, or a Vector if you don't know how many high scores you will have.
    In the long run, you should create a serializable object that contains either the Vector or the Array of scores and instruct the object to save itself or load itself as needed. This is essentially how Properties work except you have more control over the internal data format.
    On second thought, Properties would work just fine, but you cannot guarantee that the scores will be saved in a particular order - you would have to add an additional routine to read in each Property (specifically, each name/score pair) and then sort them. Once you do that, there's no real difference between a Properties file and rolling your own Serializable array.

  • Fps games for MBP13" 2011 onlinegaming

    Anyone know except COD modern warfare & CSS.
    Dont know if they will run good on MBP13" 2011, do anyone else? youtube film says ok, but i dont know really              

    Please repost in the Boot Camp forum.

  • Help needed for storing and sorting objects.

    Hello
    I have an assignment and it is to create a guessing game, here is the question,
    In this assignment you are to write a game where a user or the computer is to guess a random
    number between 1 and 1000. The program should for example read a guess from the keyboard, and
    print whether the guess was too high, too low or correct. When the user has guessed the correct
    number, the program is to print the number of guesses made.
    The project must contain a class called Game, which has only one public method. The method must
    be called start(), and, when run it starts the game. The game continues until the user chooses to
    quit, either at the end of a game by answering no to the question or by typing 'quit' instead of a
    guess. After each game has been played, the program is to ask the user for a name and insert this
    together with the number of guesses into a high score list. When a game is started the program
    should print the entire high score list, which must be sorted with the least number of guesses first
    and the most last. Note, the list must be kept as long as the game-object is alive!
    each score also
    consists of the game time. In case there are two high scores with the same number of guesses, the
    game time should decide which is better. The game time starts when the first guess is entered and
    stops when the correct guess has been made. There should also be input checks in the program so
    that it is impossible to input something wrong, i.e. it should be impossible to write an non-numeric
    value then we are guessing a number, the only allowed answers for a yes/no question is yes or no,
    every other input should yield an error message an the question should be printed again.
    I understand how to code most of it, except I am not sure how to store the playerName, playerScore, playerTime and then sort that accordingly.
    I came across hashmaps, but that wont work as the data values can be the same for score.
    Is it only one object of lets say a highScore class, and each time the game finishes, it enters the values into an arrayList, I still dont understand how I can sort the array all at once.
    Should it be sorted once for score, then another array created and sorted again, I dont get it I am confused.
    Please help clarify this.

    Implode wrote:
    We had the arrayList/collections lecture today.
    I asked the teacher about sorting objects and he started explaining hashmaps and then he mentioned another thing which we will only be learning next term, I'm sure we must only use what we have learned.
    How exactly can this be done. I have asked a few questions in the post already.
    ThanksWell, there was probably a gap in the communication. Hash maps (or hash tables, etc.) are instance of Map. Those are used to locate a value by its unique key. Generally, to speed up access, you implement a hashing function (this will be explained hopefully in class). Think of name-value pairs that are stored where the name is unique.
    Contrast this with items that are sorted. Any List can be sorted because its elements are ordered. An ArrayList is ordered, generally, by the order you inserted the elements. However, any List can be given its own ordering via Comparable or Comparator. You can't do this with an ordinary Map. The purpose of a Map is speedy access to the name-value pairs, not sorting. The List likewise has different purposes, advantages, disadvantages, etc. List can be sorted.
    A Map is generally similar to a Set. A Set is a vanilla collection that guarnatees uniqueness of each element (note, not name-value pairs, but simple elements). There is one concrete class of Map that can be sorted, TreeMap, but I doubt your professor was referring to that. The values or the keys can be returned from the Map and sorted separately, but again, I doubt he was referring to that.
    Take a look at the Collections tutorial here on this site or Google one. It is fairly straightforward. Just keep in mind that things (generally) break down into Set, Map and List. There are combinations of these and different flavors (e.g., Queue, LinkedHashMap, etc.) But if you can learn how those three differ, you will go a long way towards understanding collections.
    (Oh, and be sure to study up on iterators.)
    - Saish

  • Change Highscore list from ASC to DSC. Urgent

    Hi guys. I need help with changing the sort type of this code.
    I write the output in an jTextArea Field with Descending order. it looks like
    Viktor = 40
    Thomas=65
    Emil=30
    Alfred=120
    so you see that the names are sorted. i want the points (score) to be sorted.
    The data is saved into an properties file which looks so
    #Highscore-Properties
    #Mon Jan 22 22:12:48 CET 2007
    Viktor=80
    Dora=90
    Hans=200
    Bertie=1000
    Sepp=400
    public HighScore()
            throws Exception
                myScore.load(new FileInputStream(System.getProperty("user.dir") + File.separator + "score.properties"));
        /* returns Sortedmap mit key = Playername & Value-Score */
        public SortedMap getScoreList()
            SortedMap score = new TreeMap();
            Enumeration keys = myScore.keys();
            if (keys != null)
                while (keys.hasMoreElements())
                    String tname = keys.nextElement().toString();
                    score.put(tname, myScore.getProperty(tname));
    // HOW TO CHANGE THIS PIECE OF CODE?
                return score;
            return null;
        /* If player is in properties list and score is higher than the new
         * then it writes the higher score in the file.
         *@param nickname = player
         *@param score = Highscore
        public void setnewScore(String nickname, int score)
        throws Exception
            if (myScore.getProperty(nickname) != null && Integer.parseInt(myScore.getProperty(nickname).toString()) < score)
                myScore.setProperty(nickname,""+score);
                myScore.store(new FileOutputStream(System.getProperty("user.dir") + File.separator + "score.properties"),"Highscore-Properties");
            else if (myScore.getProperty(nickname) == null)
                myScore.setProperty(nickname, ""+score);
                myScore.store(new FileOutputStream(System.getProperty("user.dir") + File.separator + "score.properties"),"Highscore-Properties");
    I wrote the main method in my other visual class when the window is activated
    instead of the system.out.println i wrote
    jTextArea2.setText("Spieler: " + player + " Score: " + sm.get(player)+"\n"+jTextArea2.getText());
    writes all players who are in the score list (alphabetical ordered)
         *@param args
        public static void main(String[] args)
            try {
                HighScore hs = new HighScore();
                SortedMap sm = hs.getScoreList();
                Iterator ene = sm.keySet().iterator();           
                while (ene.hasNext())
                    Object player = ene.next();
                       System.out.println("Player: " + player +" Score: " +sm.get(player));
            } catch (Exception e)
                e.printStackTrace();
    }       I am sorry for my bad english.
    It would be very nice if someone could tell me what to change in my code.
    ty
    Message was edited by:
    Shadowli

    yes... the set and get scorelist is not from me.
    the tipp is good, but i can not code it because i am extreme java newbie.
    so it would be very nice if i get the pieces of code i need because i need the highscore list till tomorrow.
    in the meantime i tried other way round. set from nickname=score to score=nickname but because of the enumeration it sorts like
    50 hans
    30 thomas
    20 emil
    205 name
    19 name
    1394 emil
    0 name
    so please help me.

  • Online scores for iOS games?

    I have delivered my first application to iTunes using Flash CS5.5.
    You can view the game at this link: http://itunes.apple.com/app/necrorun/id444471709?mt=8
    Players and review sites are rightfully complaining about the lack of online highscores. However, as far as I know, you cannot use Open Feint nor Game Center when developing with flash.
    Is there a current solution to this?
    And Is there any official word from Adobe about this issue? Are they working on Game Center compatibility?

    The next full version of air will allow you too hook into external APIs (as I understand it). So a hook for game center could be written in x-code and then brought into flash. 
    Cool game btw, I hope you have some sucess with it
    -dis

  • How to create an online highscore

    i am creating a game and i would like to write a high score chart that is online for everyone to share their achievements. anybody would like to teach me how?

    am i right to say that after creating a server (any book you would recommend that teaches how to create the server step by step?) is able to receive and store the information (highscore etc.) i could also use it to create games where people can compete against each other through the server? how about if i want to create an online mini store in the app that uses real money to purchase? does these transactions also go through apple? or can i direct those funds straight to my bank account (and how do i go about these transections)?

  • Need countdown timer for game

    i'm making a shooting game i need a timer that counts down
    and then when it gets to 0 it goes to a certain frame. This is the
    code i'm using:
    var seconds:Number=10;
    time_txt.text="";
    function countDown(){
    var time=seconds--;
    time_txt.text=time;
    if(time=0){
    gotoAndStop("lose");
    clearInterval(counter);
    counter=setInterval(countDown, 1000);
    can any one help

    just in case this might help anyone tries to help
    here is the code i'm using for the game:
    stop();
    //Set global highScore variables
    highScore = 0;
    //Set the properties for the game elements
    _root.lastframe = false;
    //Stop bullets
    //See AS for bullet MC for details
    setProperty(_root.crosshair, _visible, true);
    setProperty(_root.bullet, _visible, false);
    //Individual destroyed target images hidden until needed
    setProperty(_root.target1d, _visible, false);
    setProperty(_root.target2d, _visible, false);
    setProperty(_root.target3d, _visible, false);
    //As above. Individual highlighted target images hidden until
    needed
    setProperty(_root.target1Image, _visible, false);
    setProperty(_root.target2Image, _visible, false);
    setProperty(_root.target3Image, _visible, false);
    mouse.hide();
    //hide mouse to use cross-hairs
    //select a target to shoot at random then add that target
    //to the array of selected targets so that it isn't used
    //again in this game.
    //When the number of direct hits against the selected
    //target has been reached. Find another random target.
    //Check whether it exists in the array. If yes, select
    //again. If no, make visible.
    _root.targets = new Array();
    //create array on the main
    //timeline so that it is
    //easily accessed by all MCs
    _root.targets[0] = "target1";
    _root.targets[1] = "target2";
    _root.targets[2] = "target3";
    //3 targets we are using in
    //tutorial
    n = _root.targets.length;
    //get length of array
    ran = random(n);
    //get random number location to select from array
    target = _root.targets[ran];
    //show random array location
    _root.activeTarget = target;
    //create target variable
    setProperty("_root."+target+"Image", _visible, true);
    //show target
    _root.targets.splice(ran, 1);
    //remove the random element
    //from the array. splice
    //the random number found and
    //to the depth of one so only
    //one element is removed.
    var seconds:Number = 10;
    time_txt.text = "";
    function countDown() {
    var time = seconds--;
    time_txt.text = time;
    if (time == -10) {
    gotoAndStop("lose");
    clearInterval(counter);
    counter = setInterval(countDown, 1000);
    any help will be appreciated
    Spud

  • Yesterday i bought order and chaos runes for many times and didnt get anything

    Yesterday and the day before ive tryed to purchase order and chaos runes. when i entered my app store password occured error -15. i have tryed to repeat operation for nearly 20 times and only after that i have realized that my money were removed from my credit card, but no runes were added. here is the topic
    at gamelofts forum. http://onlinegames-forum.gameloft.com/index.php?topic=19166.45
    they fixed their payment system but did not give back money or runes. also they said that is Itunes fault.
    So. Im waiting for my refund or runes.

    Go to your account on your computer and set the credit card to none. This will allow you to use the gift card.

  • Flash cs6 - local store for android app

    How can I local store something (like a highscore) with my android app ? (written with flash cs6) ?
    SharedObjects doesn't really work...

    Hi,
    thx for your answer!
    I tried it with this code:
    var sharedObject:SharedObject;
    sharedObject = SharedObject.getLocal('trtrtrtrtrtr');
    sharedObject.data.userName = "msmsmsmsmsmsmsm";
    sharedObject.data.age = 24;
    sharedObject.flush();
    After starting this app... i tried to find the file "trtrtrtrtrtr" on the tablet.
    But I didn't find it...
    Is it my mistake?
    Thank you!

  • Trying to make a higscore chart for applet

    hey im trying to make an highscore applet for a mathquiz applet and i need it to save the users score possibly as a cookie ryte now i am using:
    PrintWriter out
    = new PrintWriter (new BufferedWriter (new FileWriter ("file.txt")));
    But this only works on the HSA console, Also if anyone knows how to make an exit button exit the internet explorer that would help to. Thanks alot

    Sorry Sabre. Just trying to be a little realistic is
    all.I fealt you were a little too dogmatic and negative about the problems the OP might encounter.
    >
    Setting aside the server-side (servlet) problems,
    here are two questions I have about saving the high
    scores as a cookie
    1. (How) are you going to save the cookie? Normally,
    web browsers receive cookie updates and store them
    automatically. But since you'll be connecting through
    java, that won't happen. If that doesn't happen, how
    does the client know (aside from kludging the applet)
    what cookie to send along with its request?This link shows exactly how to do it (without the need for WebServer involvement).
    http://www.wildtangent.com/developer/howtos/JSCookiesHowTo/
    >
    2. A year or so ago I spent a good deal of time
    trying to fix up URLs and URLConnections so that I
    could save and return cookies, since this is not
    default functionality. I found that it was EXTREMELY
    difficult to both extract the cookie and to add it to
    the request. Perhaps you or others have had better
    luck with this.
    Right. Applets don't commonly allow you accessto
    the
    local file system. You can either report thescores
    to the server (assuming you can put a servletthere)
    or you can sign your jar file.
    You're never going to get this to work either.Why won't the OP get this to work either? One can
    easily self sign an Applet jar file and then allthe
    user has to do is to agree to allow the Applet to
    write the file!Again, sorry. My thought was that the work involved
    in learning and implementing either the servlet or
    local file system solution is going to take at least
    as much time as everything else combined. It is true
    that my experience with jarsigner and self-created
    certicates is limited, but the times I have gone
    through the process, it's just taken me forever.When the signing process is understood this is easy - even doing it manually. If one understand how to use Apache Ant then this is trivial to automate. If you would like to see a sample Ant script then I will post one (actually I use two scripts).

  • Make a High score for a game....

    Hello
    I'm tring to use RMS code to make a highscore to game - puzzle, but i have some problems
    // file 1 - Hiscore.java
    import java.io.*;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.rms.*;
    public class Hiscore
    implements CommandListener {
    private Display display;
    private RecordStore rs;
    private EnumList enumListScreen;
    private byte[] data = new byte[200];
    private ByteArrayInputStream bin = new ByteArrayInputStream(data);
    private DataInputStream din = new DataInputStream(bin);
    // Polecenia na soft keys w telefonie
    private Command exitCommand = new Command("Wyjscie",Command.EXIT,1);
    // Rekord danych
    private static class Record
         String firstName;
         String lastName;
    // Dane
    private static final String[][] names = {
         {"Jan","Kowalski"},
         {"Jakub","Sosna"}
    // stworzyc metode to pobierania imienia
    // Inicjalizacja i otwarcie magazynu rekordow
    public Hiscore()
    //throws MIDletStateChangeException
         // Midlet wywolany poraz pierwszy
         if (display == null)
              begin();
         if (rs == null)
              openRecordStore();
    private void begin()
    //     display = Display.getDisplay(this);
         enumListScreen = new EnumList();
         if(openRecordStore())
              enumListScreen.addDate();
              display.setCurrent(enumListScreen);
    public void exitMIDlet()
         closeRecordStore();
    // dodanie rekordu do magazynu
    private void addName (String first, String last,
              ByteArrayOutputStream bout,
              DataOutputStream dout)
         try{
              dout.writeUTF(first);
              dout.writeUTF(last);
              dout.flush();
              byte[] data = bout.toByteArray();
              rs.addRecord(data,0,data.length);
              bout.reset();
         catch(Exception e) {}
    // Wypelnianie magazynu danymi
    private void fillRecordStore()
         ByteArrayOutputStream bout = new ByteArrayOutputStream();
         DataOutputStream dout = new DataOutputStream(bout);
         for (int i = 0; i < names.length; ++i)
              addName(names[0],names[i][1],bout,dout);
    // Otwarcie magazynu rekordow
    private boolean openRecordStore()
         try{
              if (rs!=null) closeRecordStore();
              rs = RecordStore.openRecordStore("HiScore",true);
              fillRecordStore();
              return true;
         catch(RecordStoreException e){
              return false;
    private void closeRecordStore()
         if(rs!=null)
              try{
                   rs.closeRecordStore();
         catch(RecordStoreException e) {}
         rs = null;
    // odczytywanie recordow
    private boolean readRecord(int id, Record r)
         boolean ok = false;
         r.firstName = null;
         r.lastName = null;
         if (rs != null)
              try{
                   rs.getRecord(id,data,0);
                   r.firstName = din.readUTF();
                   r.lastName = din.readUTF();
                   din.reset();
                   ok = true;
              catch(Exception e) {}
         return ok;
    // Obsluga polecen
    public void commandAction(Command c, Displayable d)
         if (c == exitCommand)
              exitMIDlet();
         else
              display.setCurrent(enumListScreen);
    // Klasa obslugi glownego okna
    class EnumList extends List
         public EnumList()
              super("Magazyn Rekordow",IMPLICIT);
              addCommand(exitCommand);
              setCommandListener(Hiscore.this);
         public void addDate()
              try{
                   //utworz wyliczenie uzywajac
                   RecordEnumeration enum = rs.enumerateRecords(null,null,false);
                   Record r = new Record();
                   //odczytywanie rekordow i wypelnianie listy danymi
                   while(enum.hasNextElement())
                        int id = enum.nextRecordId();
                        if (readRecord(id,r))
                             append(r.lastName+", "+r.firstName,null);
              enum.destroy();
              catch(RecordStoreException e) {}
    // File 2 - Puzzle.java
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.lcdui.*;
    public class Puzzle extends MIDlet
    implements CommandListener,ItemCommandListener {
        private Command exitCommand = new Command("Wyjscie", Command.EXIT, 1);
        private final static Command CMD_PRESS = new Command("Gram", Command.ITEM, 1);
        private Form mainForm;
        Board b;
        String zasady = "Rulles.\n";
        TextField imie = new TextField("Podaj imie:", "", 15, TextField.ANY);
        public static String name;
        public Puzzle() {
             mainForm = new Form("Puzzle");
        public void startApp()
                mainForm.setTitle("Puzzle");
                mainForm.append(zasady);
                StringItem item = new StringItem("Gram","", Item.BUTTON);
                item.setDefaultCommand(CMD_PRESS);
                item.setItemCommandListener(this);
                mainForm.append(imie);
                mainForm.append(item);
                //Hiscore.EnumList();
                mainForm.addCommand(exitCommand);
                mainForm.setCommandListener(this);
                name=imie.getString();
                mainForm.append(name);
                Display.getDisplay(this).setCurrent(mainForm);
        public void commandAction(Command c, Displayable s) {
             destroyApp(false);
             notifyDestroyed();
        public void commandAction(Command c, Item item) {
             b = new Board(this);
             Display.getDisplay(this).setCurrent(b);
        protected void destroyApp(boolean unconditional) {
        protected void pauseApp() {
    } I want to launch Hiscore after winning game (name and time of winnig) but i can't (don't know what i'm doing wrong) lanuch it. Durring of testing I make a hiscore on beging but later it will be at the end of game after winnig.
    What are my mistekes. Why I can't launch it?
    Does anybody make a simple Hiscore, using RMS?

    Hello
    I'm tring to use RMS code to make a highscore to game - puzzle, but i have some problems
    // file 1 - Hiscore.java
    import java.io.*;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.rms.*;
    public class Hiscore
    implements CommandListener {
    private Display display;
    private RecordStore rs;
    private EnumList enumListScreen;
    private byte[] data = new byte[200];
    private ByteArrayInputStream bin = new ByteArrayInputStream(data);
    private DataInputStream din = new DataInputStream(bin);
    // Polecenia na soft keys w telefonie
    private Command exitCommand = new Command("Wyjscie",Command.EXIT,1);
    // Rekord danych
    private static class Record
         String firstName;
         String lastName;
    // Dane
    private static final String[][] names = {
         {"Jan","Kowalski"},
         {"Jakub","Sosna"}
    // stworzyc metode to pobierania imienia
    // Inicjalizacja i otwarcie magazynu rekordow
    public Hiscore()
    //throws MIDletStateChangeException
         // Midlet wywolany poraz pierwszy
         if (display == null)
              begin();
         if (rs == null)
              openRecordStore();
    private void begin()
    //     display = Display.getDisplay(this);
         enumListScreen = new EnumList();
         if(openRecordStore())
              enumListScreen.addDate();
              display.setCurrent(enumListScreen);
    public void exitMIDlet()
         closeRecordStore();
    // dodanie rekordu do magazynu
    private void addName (String first, String last,
              ByteArrayOutputStream bout,
              DataOutputStream dout)
         try{
              dout.writeUTF(first);
              dout.writeUTF(last);
              dout.flush();
              byte[] data = bout.toByteArray();
              rs.addRecord(data,0,data.length);
              bout.reset();
         catch(Exception e) {}
    // Wypelnianie magazynu danymi
    private void fillRecordStore()
         ByteArrayOutputStream bout = new ByteArrayOutputStream();
         DataOutputStream dout = new DataOutputStream(bout);
         for (int i = 0; i < names.length; ++i)
              addName(names[0],names[i][1],bout,dout);
    // Otwarcie magazynu rekordow
    private boolean openRecordStore()
         try{
              if (rs!=null) closeRecordStore();
              rs = RecordStore.openRecordStore("HiScore",true);
              fillRecordStore();
              return true;
         catch(RecordStoreException e){
              return false;
    private void closeRecordStore()
         if(rs!=null)
              try{
                   rs.closeRecordStore();
         catch(RecordStoreException e) {}
         rs = null;
    // odczytywanie recordow
    private boolean readRecord(int id, Record r)
         boolean ok = false;
         r.firstName = null;
         r.lastName = null;
         if (rs != null)
              try{
                   rs.getRecord(id,data,0);
                   r.firstName = din.readUTF();
                   r.lastName = din.readUTF();
                   din.reset();
                   ok = true;
              catch(Exception e) {}
         return ok;
    // Obsluga polecen
    public void commandAction(Command c, Displayable d)
         if (c == exitCommand)
              exitMIDlet();
         else
              display.setCurrent(enumListScreen);
    // Klasa obslugi glownego okna
    class EnumList extends List
         public EnumList()
              super("Magazyn Rekordow",IMPLICIT);
              addCommand(exitCommand);
              setCommandListener(Hiscore.this);
         public void addDate()
              try{
                   //utworz wyliczenie uzywajac
                   RecordEnumeration enum = rs.enumerateRecords(null,null,false);
                   Record r = new Record();
                   //odczytywanie rekordow i wypelnianie listy danymi
                   while(enum.hasNextElement())
                        int id = enum.nextRecordId();
                        if (readRecord(id,r))
                             append(r.lastName+", "+r.firstName,null);
              enum.destroy();
              catch(RecordStoreException e) {}
    // File 2 - Puzzle.java
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.lcdui.*;
    public class Puzzle extends MIDlet
    implements CommandListener,ItemCommandListener {
        private Command exitCommand = new Command("Wyjscie", Command.EXIT, 1);
        private final static Command CMD_PRESS = new Command("Gram", Command.ITEM, 1);
        private Form mainForm;
        Board b;
        String zasady = "Rulles.\n";
        TextField imie = new TextField("Podaj imie:", "", 15, TextField.ANY);
        public static String name;
        public Puzzle() {
             mainForm = new Form("Puzzle");
        public void startApp()
                mainForm.setTitle("Puzzle");
                mainForm.append(zasady);
                StringItem item = new StringItem("Gram","", Item.BUTTON);
                item.setDefaultCommand(CMD_PRESS);
                item.setItemCommandListener(this);
                mainForm.append(imie);
                mainForm.append(item);
                //Hiscore.EnumList();
                mainForm.addCommand(exitCommand);
                mainForm.setCommandListener(this);
                name=imie.getString();
                mainForm.append(name);
                Display.getDisplay(this).setCurrent(mainForm);
        public void commandAction(Command c, Displayable s) {
             destroyApp(false);
             notifyDestroyed();
        public void commandAction(Command c, Item item) {
             b = new Board(this);
             Display.getDisplay(this).setCurrent(b);
        protected void destroyApp(boolean unconditional) {
        protected void pauseApp() {
    } I want to launch Hiscore after winning game (name and time of winnig) but i can't (don't know what i'm doing wrong) lanuch it. Durring of testing I make a hiscore on beging but later it will be at the end of game after winnig.
    What are my mistekes. Why I can't launch it?
    Does anybody make a simple Hiscore, using RMS?

Maybe you are looking for

  • Report Custom object with product?

    if I want to create a report with the fields of a custom object in relationship with the fields of the product,is possible? Because when i cilck in Analytics there aren't Custom Object link and in Product History isn't present the Object link where i

  • View resizes when it shouldn't

    http://www.adobe.com/devnet/flex/articles/mobile-development-flex-flashbuilder.html#articl econtentAdobe_numberedheader_1 On this page it says: "When the user rotates the screen between portrait and landscape orientations, the View is automatically r

  • TS2446 I can not remember my security question answers so I have been locked out what do I do?

    I can not remember the answers to my security questions so I have been locked out. They wanted me to answer them because I am using a new computer.

  • SQLStmtException - execute query ?

    I am getting an error on execute query : oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (SELECT too.inventory_item_id, too.organization_id, too.machine,

  • W520 DWM crashes after undocking

    I have a highly repeatable issue where my Desktop Window Manager (DWM.exe) will crash after going from a docked state to undocked.  It does not happen immediately.  It could be up to an hour after undocking but usually occurs when I switch from one w