×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    3

    Question Making a game, few specific questions

    hi all, just a few programming questions:

    1. how do I initialize and define an integer variable?
    2. how do I serialize/deserialize it so that I can make it keep its value between each time I run the program?
    3. how can I perform a square root with double as the return type?

    That's it for now, I may have more later though...

    thanx in advance~

  2. #2
    Super Contributor
    Join Date
    May 2006
    Location
    Oulu, Finland
    Posts
    622

    Re: Making a game, few specific questions

    Hi lraoux and welcome to the forum

    1) in python you don't have to car about the data type. Still you have the choice of using Integers, Floating point numbers and Complex numbers and force there type:

    Code:
    >>>print int(5.15)
    5
    >>>print float(5)
    5.0
    for more details go at the Python page

    2) you can write there value in an external file or the phone database. Then at the startup you read them and load the proper values

    3) use the math library
    Code:
    >>>from math import sqrt
    >>>print sqrt(8)
    2.82842712475
    your questions are more Python related than PyS60, so checking the python 2.2.2 docs would be a great help for you

    LFD
    Devices:
    Nokia E61 3rd Edition - pys60 1.4.0

    Tips and modules:
    http://www.lfdm.net/thesis

  3. #3
    Registered User
    Join Date
    Nov 2006
    Posts
    3

    Re: Making a game, few specific questions

    ok.. wow thx that helped alot!

    but I'm still confused about the 2nd thing. Could you be a little more specific?

    p.s.: if possible, could we communicate through AIM? my IM is MLsaifer22

  4. #4
    Super Contributor
    Join Date
    May 2006
    Location
    Oulu, Finland
    Posts
    622

    Re: Making a game, few specific questions

    Hi lraoux,

    The second point is quite easy to achieve.
    • with database download PythonForS60_doc_1_3_14.pdf if you don't have it and check 7.4 (e32db) you have all method described. Just some SQL queries and it's done
    • To write into files you could use .INI files, XML,... just do some googling or whatever your prefer, you'll easily find examples and/or libraries


    LFD
    Devices:
    Nokia E61 3rd Edition - pys60 1.4.0

    Tips and modules:
    http://www.lfdm.net/thesis

Similar Threads

  1. Replies: 8
    Last Post: 2006-05-09, 19:38
  2. Questions from an Independent Game Developer
    By rorygraves in forum Mobile Java Games
    Replies: 4
    Last Post: 2006-04-19, 19:44
  3. Making game for Mobile
    By vishalrpanchal in forum Mobile Java General
    Replies: 1
    Last Post: 2005-11-08, 23:51
  4. Making my game available for download
    By smb101 in forum Mobile Java General
    Replies: 3
    Last Post: 2004-06-24, 14:00
  5. Is Making A Java Game is So Difficult?
    By Duna in forum Mobile Java General
    Replies: 13
    Last Post: 2003-10-16, 15:04

Posting Permissions

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