You Are Here:

Community: Developer Discussion Boards

#1 Old Question Making a game, few specific questions - 2006-11-22, 06:26

Join Date: Nov 2006
Posts: 3
lraoux
Offline
Registered User
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~
Reply With Quote

#2 Old Re: Making a game, few specific questions - 2006-11-22, 11:54

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
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
Reply With Quote

#3 Old Re: Making a game, few specific questions - 2006-11-23, 00:41

Join Date: Nov 2006
Posts: 3
lraoux
Offline
Registered User
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
Reply With Quote

#4 Old Re: Making a game, few specific questions - 2006-11-23, 11:40

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
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
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
wat are the steps involved in making any bluetooth multilplayer game?? tango85 Mobile Java General 8 2006-05-09 20:38
Questions from an Independent Game Developer rorygraves Mobile Java Games 4 2006-04-19 20:44
Making game for Mobile vishalrpanchal Mobile Java General 1 2005-11-09 00:51
Making my game available for download smb101 Mobile Java General 3 2004-06-24 15:00
Is Making A Java Game is So Difficult? Duna Mobile Java General 13 2003-10-16 16:04

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d81449X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZpythonQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZuserE5ftagQSxpythonX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ