Questions tagged [ccsprite]
The ccsprite tag has no summary.
22 questions
4
votes
1
answer
255
views
android - How Do I Replace A Scene in Cocos2D
I am using Cocos2D for Android:
I have two scenes MainScene and LogoScene. I want to show a Splash screen on ...
0
votes
0
answers
108
views
How velocity impacts on CCSprite in Cocos2d Chipmunk?
I am in need of the basic understanding of how velocity changing works? i.e. how CCSprite is able to jump at particular height when some velocity is set?
Let me give you an example on which I am ...
0
votes
1
answer
60
views
Why does the Texture placement of my CCSprite slightly shift when changing it's location?
So I've been seeing this issue for a while now. When using a delta method to change the location of a CCSprite, the placement of texture of my sprite slightly moves into the direction where I'm headed,...
0
votes
0
answers
572
views
Cocos2d pause game freezes the screen
I am trying to create pause screen for my game. The game is developed upon continuous scrolling background (top to bottom) with obstacles which are moving independently (left to right).
Below is the ...
5
votes
1
answer
2k
views
How to read a color of a pixel from texture (cocos2d-js)?
How to read a color of a pixel at [x,y] from a texture (in cocos2d-js)?
3
votes
2
answers
652
views
Should I draw directly on a CCLayer or a CCSprite?
Now I am a little confused in my cocos2d-x cpp project. I want to draw lines with user's finger touch. Following the screenshot of a CCScene:
In the screen, there are two squares. I want show an ...
0
votes
1
answer
660
views
How to get position of CCSprite added to CCParallaxNode?
I have a CCparallaxNodeExtras that scrolls infinite (following the space game tutorial). I added as a child a CCSprite made of other CCSprite, like this:
...
0
votes
2
answers
128
views
CCSprite as an iVar
So I built my first game app, and it was a lot of fun. I'm really trying to expand on some of the ideas, but I'm running in to some serious variable scope issue. What I want to do is encapsulate a ...
1
vote
2
answers
353
views
Crash due to removal of Elements like CCSprite from NSMutableArray
So, here's how it goes.
I am currently working on Cocos2d game, which consists of many Obstacles. One obstacle gets added on the screen at an interval of 10 seconds like this.
...
0
votes
1
answer
844
views
Keeping the CCSprite on the screen
In my cocos2d app I have a CCSprite moving on the screen but it moves off the screen. How can I prevent the CCSprite from moving off the screen?
Thanks
2
votes
1
answer
429
views
Image 1 becomes image 2 with sliding effect from left to right?
I would like to show a second image appearing while a "door" is closing on my character. I've got my character in the middle of the screen and a door coming from the left. When the door passes my ...
-2
votes
1
answer
189
views
Make a CCSprite come up from bottom of the screen in intervals
I have a cocos2d iOS app. I have a CCSprite that I need to come up from the bottom of the screen every few seconds (like 2 or 3 seconds). How would I do this?
0
votes
1
answer
171
views
CCSprite x and y comparison
I have 2 CCSprites and I want to tell if their x and y are equal I tried this:
...
2
votes
2
answers
1k
views
Basic game architechture best practices in Cocos2D on iOS
Consider the following simple game: 20 squares floating around an iPhone's screen. Tapping a square causes that square to disappear.
What's the "best practices" way to set this up in Cocos2D?
Here's ...
1
vote
1
answer
614
views
Cocos2D Accelerometer Z axis
I am making a 2D scroller game where the player controls an airplane via the accelerometer I would like to know if it is possible to scale in and to scale out the sprite/airplane using the ...
1
vote
1
answer
2k
views
Smooth animation in Cocos2d for iOS
I move a simple CCSprite around the screen of an iOS device using this code:
...
1
vote
1
answer
406
views
Cocos2d not getting the texture which is added to CCTextureCache using thread
I convert the image into texture in a thread using the following line of code to reduce the image to texture converting time.
[[CCTextureCache sharedTextureCache] addImage:@"imageName"];
But when i ...
1
vote
3
answers
2k
views
How to determine an irregular area of a CCSprite?
In my simple game I use boundingBox for pick coins and other stuff, but I need use irregular area detection of Sprite(with out Alpha)... There is alternative to boundingBox?
Here is code:
...
1
vote
1
answer
2k
views
Count number of CCSprite added to a CCLayer
Does cocos2d has a method that returns the amount of CCSprites added to a CCLayer?
A have SceneControlLayer object, and I added some CCSprites to it.
...
4
votes
1
answer
2k
views
Should I be subclassing CCSprites?
When I am working with cocos2d I can add CCSprites to the layer or 'stage' and manipulate them.
Now, to do my ongoing calculations for movement AI and such, things that will always run, should I:
...
3
votes
1
answer
2k
views
Programmatically set color of Box2D body's sprite or image
In my basic Cocos2D + Box2D iPhone app I have a bunch of circular Box2D bodies. I'd like to change the color of the circles programatically. What's the easiest way to do this?
So far I'm just ...
1
vote
1
answer
1k
views
Stretching textures for CCSprites in Cocos2D
I'm making a game for iPhone and iPad w/ Cocos2D and Box2D. I scale the size of square objects ("blocks") using a pixel-to-meters ratio depending on the particular device. Can I stretch or shrink ...