J2Me game programming plz help

Helo everyone,
I am working in j2me game programming plz if
any one know how make image as small as possible
in our game program.?
I am using *.png format of image which is working well
in game but my game size is very big so plz help me to get
out of this problem
Thank u
Aman Gautam

I solved the same problem by using indexed color images instead of true color.
So, for example, if you have a colorful background you can convert it to a 256 color image.
Depending on your specific image and the devices you'll see it on you may or may not notice the difference, but the file size is generally smaller.
Then you can push further for smaller elements, like, say, a moving object like a pointer or a starship, you can reduce it to 60 or 30 colors, or even less.
Another technique is to use tiles to build up the background instead of big images. With MIDP2.0 there's the TiledLayer, but you can implement the same with some code also on MIDP1.0 if backward compatibility is of concern.

Similar Messages

  • J2ME game programming

    Helo everyone,
    I am working in j2me game programming plz if
    any one know how make image as small as possible
    in our game program.?
    I am using *.png format of image which is working well
    in game but my game size is very big so plz help me to get
    out of this problem
    Thank u
    Aman Gautam

    hi,
    if you want to do any kind of game programming in J2ME, i suppose you would require to use the Canvas class, well there are a few good resources.. try out
    www.billday.com
    www.javamobiles.com..
    that ought to get u started.
    cheerz
    ynkrish

  • New site about J2ME game programming and optimization

    Hello!
    I just wanted to tell you about a new J2ME development site
    SupremeJ2ME found at
    http://supremej2me.bambalam.se
    It has a lot of useful guides and tips about mobile J2ME game development and optimization, a forum and information about the best J2ME tools.
    Check it out!
    cheers,
    Cranky

    J2ME Polish have licensing costs associated with it:
    http://www.j2mepolish.org/licenses.html
    As for Canvas VS GameCanvas:
    GameCanvas is MIDP 2.0 and up, so depending which devices your app supports you might want to stick with Canvas. GameCanvas eases graphics flushing, but double buffering can be implemented on Canvas like so:
    Image offscreen = isDoubleBuffered () ? null :
               Image.createImage (getWidth (), getHeight ());See http://www.developer.com/java/j2me/article.php/10934_1561591_8
    section: Avoiding Flickering

  • Not able to copy a program plz help

    hi experts
    i ill have to create a copy of program SAPMSM20 (transaction sm20) .
    when i am copying the program in the output it is hsowing some different output .
    or i can say
    in case of SAPMSM20 it is calling screen 300
    but wen i copied it
    it is calling screen 200.
    plz copy this program at your end and tell me how can i copy it to get the same output as in SAPMSM20.
    thanx in advance .

    Hi Anit,
    try this:
    DOWNLOAD PROGRAM ==============
    http://www.sap-img.com/abap/download-and-upload-your-abap-program.htm
    visit http://www.dalestech.com
    Can check these links also.
    http://sap.ittoolbox.com/code/archives.asp?d=1623&a=s&i=10
    http://www.members.tripod.com/abap4/Upload_and_Download_ABAP_Source_Code.html
    http://www.geocities.com/rmtiwari/Resources/Utilities/WebViewer.html
    http://sap.ittoolbox.com/code/archives.asp?d=3333&a=s&i=10
    http://www.sap-img.com/abap/download-and-upload-your-abap-program.htm
    Hope it is helpful.
    Manish
    Download program and Classes.Download program and Classes.
    ZREPTRAN_46C appears to allow downloading of classes
    http://www.xaption.de/downloads/developer/index.php?Xaption=cd4ab5a11a5c26d34de38ed675bb6541
    http://wiki.ittoolbox.com/index.php/Code:Download_and_upload_OO_ABAP_class_in_XML_format
    <b>Reward points if this helps.
    Manish</b>

  • Need code for the following chess game..plz help me out

    Hi,
    Problem:Move the chess piece "KNIGHT" from any location on a "3 x 3" Chess Board and make it go to the far right hand bottom corner.Chess Board in the problem is not the usual Chess Board of 8 x 8.KNIGHT starting position may be any position on board.Program should exit when knight moves to 3 x 3 corner.Here is how my Chess board looks.
    |.... |.... |.... |
    |.... |.... |.... |
    |.... |.... |Queen |<<--The Queen should reach this position
    Remember: KNIGHT moves in specific way such as 2 steps in one direction and 1 step left/right.If the KNIGHT starts are position (2,2) then it cannot move further and you have to throw exception with some error message.
    Run command: "java <some class> x y", where x is x-coordinate and y is y-coordinate(starting position of Knight) on the chess board. For this problem x & y could be 1(min) and 3(max) values and any value(2) in between.
    Deliver : 1) Send me the java code for above problem.
    2) Java code should compile and run.
    3) I will be interested in "Object Oriented Design" thaught process.
    4) Your coding style
    5) Javadoc
    6) Makefile
    I would be more interested in your class design, interface design and error handling.
    please mail the solution to [email protected]
    thanks n regards
    Chinu

    Hi, Here Knight moves like horse. Queen doesn't
    exist. If knight moves to (3,3). Game will be over.
    I am facing problem to move knight from one point
    to another point. And also i have some confussion on
    selecting interfaces and classes.<font size="10000">do your own homework</font>

  • My thread program plz help

    have done this so far, but I am getting an error on main class
    I believe its how to get the command (BufferedReader and StringTokenizer methods)
    Please give me a hint. Code Below:
    by the way, I have to create myshell with differents commands working in differents threads. (working on NetBeans)
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.util.StringTokenizer;
    public class MyShell
    public static void main(String args[]) throws IOException
    boolean exit = false;
    while (!exit)
    // Modification of txt into String
    System.out.println("There is MyShell >>> ");
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    // Devide whole string into different sub-strings(tokens)
    // and check if there is more tokens to read.
    String input = in.readLine();
    StringTokenizer token = new StringTokenizer(input, "&");
    while(token.hasMoreTokens())
    String[] command = new String[3];
    command[0] = "cdm.exe";
    command[1] = "/C";
    command[2] = token.nextToken();
    if(command[2].equals("exit"))
    System.exit(0);
    exit = true;
    Runtime run = Runtime.getRuntime();
    Process proc = run.exec(command);
    thread_1 errorMessage = new thread_1(proc.getErrorStream(), "ERRORp");
    thread_1 outputMessage = new thread_1(proc.getInputStream(), "Output ");
    errorMessage.start();
    outputMessage.start();
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    class thread_1 extends Thread
    InputStream input;
    String str;
    thread_1(InputStream input, String str)
    this.str = str;
    this.input = input;
    // Override run method
    public void run()
    try
    InputStreamReader iReader = new InputStreamReader(input);
    BufferedReader bReader = new BufferedReader(iReader);
    String output = null;
    while ((output = bReader.readLine())!= null)
    System.out.println(str + ">>> " + output);
    catch (IOException e)
    e.printStackTrace();
    }

    There is my main + thread_1 class:
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.util.StringTokenizer;
    public class MyShell
        public static void main(String args[]) throws IOException
            boolean exit = false;
            while (!exit)
                // Modification of txt into String
                System.out.println("There is MyShell >>> ");
                BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                // Devide whole string into different sub-strings(tokens)
                // and check if there is more tokens to read.
                String input = in.readLine();
                StringTokenizer token = new StringTokenizer(input, "&");
                while(token.hasMoreTokens())
                    String[] command = new String[3];
                    command[0] = "cdm.exe";
                    command[1] = "/C";
                    command[2] = token.nextToken();
                    if(command[2].equals("exit"))
                        System.exit(0);
                        exit = true;
                    Runtime run = Runtime.getRuntime();
                    Process proc = run.exec(command);
                    thread_1 errorMessage = new thread_1(proc.getErrorStream(), "ERROR");
                    thread_1 outputMessage = new thread_1(proc.getInputStream(), "Output ");
                    errorMessage.start();
                    outputMessage.start();
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    class thread_1 extends Thread
        InputStream input;
        String str;
        thread_1(InputStream input, String str)
            this.str = str;
            this.input = input;
        // Override run method
        public void run()
            try
                InputStreamReader iReader = new InputStreamReader(input);
                BufferedReader bReader = new BufferedReader(iReader);
                String output = null;
                while ((output = bReader.readLine())!= null)
                    System.out.println(str + ">>> " + output);
        catch (IOException e)
            e.printStackTrace();
    }There is the ERROR:
    init:
    deps-jar:
    Compiling 1 source file to C:\Documents and Settings\PlinioG\My Documents\NetBeansProjects\MyShell\build\classes
    compile:
    run:
    There is MyShell >>>
    dir
    Exception in thread "main" java.io.IOException: Cannot run program "cdm.exe": CreateProcess error=2, The system cannot find the file specified
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
            at java.lang.Runtime.exec(Runtime.java:593)
            at java.lang.Runtime.exec(Runtime.java:466)
            at MyShell.main(MyShell.java:38)
    Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
            at java.lang.ProcessImpl.create(Native Method)
            at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
            at java.lang.ProcessImpl.start(ProcessImpl.java:30)
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
            ... 3 more
    Java Result: 1
    BUILD SUCCESSFUL (total time: 7 seconds)

  • HT1677 I don't understand all of the jargon but I'm trying to install java to be able to play online games? Plz help

    I really don't understand what I need to do to enable Java. Can u walk me through the steps?

    Java is not supported/will no run on any iOS device, including the iPod touch.

  • J2ME game project advice

    Hey guys, i was hoping to get some advice on a project i am about to start. basically I have just started learning J2ME, using Netbeans. i have went through few tutorials from Hello World to Pong and completed them working fully. Now my project is something not too difficult I hope what i wanted to do was create a dungeons and dragons type game.
    Basically I see my game as a start screen, the user presses start and then the player enters a castle and then there are either 1-4 doors available to walk into one on each side of the screen, the bottom door will always be to take the player to the previous screen.
    I have just started the project, but before I even enter any code i was hoping I could get some advice form you guys first. IN each room I hope to have things for teh player to interact with, wether it is a treasure chest, dragon, another human or traps, I have not decided yet.
    I was thinking of having a class one for each screen, but many screens means many classes. I am not even sure how to start with the titlescreen as i am completely new to J2ME.
    any help would greatly appreciated!
    Thanks!

    I was thinking of having a class one for each screen, but many screens means many classes. I am not even sure how to start with the titlescreen as i am completely new to J2ME.No, that is not what you want. Like you should always do in programming, do-not-start-with-the-code. Very bad practice!
    Start with a piece of paper and draw some simple screen designs. Menu, in game screen, control widgets, etc. Get something visual going quickly.
    Next, Use some proper non-programming related terms to describe the game and stick to them. You do not have screens, you have rooms. Each room has doors in its walls which leads to another room. All the rooms together form a maze. Each room has different properties. It can have 1-4 doors, it might hold an item, a trap, an enemy, etc.
    Given from the short description I have given you, you should already be able to distill a simple design. You can already easily identify two main classes: Maze and Room. A Maze consists of rooms. Each room links to 1-4 other rooms through a door. Each room has zero or more elements in it which are different from room to room. You will want to be able to control per room what it contains. I smell a simple grid based data structure; but then you still need a way to actually create the data for the game. There are two basic options: create a level editor, or auto-generate the mazes based on some simple rules. The latter would be the best choice in this case, as you get endless levels. The former has the benefit of having precise control over the design and difficultly of a maze.
    Auto generated levels become more difficult when you want to add an option to save progress though, as you'd need to be able to not only recreate the level (hint: generate based on a seed) but also restore the progress that the player made in that level. Its up to you really.
    When you have your game fleshed out, its time to start taking the technology into account. You'll have a nice set of functional and technical requirements that you need to fulfill; a good resource on J2ME game programming will probably help you to fulfill most of them. Don't expect to just be able to do this, you'll need to study J2ME a lot and probably do a whole set of test and play programs before to figure out how to do even the simplest things. I recommend you get a good book in stead of trying to piece it together using the internet, in moments like this you need something coherent in stead of something as fragmented as the web.

  • Plz help me,after instuling the last software update,the programs and games and everything i have download it can't open!

    plz help me,after instuling the last software update,the programs and games and everything i have download it can't open!

    Have you tried the basics from the manual?
    restart, reset, restore.
    iPod touch User Guide (For iOS 4.3 Software)

  • Plz help me in j2me programming

    Hello friend,
    I am making progress bar in j2me which is made by Gauge class.
    here iam fetching data from jsp page..in between all data process and come on to mobile screen i want to show progress bar on screen..plz help me how can i bind my process with Gauge..
    if u understand me plzz try to solve my problem...
    Thanks in advence
    Aman Gautam

    As this FS seems to be for lingerie company "Victoria's Secret" could points be converted to underwear instead of t-shirts?
    Tip: If you're going to post an entire spec you may want to remove the customer's name first.

  • I have downloaded a game called temple run, it is stuck downloading under the game it sayz 'Waiting' i have 3 other apps like that and my Smurfs game updating it is stuck too like that ! I have alot of apps so i dont want to delete date!!!! Plz help!!!!

    I have 4 apps that i just downloaded and they are 'Waiting' i need some one
    To plz come up with a solution i dont want to erase my data cause i have over
    100 games paid and free PLZ HELP i also have my smurfs game updating
    And i cant get on it now cause
    It wont update plz help!!!!!!!

    These links might be of help:
    Troubleshooting applications purchased from the App Store
    iPhone, iPad, iPod touch: Turning off and on (restarting) and resetting
    iPod touch: Hardware troubleshooting
    I would use these links in order { if the info on first link doesn't work, move to second link }

  • About game programming.. please....help

    How to define game map for java midlet
         If I see the rpg game, it have default map. I want to know how to translate it to code
         in midlet? The map will be existed image or dynamicly generated?
         Like Prince of Persia Midlet version, I wonder how to generate the environment?
         Is it pixel generated or immutable image?
    detect collision
         SO if the map is image and the sprite game is draw over the map, how can we detect the
         collision?
         Please hellp me.... because I want to be game programmer for midlet but I
         didn't know about game programming before

    to write a small game in midl is already a hard work. to make a big one, take a look of a team of programers.
    about maping, there is no such thing. wire every thing by yourself. by books or read tutorials.
    as i already said. no easy task.
    but keep on trying. if you need some help write me a mail.
    [email protected]
    jeliel
    (sebastian)

  • Plz Help! How to control mouse motion(use program to move/click the mouse)?

    Hi people, plz give me some help on this: I wanna control mouse motion at another program's window, eg. control mouse movement in Internet Explorer's window. For a particular pixel on the screen, I need to move the mouse onto it instantly, then click. Please note that the java program(no applet) is going to run at the background, the current active window is some other programs like IE, notepad, etc.
    Plz give me some clue about how to achieve this, thanks.
    Do I need to do this through windows API or it can be done purely in JAVA?
    Also, how to calculate the RGB color from a particular pixel on the screen?
    Thank you very much for your time, plz help :).

    The same question each day (exe) !!!
    There are many posts on this point!
    All the soft that allows the build a native executable file on Windows
    are not free!
    You can take a look at JET excelsior
    http://www.excelsior-usa.com/home.html
    Denis

  • I keep on getting asked to put account details i do but it declines the details but then when i want to download a free game i still have to put my bank details plz help me been like this for around 8 months : please help

    I keep on getting asked to put account details i do but it declines the details but then when i want to download a free game i still have to put my bank details plz help me been like this for around 8 months :< please help

    Hi.
    I'm not sure of it's still possible to choose 'None' under payment method. Besides, I'm sure you would like to be able to buy paid Apps as well.
    Try edit your payment information from a PC/Mac instead of your phone.
    Open iTunes > Choose 'iTunes Store' > Upper right corner, select your account or 'Sign in' > (When signed in) Click your account and go to 'Settings'.
    Make sure your credit card qualify for use in the Apple Store.
    Best regards.

  • How do i pass parameters from j2me to jsp?plz help

    hi everyone...
    i m doing my final year project
    can anyone plz tell me how to pass parameters like user name,password,etc.. from a j2me midlet to a jsp page running in tomcat server?
    i tried passing parameters in http connection through url as:
    String url="http://localhost:8080/example/test.jsp?name=abc";
    i need this info urgently as i am not able to proceed with my project... plz help
    any suggestions or references would be appreciated...
    thank u...
    regards,
    Rinzi

    JHD
    hi.
    you have written in URL i sperfectly right but if this is also not complete one.
    i.e url = "http://localhost:8080/dir/xxx.jsp?userName=jasmit&password=vala"
    now when u establishing connection i.e
    HttpConnection con = (HttpConnection) Connector.open(url,3);
    this will work as an declaration but if u want to send that parameter for that you have to get response from the server and that time only original connection is going to establish i.e
    when u r writting
    int responseCode = con.getResponseCode();
    if(reponseCode == 200)
    then ur parameter were passed to jsp page.
    in jsp page u have to get parameter using request class
    String userName = request.getParameter("userName").toString();
    String password = request.getParameter("password").toString();
    i hope this might solve ur problem.
    Regards,
    Jasmit vala
    [email protected]

Maybe you are looking for

  • How do I access an external hard drive attached to an Airport Extreme using the Finder's "Go to the folder" feature?

    How do I access an external hard drive attached to an Airport Extreme using the Finder's "Go to the folder" feature? I have an external hard drive attached to my Airport Extreme and I can access it just fine through Finder.  I would like to be able t

  • DB Lookup Problem

    Hi All,   I am trying to use DB LOOKUP in the  mapping.   I am getting the following error. Can you through some pointers?    I am using   1. Driver = oracle.jdbc.pool.OracleConnectionPoolDataSource 2. Connection = jdbc:oracle:thin:@190.190.190.190:1

  • IMovie 11 Splitting Events!!

    How could this software not allow me to split EVENTS!! I want an event to be split not the project.. Any advice???

  • IPod Mini playing only half a song

    I'm having a problem with my iPod mini. I uploaded a bunch of cd's onto my iPod last night. During the last cd my computer and iPod froze for about an hour. So I did the unthinkable and unhooked my iPod. Then all of my songs wouldn't play, so I delet

  • Urgent: need threadsafe replacement for malloc

    Hi, I have a native library that is using GetDirectBufferAddress to create large chunks within the java memory model that I can use to subdivide and alloc from in the native code instead of using malloc. However, there are multiple threads using thes