×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    31

    Beginner problems...

    Hi All,

    I am struggling at the moment, somewhat of a mental block has hit me. I have been studying this great tutorial here http://www.microjava.com/articles/techtalk/midp2_games and have got suitably to grips with it enough to change most aspects of it.

    My struggle is adding a menu system to integrate with it.

    I am looking to create a simple 'title screen' which is not full screen and then when the user chooses 'go' it switches to full screen and launches the game, after the game has finished it stops using fullscreen and takes you back to the menu.

    Can anyone help me out?

    Thanks
    Jamie

  2. #2
    Registered User
    Join Date
    Jan 2006
    Posts
    39

    Re: Beginner problems...

    I think you should learn more about the CustomItem.To achieve the function that you want you should make a CustomItem by yourself.

  3. #3
    Super Contributor
    Join Date
    Mar 2006
    Posts
    516

    Re: Beginner problems...

    Hi Jamie,

    In the canvas class just write the code
    setFullScreenMode(true); when u want to switch to fullscreen and if u want to switch back to non-fullscreen just write setFullScreenMode(false);


    Wang

  4. #4
    Registered User
    Join Date
    Sep 2004
    Posts
    31

    Post Re: Beginner problems...

    Thanks for your replies, I have decided to only use fullscreen mode but have reached a hurdle I cannot overcome.

    Basically I have changed the tutorial above I changed the jump.java source to automatically start the game instead of waiting for a menu command.

    to do this I basically removed all the command stuff and in the start app added myGameThread.go();

    ie

    Code:
    public void startApp()  {
         try{
         myGameThread = new GameThread(myCanvas);
        myCanvas.start();
        myCanvas.setFullScreenMode(true);
        myGameThread.go();
         }
             catch(Exception e){
          throw new RuntimeException ("Error: "+e);
             }
    
      }
    This works fine in the standard colour phone emulator but just hangs on both (real) Nokia N70 and Sony K700i

    I have been staring at the code for about 6 hours now and I just cant seem to make head nor tails of why it wouldnt work. I have adjusted the location of the call to as many different places as possible but still no joy. Please help!!!

    Thanks
    Jamie

  5. #5
    Registered User
    Join Date
    Sep 2004
    Posts
    31

    Re: Beginner problems...

    Just a quick update, I have since spent a further number of hours trying loads of different techniques to get it working but still no luck.

    I have rewritten huge chunks but still get the same problem.
    If I run this on the s60 sdk emulator I get an 'unhandled exception error' which I think can only be this code

    Code:
      public Cowboy(int initialX, int initialY) throws IOException {
        super(Image.createImage("/ship.png"));
        defineReferencePixel(8, 0);
        setRefPixelPosition(InitialX, InitialY);
      }
    as its the only one that doesnt catch the errors, however I am struggling to make this code catch the error as it uses the 'super' command which to be honest I havnt a clue what it is...googling hasnt help me much either

    Please,Please can someone help!!!

    Thanks Jamie

  6. #6
    Regular Contributor
    Join Date
    Mar 2005
    Posts
    249

    Re: Beginner problems...

    It's really difficult to see what your problem is because there's modified code. So try using System.err.println(error) whenever you catch an error in a try-catch to give you a sense of that the error is exactly.

    Also, it might be convenient to put an "identifier" when you do that
    eg.
    Code:
    try{
     ......
    }catch (Exception error){
      System.err.println("inside startApp: " + error);
    }
    This way, you can pin point exactly where your problem is. say your block of code has a whole ton of lines, the easiest way to find out which line it is that throws the error is to use System.out.println's after every few blocks of code to have a pretty good idea whereabouts it is.

    It is probably a threading issue or some graphics issue that is causing it to lock up on the emulators.. but without more info, I can't tell you more.

    Hope this helps.
    Cheers.
    Last edited by lmtang; 2006-03-20 at 06:48. Reason: changed printlnt to println

Similar Threads

  1. Several problems with NMIT 4.1 MMS
    By jtalviva in forum General Messaging
    Replies: 0
    Last Post: 2006-03-10, 11:03
  2. Several problems with NMIT 4.1
    By jtalviva in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2006-03-10, 10:59
  3. Advice needed --> absolute beginner
    By logismon in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2006-03-06, 13:29
  4. 6210, Windows 2000, DAU-9P - problems connecting PC Suite 4.05
    By ajrobinson in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2002-05-23, 08:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×