Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User mukundan's Avatar
    Join Date
    Jun 2010
    Posts
    3
    This is with reference to the description of the GameCanvas class at

    http://java.sun.com/javame/reference...ameCanvas.html

    On this page, the code example given for getKeyStates() method is as follows:

    // Get the key state and store it
    int keyState = getKeyStates();
    if ((keyState & LEFT_KEY) != 0) {
    positionX--;
    }
    else if ((keyState & RIGHT_KEY) != 0) {
    positionX++;
    }

    There are two typos in the above example: LEFT_KEY must be replaced with LEFT_PRESSED, and similarly RIGHT_KEY with RIGHT_PRESSED.

  2. #2
    Nokia Developer Champion raj_J2ME's Avatar
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,314
    Hello and welcome to the Forum Nokia Discussion Boards..

    You are saying the correct thing, as far I can understand is that may be they have initealized the valirable like this,
    LEFT_KEY = GameCanvas.LEFT_PRESSED;
    and
    RIGHT_KEY = GameCanvas.RIGHT_PRESSED ;
    That's the only thing that can apply to this either,else they have used the wrong variables by mistakes, since there are no such values in neither in Canvas or GameCanvas.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Nokia Developer Moderator r2j7's Avatar
    Join Date
    Aug 2007
    Posts
    1,595
    Hello mukundan,

    and welcome to Forum Nokia Discussion Boards!

    Have you checked with the content owners of that page regarding this issue?

    Regards,
    r2j7

  4. #4
    Registered User mukundan's Avatar
    Join Date
    Jun 2010
    Posts
    3
    I will try to contact the content owners. Currently there is no such information as webmanager or contacts on the website.

    Thanks,

    Mukundan

  5. #5
    Nokia Developer Champion raj_J2ME's Avatar
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,314
    But I guess that hardly matter to your work, you can work in the correct way and I am sure that this is not gonna affect your code and the output of the code.I would recommend that you continue with the work.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

Similar Threads

  1. GUI Libraries for Java ME
    By erik.hellman in forum Mobile Java Media (Graphics & Sounds)
    Replies: 5
    Last Post: 2008-04-11, 11:56
  2. CameraApp Example 3rd Edition
    By bigbadwolf in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2007-05-28, 19:13
  3. file not found
    By praktikant in forum Symbian C++
    Replies: 16
    Last Post: 2007-05-09, 15:04
  4. 3rd edition: undefined reference
    By iulian_moldovan in forum Symbian C++
    Replies: 2
    Last Post: 2006-06-20, 14:11
  5. j2ME, java enabled, and the 3410
    By davidkangaroo in forum Mobile Java General
    Replies: 2
    Last Post: 2002-07-05, 22:30

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved