You Are Here:

Community: Developer Discussion Boards

#1 Old Help needed with LayerManager and Sprites - 2007-10-10, 15:18

Join Date: Apr 2007
Posts: 1,757
Tiger79's Avatar
Tiger79
Offline
Forum Nokia Champion
Hi,
Im making an application which shows several sprites on a background...
The background is sorted and is a Sprite of an Image...
Lets say I actually dont know from the first moment how many Sprites are gonna be needed... So I decided to use a Vector for this... I made my own class cat which extends the Sprite class... This extension inlcudes some extra params like name and some other ones...

The problem is that those cats will have to move which means their X and Y position will change... The actual implementation was to have a Vector including all cats, these are then appended onto the layerManager...
My problem is to be able to re-identify the corrrect cat... I need to do this because I only have to update the x-y coords of one or only a several cats at a time, which means I have to be able to identify the cat (with their name) so that I can update the right ones...
So I tried to extract the cat from the layerManager to read its name and compare with the "updated cat" list... but that will result in a classCastException, even though Cat extends Sprite which extends Layer afaik...

So is there a better way ? Or is there a way to link the Cats in the Vector with the ones in LayerManager ? So that when the data changes in the Vector automatically the positions are changed in the layerManager as well ???

I can use any type of help (except telling me to look at the SheepDog example, which I already did but I dont actually understand it), hints, advice, previous experiences...

Thanks in advance
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
How do i load up my sprites? pinzasso Mobile Java General 3 2005-05-11 19:52

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