You Are Here:

Community: Developer Discussion Boards

#1 Old Arrow Question proper game loop ?? - 2006-06-17, 17:16

Join Date: Aug 2003
Posts: 127
melas21
Offline
Regular Contributor
I would like to ask and pehaps start a discussion on creating a game loop for our MIDP games - in my game which i have beel lately devveloping i have got to delay some events like time beteen shots, sprate frmae changes and soo on. So far i am using System.currentTimeMilis to get curent time and then just in each loop i chceck if there is enaugh delay to place event in que.

it looks like this:

if
(curtime-lastFireTime>shipFireData[currentFire][4]){ //short[] -
type, posx, posy, frame short[] fireSprite = new short[8];
//and so on



what i am thinking of is declaring a long value which in each loop i will increse and
check the value of this varible in the conditions like this


while (gaemOver){
loopCounter++;....... if (loopcounter - storedMoment
> 200) { // do the event
}}



what do you thin willl be the best and effective model for the game?? What are you using ?? From my tests in J2SE i know that checking the time is a little bit time consuming so the prefferable way should be the loopcounter but i am not sure.

regards mchmiel
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Question. Free memory in Game Loop(J2ME) videador Mobile Java General 5 2009-08-24 07:05
a game question icej Python 0 2006-05-16 04:03
How should a proper game loop be constructed? falconpl Mobile Java Games 2 2006-05-08 12:36
question about thread in game loop! cach2008 Mobile Java General 4 2004-02-09 02:52
Game loop question tinkezione Mobile Java General 7 2002-12-31 09:14

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: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d89809X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZgamesQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ