Added The AtlasSpriteTest header and implementation files to a sample project to test them out (wrong way?). But I get compile errors because things like vectexZ and anchorPoint and a bunch of other stuff are not in the AtlasSprite and AtlasSpriteManager. I checked both 0.7.3 and 0.8beta and, sure enough, they aren't. What am I doing wrong?
AtlasSpriteTest Help
(15 posts) (2 voices)-
Posted 2 years ago #
-
I think anchorPoint is a property of cocosNodes, that is why you can't find it in neither of those classes
Posted 2 years ago # -
I can't seem to find it there either, in any case, I didn't modify anything, so whether I found it or not, I figured it should compile.
Posted 2 years ago # -
Seems like the issue is that the tests use the latest revision of the framework. Is there an easy way to keep my framework up-to-date or is there somewhere I can get the AtlasSpriteTest version that would work for one of the release version frameworks?
Posted 2 years ago # -
well anchorPoint is from 0.8 so you will not find it in 0.73.
What errors are you getting exactly?Posted 2 years ago # -
sorry for the late response,
for example for this;
for(int i=5;i<11;i++) {
AtlasSprite *sprite = [AtlasSprite spriteWithRect:CGRectMake(85*1, 121*0, 85, 121) spriteManager: mgr];
sprite.position = ccp( 50 + i*40, s.height/2);
sprite.vertexZ = 10 + (10-i)*40;
[mgr addChild:sprite z:0];
}I get "request for member vectorZ in something not a structure or union
same for error for other members as wellPosted 2 years ago # -
try this instead:
[sprite setVertexZ:100];
This can be found here:
http://www.cocos2d-iphone.org/wiki/doku.php/release_notes:0_8_beta?
Posted 2 years ago # -
before I try anything, I just want to know why it's like that in the tests?
I got it from here;
http://code.google.com/p/cocos2d-iphone/source/browse/trunk/tests/Posted 2 years ago # -
well i tried with both ways and it works ok for me, maybe you are missing something... are you sure you are using the latest version?
i am using the 0.8 beta, this one http://www.cocos2d-iphone.org/archives/310Posted 2 years ago # -
I feel stupid, I forgot to update my references. Thanks for your help
Posted 2 years ago # -
No problem :D
Posted 2 years ago # -
Unfortunately now I'm not sure how to get it up and running. I added AtlasDemo layer to a Scene but it just crashes when I run it
Edit: nevermind, I see it has like its own App Delagate
Posted 2 years ago # -
Okay, so now I need some advice on real world usage. If I'm like making bullets firing from a fighter plane, I'm guessing its a good idea to use an AtlasSpriteManager. The issue is that there's going to be a lot of being fired at a given level. So What's the best way to handle this? Should I just let the Manager accumulate all the sprites without clearing?
Posted 2 years ago # -
I think yes, you should have an NSArray with x AtlasSprites, and fire them accordingly.
In my game i allocate on init 30 AtlasSprites and then i make them appear when the time is right.
Or you could add them to your scene on the fly, but it will consume more CPU time if they are a lot.
Posted 2 years ago # -
so you think I should just create like a fixed amount per vehicle and recycle them?
Posted 2 years ago #
Reply
You must log in to post.