You Are Here:

Community: Developer Discussion Boards

#1 Old Question Regarding Sprite - 2006-05-02, 11:48

Join Date: May 2006
Posts: 2
tikkay
Offline
Registered User
Hi, am new to J2me thus can you plz help me wiht this
I have two Sprites ... i need to free move Sprite1 using the key events where as Sprite 2 is required to move automatically after 10 seconds...

i can't put in a delay as that would stop the application from running

any suggestions ?

thanx

Atiq
Reply With Quote

#2 Old Re: Question Regarding Sprite - 2006-05-02, 19:14

Join Date: Mar 2006
Posts: 518
wang_shui
Offline
Super Contributor
Hi,

Whycan't u use a timer to move the sprite automatically after 10 seconds.
http://today.java.net/pub/a/today/20...html?page=last

Hope this is also helpful
http://www.gamedev.net/community/for...age=1&#2527688

Wang
Reply With Quote

#3 Old Re: Question Regarding Sprite - 2006-05-03, 09:18

Join Date: May 2006
Posts: 2
tikkay
Offline
Registered User
thanx for the links... i think using using seperate threads for my two sprites would solve the problem..that's what i think

any suggestions :)
Reply With Quote

#4 Old Re: Question Regarding Sprite - 2006-05-04, 07:42

Join Date: Feb 2006
Posts: 60
Location: Santiago, Chile
awoywood's Avatar
awoywood
Offline
Regular Contributor
Hi,
keep in mind that you need a separate thread for the game loop (that's where you put all the logic of your game).
That's needed because you can't do much work in one of the functions that are called by the OS. For example, you catch all the keyboards events in KeyPressed() right? Well, if you put all your logic in there, then the OS won't get control again, and it won't be able to notify you of the next key pressed. That's a common flaw in some games, you pressed a lot of keys very fast and the games gets unresponsive.
Back to your problem, that's why you need a separate thread to put that 10 secs delay. But it would be best if check in your gameloop the time that has passed (with System.currenttimemilis).
Try to look into one of the games samples, all the them use a separate gameloop thread.

Hope it helps,
Alejandro W.
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
Sprite GameCharacter Movement & Sprite Deletion bloodyknight Mobile Java General 2 2004-07-10 03:34
Fast Sprite Effects on Series 40/30 leissler Mobile Java Media (Graphics & Sounds) 0 2003-09-29 11:10
My Questions are not getting answered earamsey General Symbian C++ 1 2003-06-04 18:26
Severe RResourceFile Error, HELP! earamsey General Symbian C++ 0 2003-06-02 20:34
Sending data using iAcceptedSocket (Urgent question) okegame Bluetooth Technology 1 1970-01-01 02:00

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