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?

Similar Messages

  • How can I make a high scores list?

    I've heard a lot of options. I've tried writing to a perl script, I've read about signing an applet (which seems needlessly complicated). I just would like to know what is the easiest way to save a list of 10 high scores for a game that I'm making? If anyone out there has tried this already any advice would be REALLY appreciated
    thanks!

    What I'm trying to do is make just a high scores list for the game as a whole. It will be one high scores list of 10 names/scores that will be there for the applet. I already have everything set up to read the scores and order the scores in the program, i just need to know what the best way to save them permanently for the next time they need to be used is. I have the scores saved in a string array and I could write all the code myself to get those strings set up in whatever format I may need. But I just need to know how to save them once the applet is closed.

  • Username to submit high scores for games?

    Hey, so I don't know what my username or password is so I can submit my high scores for games like brickbreaker and wordmole.
    Tbh I don't even know if I have a username lol or how to set it up.
    Any help would be greatly appreciated.
    Solved!
    Go to Solution.

    Hello StarBlue03,
    If you aren't sure if or what your user name is, you can create a new one.
    KB17723 will show you how to do this.
    Thanks! And have a great day
    -HMthePirate
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • I have a really high score on a game app on the ipad 2 ... Can I sync or transfer ONLY that game to my ipad 3 somehow ???

    I have a really high score on a game app on my ipad 2 ... I want to sync, or transfer, or move somehow,  the app with the high score to my ipad 3... Can I do it without syncing the whole ipad?? Or is there another way to get the game app to my "3" ???

    You would need to backup your data to iTunes or iCloud and then restore from backup on the iPad 3. Content should reside on your computer or you can reload apps from the cloud. I don't believe you can just restore one app
    http://support.apple.com/kb/HT1766?viewlocale=en_US&locale=en_US

  • So i have created a quiz with scoring and stuff but now i want to make a high score system just for one user any ideas?

    The questions each have a invisible dynamic text box that when the right answer is pressed it goes up by one and at the final score page i have a dynamic text box which has a simple code which adds the contents of these invisible text boxes, so i need a code which would use another dynamic text box which will hold the high score of the player, all i need is a one player and session cookie high score system any ideas anyone? (this is action script 2 BTW)

    you can use the sharedobject if you only want each user to compare their own scores.

  • How to reset a score for a game in the game center back to zero? and I tried deleting the game and reinstall it

    I play Subway Surfer on my other account on my iPad so a friend of mine cheated and got a very high score now I want to reset this score back to zero so is there a way to do that or I have to delete the game and create a new apple ID for my iPad

    Hi Nick,
    If you have an X Series or 2nd Generation cDAQ chassis (basically any cDAQ chassis except for the 9172 or 916x sleeves) then you can implement:
    1,2,3,4,5,6,7,8,9,10,(reset),1,2,3,4,5,6,7,8,9,10,(reset),1,2...
    You would have to configure an Edge Count Task, set the initial value to 232 - 6 (such that the 6th count causes the counter to rollover, which generates a pulse on the counter output), and enable the count reset using your external signal:
    The count reset isn't currently available for other DAQ devices, but I believe it should be available on M Series (62xx) and TIO (660x, 6624) with a future driver release (some time in 2012).
    If you don't have an X Series (or gen II cDAQ), don't despair.  On other hardware, you can get close to the previous behavior with a counter output task, with the exception that the "reset" signal would only be detected after the 2nd tick after your pulse is output.  Also, the reset signal would have to occur at the beginning to arm the counter the first time.
    Or, you can get the 3rd behavior that you asked for by doing a continuous counter output task with the external signal as the source of the timebase ticks.  For example:
    1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9
    In toggle mode (default):
    6 ticks of initial delay, 2 ticks high, 7 ticks low, 2 ticks high, 7 ticks low, ... etc.
    In pulse mode:
    6 ticks of initial delay, 9 ticks high, 9 ticks low, 9 ticks high, 9 ticks low, ... etc.
    See here for an overview of the difference of the two modes.  Basically, pulse mode will emit a short pulse when TC is reached, and toggle mode will toggle the state of the counter.  You can't have less than 2 ticks as a high time, low time, or initial delay.
    Best Regards,
    John Passiak

  • How do I make a main menu for a game?

    Hi,
    I need to make a main menu for this tower defense game that I am making.  I have 2 parts to the menu that I need to put together.  I have it as follows:
    I have a start screen where the player presses the start button.  I now need it to take the user to the main menu itself.  I have both the start menu and main menu in the same document but on different layers.  I have a button labeled as start which I have set up to where when it is clicked, it changes colors but I also need it to hide/show the menu layer.  I just need the that start button to take users to the menu layer where I have 3 more buttons which are resume, new, and options.  I will need those buttons to go to their different layers also.  After users hit the resume or new buttons, I need the game itself to start which I will start making after I figure out the other issues. 
    I am new to Flash and I really want to learn how to make tower defense games.  For now, I am using http://www.ehow.com/how_7788131_make-tower-defense-game-flash.html as a guide to make the game stuff but it doesn't say anything about a main menu.  I am using a trial version of Flash Pro CS6 and it is due to expire in 28 days.
    Any and all help will be great! Thanks, xp3tp85

    I used this and it worked:
    import flash.events.MouseEvent;
    start_button.addEventListener(MouseEvent.CLICK,startF);
    function startF (e:MouseEvent):void{
    gotoAndStop("main_menu");
    On the next layer I used this and it worked too:
    back_button.addEventListener(MouseEvent.CLICK, buttonClick);
    function buttonClick(event:MouseEvent):void{
           gotoAndStop(1);
    Apparently it wont let me use the same code twice on one timeline.  Is there any way around this?  I need a few more buttons on the main menu for the game.

  • 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

  • Score For My Game

    Is there an actionscript for a point system? I want my points to be time based from this script
    stop();
    count = 60;
    countdown = function(){
    count--;
    if (count ==0){
    clearInterval(doCountdown);
    gotoAndStop(11);
    clearInterval(doCountdown);}
    doCountdown = setInterval(countdown, 1000);
    Help?

    Don't use the variable feature of the textfield.  Assign the textfield an instance name (let's say you name it scoreText), and when you are ready to add text to it use
    scoreText.text = 8 * (60 - count);
    If you are still getting NaN, that probably means your count variable is no longer in scope for where you are on the timeline.  So the easiest way to manage this for you would probably be to use count as a _global variable, meaning, everywhere you use count, you instead use _global.count.  Another way would be to have a layer dedicated to shared data that extends the entire length of the timeline, and in that layer you could declare:
    var count;
    That way, count will be avaiable to anything along the timeline.

  • Best idea for submmit high Score for ios Developers?

    hi guys .
    i want social networking similar to Apple Game Center Or OpenFeint that suppurted in flash ?
    anybody know how to submit highscore , and where submit ?

    APC Back-UPS XS 1300.  $169.99 at Best Buy.
    Our power outages here are usually only a few seconds; this should give my server about 20 or 25 minutes run-time.
    I'm setting up the PowerChute software now to shut down the computer when 5 minutes of power is left.  The load with the monitor sleeping is 171 watts.
    This has surge protection and other nice features as well.
    -Noel

  • High Score and Applet

    Dear All,
    I'm trying to put a high scroe system in my applet (game). Therefor I would like to write a file (that is located on my ftp server) were I can save the scores. But how do I acces that File ? With an aplication it's easy, but applet doesn't do it (not even offline) I have thought about the following solutions:
    1) Direct acces file and change it (read, change,safe)
    2) Download the file to temp directory of user en edit is en then upload it trough FTP
    3) Save the high scores in a database ?
    I get the following error if I try to use the same code as in a application:
    java.security.AccessControlException: access denied (java.io.FilePermission highscore.txt write)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkWrite(Unknown Source)
         at java.io.FileOutputStream.<init>(Unknown Source)
         at java.io.FileOutputStream.<init>(Unknown Source)
         at java.io.FileWriter.<init>(Unknown Source)
         at Bestandentest.init(Bestandentest.java:24)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Please Help me

    @ zadok : If I use this I can nog save other players
    there high scores.You would still need to send it back to the server see DrLaszloJamf 's post. The advantage here is that you could make changes to the format of the table and not have to change to program.
    @Dr : I want a global high score for the game and
    keep it on my server. In a file or database. Because
    I thought I couldn't save it in an applet. A cookies
    doesn't solve the problem here unfornutlyI think that is what he is saying.
    >
    Whats's a servlet ?Google.

  • Flash Game High Scores Board

    Hello everyone,
    I know this is a subject that gets covered a lot as i have found a ton of tutorials that show a million dfferent ways to create a high scores board on a flash game.  So i decided to go out on a limb and pick a tutorial out to try.  Well I have now tried 3 different ones and have yet to get a working high scores board with my game.
    http://www.flashkit.com/tutorials/Games/How_to_c-Nick_Kuh-771/index.php
    That is the link to the most recent attempts to creat my high scores board.  When i finished everything the way the tutorial said it seemed like everything would work and then it just didnt.  After spending oh about 40 plus hours trying to make a high scores board i am getting very frustrated.  My game is scripted in AS2 and i have access to mysql and can set up unlimited databases.
    Can anyone please help me by sending an easy to follow tutorial that will work with AS2?  I would just like any kind of help right now as I feel ALL of my valid ideas have been ehausted.  Thanks in advance to anyone that can help!
    kapelskic

    Okay not a problem.
    This is my code on the very first frame of the game that initializes the the highscores.php script
    command = "init";
    _root.loadVariables("highscores.php?"+int(Math.random()*100000), "POST");
    This is the code that I have on a submit button, next to the input text box where the user enters their name for the scoreboard.
    on (release) {
    if(name ne ""){
    command = "update";
    _root.loadVariables("highscores.php?"+int(Math.random()*100000), "POST");
    gotoAndStop ("highScores");
    In every place the code says _root. I have also tried this. and neither of them work.  I have also tried a million other things.  So far the game plays through, goes to the game over screen where it asks for a user name and tells them their score.  Then once they press submit the game goes to the highScores screen but the name and score are not there.  The high scores screen cosists of 2 dynamic text fields one named "players" and one named "scores".  I hope this helps because I spent another 5 or so hours after my initial posts trying more tutorials with still no luck.  (the problem i am having is that i am new to flash, however not to PHP)
    kapelskic

  • Help with online high scores

    I'm working on a marathon runner game ( http://www.locopuyo.com/MarathonRunnerBeta1.zip ) just for the fun of it. What I am wondering is what the best way to make a high scores list would be.
    I have mySQL on my server, I don't know if that is the best way to do it though.
    I don't know at all how to connect files on the internet with java.
    I was thinking it might be easier if I just had a plain html web site that I could edit in my java program using ftp, but I don't know how to do that and dont' even know if it is possible.
    Any help would be much appretiated.

    since you have MySQL on your server, I'm going to go ahead and assume you have PHP installed also. If so, you can do the highscore work in PHP and just have the game query that script. Basically (if you know anything about PHP and web queries in general) you just query the URL of the PHP script with a few GETVARS. In the simplest (and most easily hacked) way is something like:
    http://yourserver.com/game/highscore.php?action=submit&name=bob&score=5000highscore.php (your script) would then use MySQL to store the data of the GETVARS ($action,$name, and $score).
    All you need in Java to query this script is the URL class.
    URL url = new URL("http://yourserver.com/game/highscore.php?action=submit&name=bob&score=5000");
    url.openConnection(); // this is where it is queriedhighscore.php is where you need to do your database work. If you don't know anything about PHP or if this sounds too easily hacked, you might look into connecting to MySQL via JDBC (see tutorial)
    If I find the time I can make a simple template for you to build off of

  • High Score Security

    Hi I recently made a game(dosen't really matter what kind) in which the user gets a score and saves the score to my high score table.
    I do this by connecting to a .php page and passing the score and name variables on to it. (www.random.com/blablabla.php?name=bla&score=676) The page then opens the mySQL table and saves the high scores. THe page is opened from within the applet and the user dosen't see the page opening.
    The problem I am having is security, and i'm trying to make it so that nobody can access that php page from their browser and input whatever score they want and what not. THis was brought to my attention by my friend who put images(none rude) and hyperlinks allover my high score page. He was nice enough to tell me so now I am trying to fix it.
    THe first steps I took were to not package the source code with the jar(which he downloaded and extracted). But even then I could decompile the class file and search the file for ".php" and easily know what url to type into the browser to input any score for my game. I then tried using an obfuscator, ProGuard, which didn't help me much. It only renamed all the classes and variables, but the String I open for the high score I still very easily visible. Also from other people I got the general opinion that they(obfuscators) aren't much good as they only make it slightly harder to people to get the information, not make it impossible.
    Basically what I want to do is to make it as hard as possible for people(namely my friend...) to find out the page which saves the high scores, and type it into their browsers so they can input whatever high score they want. Obfusticating didn't help much and now I am running out of ideas. I was thinking about:
    Making sure the thing that oppened the page is an applet, but I'm not sure how to do this. This would be my ideal solution as I am not too worried about people who would go out of their way to make an applet with the same name as mine just to "hack" my high scores which aren't even worth hacking. But how would I go about doing this?

    You could do this using a client/server system comminicating using sockets, rather than simply a HTML request sent from the client. This way the client could be required to provide some validation before the server accepts score updates from it.
    The trick is to decide how the validation is done; you need to be able to differentiate between genuine clients and a client your friend has decompiled and changed so he can cheat.
    Remember that your friend can see exactly how the client works, but cannot see how the server works. Maybe you could send a copy of the client class object to the server and then the server could checksum it?

  • High Score Lists

    I am new to Java--I started learning about 2 weeks ago. I have just programmed my first game in Java, but I don't know how to make a high score list. As of now, during gameplay, the game keeps track of the user's score like this:
    g.drawString("Score: " + GameState.cur.tailLength*10, 25, 30);GameState is a class. cur is an instance of GameState.
    tailLength is an integer variable that keeps track of how long the tail is (the game is a snake game, where you eat food and your tail grows & scoring is 10 pts per food eaten).
    If anyone has any ideas for how to make a high score list inside the java applet, I would greatly appreciate it.

    You're going to need to store previous game scores somewhere (start with an ArrayList) when each game has ended. Then, you can draw then whenever you want to. Later on you can store the scores in a file or even a database.

Maybe you are looking for

  • Need help understanding ipv6

    Hi... I have a new wireless network camera and I've been successful at getting it connected but there is a big question as to whether I have the ipv6 part of it set up correctly... By the way, on the router end I have an AEBS... I've been trying to u

  • Oracle Object Views Jdeveloper compatibility

    Our application has been designed OOAD and documented in UML. We mapped the UML class diagrams to relational tables and created Oracle object views on top of these tables. From these views we can now generate C++ code with OTT. However, trying to acc

  • RoutingEngineException

    Hi, We have populated PARTITION table… We have only 301 records in NODE_PART table. So we used procedure as exec SDO_ROUTER_PARTITION.partition_router('NODE_PART', 20); result of the above is SQL> exec SDO_ROUTER_PARTITION.partition_router('NODE_PART

  • Can't find PPCS6 purchase in download history to reinstall

    I bought Production Premium CS6  studnet edition around january. I recently updated to OSX Mavericks on my Mac but first wiped the whole drive backing up my aplications folder. When i went to open premiere an error came up saying that i needed to rei

  • I lost my home network!

    Hi, I recently installed a new router - WRTP54G . I used to have our 2 machines on a home network. However, that is all gone now. When I open My Network Places on my pc, nothing at all appears. On the other pc only the shared folders on that pc appea