Questions tagged [cocos2d-iphone]

cocos2d for iPhone is a free open-source framework for building 2D games, demos, and other graphical/interactive applications for iOS devices.

Filter by
Sorted by
Tagged with
0 votes
0 answers
223 views

How to take input from featured mobile phone in cocos creator?

I am beginner to cocos creator and I came to know cocos has Keyboard,DeviceMotion and Mouse input event but I want to know how to take input from featured mobile phone having number pad? Will it be ...
Aryaman Gupta's user avatar
2 votes
0 answers
61 views

What is the right way to implement a loading screen in cocos2d-js?

We have two scenes that are loaded with heavy computation; a map screen and a puzzle screen. When we change the scene from A to B, the app gets stuck on scene A for a while before it renders scene B. ...
ramiz balayil's user avatar
0 votes
1 answer
163 views

Cocosdenshion and Android not working

I'm trying to play sounds and music with cocos2d. When I run on iPhone and .caf files the audio is perfect, but on Android it is not playing the background music and is only playing 2 sounds of 10 ...
RN Vi's user avatar
  • 1
1 vote
0 answers
39 views

How do I transition a cocos2d scene to a UiViewController?

My project is a cocos2d game project, but I added a UIViewController for the initial log in. The first scene is the splash logo, followed by the menu screen, but I ...
ICoder's user avatar
  • 111
1 vote
0 answers
190 views

Cocos2d How do I transition to a scene

So I have mainScene and I have LogoScene, I am wondering If i can make logoscene show a logo, then transition to mainscene. here is what i have ...
sn0wfall's user avatar
1 vote
1 answer
176 views

Is there any way in open-gl to "bit crush" everything on the screen?

I am making an educational game and am looking for options for a visual effect to show when something is "incorrect". So, I am looking to see if there's an easy way in openGL to temporarily distort ...
patrick's user avatar
  • 209
5 votes
1 answer
1k views

How to implement 'Fog of War' in SpriteKit or Cocos2D?

Take a look at the image below from the game Warcraft 2. There's a darkened area (like a fog) that represents the limits of the 'field of view' -- to the effect that you would not see any enemy ...
eric's user avatar
  • 153
1 vote
0 answers
75 views

Cross-platform game to be wrapped into a native iOS/Android app

I need to build an app like Lumosity (https://play.google.com/store/apps/details?id=com.lumoslabs.lumosity) that is native app and have some game screens. So the question is: Is there a way to build ...
djserva's user avatar
  • 111
0 votes
0 answers
91 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 ...
Paresh Thakor's user avatar
0 votes
1 answer
30 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,...
Salmiak's user avatar
  • 21
4 votes
1 answer
402 views

Cocos2D V3 Blur effect performance test without iOS device

I am testing the blur effect (CCEffectBlur) in Cocos 2D V3 and I found that when I add an effect to an EffectNode it takes up to ...
CrApHeR's user avatar
  • 91
0 votes
1 answer
155 views

Transition from UIView to CCScene in Cocos2D

I've surfed the internet for quite some time but haven't come to find an answer. Any help would be greatly appreciated. I am trying to perform a transition from a UIView to a CCScene So i have a class ...
votelessbubble's user avatar
2 votes
0 answers
799 views

cocos2dx - Swipe and cut the sprite

I am trying to implement swipe and cut a sprite using cocos2dx and inbuilt chipmunk. For the solution I have done following things Enabled physics in the scene, so that the body falls on cut. Used ...
iphonic's user avatar
  • 21
2 votes
3 answers
815 views

Cocos2d v3.4 Templates

How to create cocos2d v3.4 without using Cocos2D-SpriteBuilder? I installed Cocos2D-SpriteBuilder as they recommended in cocos2d blog: http://cocos2d.spritebuilder.com/get-started But I need to ...
Mariam's user avatar
  • 163
1 vote
1 answer
715 views

How can i get a value from object in tmx file in Cocos2d x 3.x?

I want to set my sprite in x coordinate based on an object in TMX map file, this is my code: ...
Abdalltif Basher's user avatar
2 votes
1 answer
468 views

How can i get object from TMXTiledMap and store it in Dictionary variable ? [duplicate]

I've been following a tutorial to make tiled map in cocos2d x 3.0 , but i couldnt complete the rest of the tutorial because its for coco2d x 2.0 version, How can i get a value of property that is ...
Abdalltif Basher's user avatar
0 votes
0 answers
544 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 ...
Paresh Thakor's user avatar
0 votes
1 answer
900 views

How to create a line that is always connected to two Objects. (iPhone, Cocos2d)

I'm wanting to create a rope like animation effect. I don't need any kind of rope physics, all I need is a straight line connected to Object A and the other end connected to object B. Object A and B ...
Sp3kk's user avatar
  • 3
4 votes
2 answers
2k views

Drawing a continuous line with onTouchMoved callback

i'm trying to draw a continues spline on every onTouchMoved call, the functionality is supposed to be similar to the line drawing used in the iOS game - flight control. i'm using it in the following ...
Itzik984's user avatar
  • 205
1 vote
0 answers
526 views

Playing Multiple Sound effects isssue in cocos2d-x

Please help if someone faced this issue. I have a sound effect 3sec long which need to be played repeatedly for some time of 10 to 15 secs. Implemented like below: ...
Same's user avatar
  • 11
0 votes
1 answer
975 views

cocos2dx: RunningScene != Scene You just Replace

I have this code for cocos2d-x 3.x: ...
Emadpres's user avatar
  • 940
1 vote
2 answers
1k views

supporting multiple resolutions on mobile (cocos2d, ios)

I am looking into ios game development and the first question that comes to mind is how to support the growing number of iphone resolutions. I have seen the Unity strategy of normalized screen ...
Nick's user avatar
  • 128
1 vote
0 answers
122 views

Loading Textures in Background Cocos2d Objective C loading CCScene

I am allocating a few CCScene subclasses, but when I do this, it takes more than 10 seconds. What I am trying to achieve is to perform a small CCAmimation, such as a loading logo glowing. My question ...
Manish Pathak's user avatar
1 vote
0 answers
47 views

CCActionMoveBy doesnot working properly when the action called for many of the sprite in cocos2d

I have an issue with CCActionMoveBy when I call the movement action for many of my sprites. I need to move to a certain position and then remove it from the scene. ...
Vijay's user avatar
  • 121
0 votes
0 answers
132 views

Using Tile Maps with cocos2d - how do I handle a large amount of images?

I am building a game where the users (players) can build their own town. There they can build houses, add furniture to the houses etc etc. Basically similar to The Sims. I am using the Tiled Map ...
Eyeball's user avatar
  • 101
1 vote
2 answers
416 views

Moving CCNode with constant speed in cocos2d

I want to move the object (CCNODE) with constant speed in any direction , what i have did till now is applied a force to object at start to get it moving and set elasticity as 1 and friction as 0 to ...
Meuk Light's user avatar
-1 votes
1 answer
106 views

Cocos2d: Positioning Sprites in complex layout patterns [closed]

I'm wondering if anyone has suggestions for how to manage the positioning of many sprites in pre-set and complicated patterns? Currently the brute-force method is to painstakingly code each sprite ...
gdbj's user avatar
  • 103
4 votes
2 answers
3k views

Mathematics of difficulty acceleration in endless runners

I'm currently working on an endless runner and was wondering about the growth of difficulty in the game. Is the acceleration of difficulty highly specific to games or are there standard growth ...
Aks's user avatar
  • 141
8 votes
1 answer
1k views

Why the AnchorPoint doesn't affect the `CCLayer` Positioning?

I think there is a difference between the CCLayer and CCNode behavior when I change their AnchorPoint. I will describe what I mean and please somebody explain it. Scenario: I start with ...
Emadpres's user avatar
  • 940
2 votes
1 answer
455 views

SneakyInput joystick touch event ends when CCButton is pressed

I've added a joystick to my iOS game using the latest SneakyInput joystick code for cocos2d v3. It works well, but when a CCButton I have is pressed, the joystick ...
BotskoNet's user avatar
  • 919
-2 votes
1 answer
403 views

Error running an Action in Cocos2d-x

In my game I have a "rocket" type and I want to run a sequence of actions on it. At first it must run an explosion animation and then remove itself from the game. For this I used the following code, ...
HRZ's user avatar
  • 51
2 votes
2 answers
83 views

How can I add an impulse to specific rigid bodies at rest?

Scenario Rocks falling down a rocky slope, with a flat surface at the bottom. When they land on the surface, the rocks move slightly before coming to a rest. ...
phpN00b's user avatar
  • 21
4 votes
2 answers
2k views

How to pause and unpause the Particular action of a sprite?

My game has a sprite representing a character. When the character picks up an item, the sprite should stop moving for a period of time. I use CCbezier to make the sprite move, like this: ...
user1609578's user avatar
3 votes
1 answer
1k views

How do I convert the coordinates of a click to a tilemap position?

How do you turn a tilemap (produced by TileD) for cocos2d where I can click on individual items and get a callback? Is it just a case of converting captured touch and finding out where it is on the ...
zardon's user avatar
  • 35
0 votes
1 answer
138 views

Manually remove inactive CCParticleSystem from scene?

When using particle systems that have a lifetime, with CCParticleSystem and its derived classes, should I manually remove the finished systems from their parent ...
glampert's user avatar
  • 3,067
0 votes
1 answer
875 views

I need some help with stopping individual sound effects in OALSimpleAudio

I'm trying to find out how to stop a specific sound effect rather than having to stop all of them. I'm using OALSimpleAudio. I can't seem to find how to do it. simple google searches result in ...
tomvda's user avatar
  • 123
0 votes
0 answers
302 views

How do I get a sprite's angle after collision?

I'm using Cocos2d (version 3) and I want my hero sprite to be jostled around by incoming enemy sprites. The Chipmunk-based physics work, but I need some way to track the rotation of the sprite after a ...
batymahn's user avatar
2 votes
1 answer
1k views

Spritebuilder and CCScrollView, page indicators not showing up?

I'm using Spritebuilder to make my game, and CCScrollView usually saves me quite a bit of time. I'm trying to implement the scroll view much in the same way as the home screen on an iphone uses the ...
Spaderdabomb's user avatar
0 votes
1 answer
707 views

Incorrect sprite rotation with atan2() [duplicate]

I want to rotate a sprite so that it faces the mouse cursor/screen touch location. Currently I'm using the following method to compute the angle of rotation. The input position is the target point the ...
glampert's user avatar
  • 3,067
1 vote
1 answer
1k views

Preload in cocos2d v3

I'm trying to create a preload, but i don't know how to implement the code of this topic in cocos2d iphone v3. Since CCTextureCache has changed to CCTexture, and doesn't have sharedTextureCache ...
Filipe Ferminiano's user avatar
0 votes
2 answers
101 views

Count number of CCNodes of a certain class on a layer

Pretty simple question. I'm working in Objective C (cocos2d) and I'm trying to count the number of a sprites of a certain class are present on the current layer being displayed. For example, I have a ...
Spaderdabomb's user avatar
0 votes
1 answer
254 views

Get Facebook Picture in Cocos2d-iphone V3

I'm trying to get the profile picture from Facebook, but I'm getting the following error: ...
Filipe Ferminiano's user avatar
0 votes
1 answer
448 views

try to create CCSpriteFrame but get nil values

I'm trying to animate a CCSprite in cocos2d v3 following this question, but I'm getting the following error message in Log: ...
Filipe Ferminiano's user avatar
0 votes
1 answer
211 views

Stop schedule on gameOver

I have 2 events running through time in my game. I want that when gameover starts, this events stops running This is my code: ...
Filipe Ferminiano's user avatar
0 votes
2 answers
878 views

Game over pop-up like Flappy Bird

How can I make a game over pop-up like Flappy Bird in cocos2d-iphone 3? I tried to add a new Scene, but it adds a new screen on the game, I just want a rectangle with some buttons inside it. I also ...
Filipe Ferminiano's user avatar
0 votes
0 answers
135 views

Prismatic Joint causes a crash-Box2D(cocos2d)

tried to set up a prismatic joint, but I get this error upon run time: Assertion failed: (IsLocked() == false), function CreateBody, file /Users/Aether/Developer/JFRecode/JFRecode/libs/Box2D/Dynamics/...
user3084800's user avatar
0 votes
1 answer
355 views

Particle effect in sprite

I want to create a particle effect when my player sprite collide with my star sprite. How can I add a particleSystem in the sprite and not in a image? Also, I wish if it could wait for the animation ...
Filipe Ferminiano's user avatar
6 votes
1 answer
3k views

OpenGL ES object rotation around z axis

I have an object on my screen which is presented rotated and panned, But i have 2 problems regarding the z axis rotations. It's a bit tricky to explain so i uploaded 2 videos to describe each problem. ...
Itzik984's user avatar
  • 205
1 vote
0 answers
141 views

Building a guided tracing scene

I'm trying to figure out an approach to creating a cocos2d scene that would help kiddos learn to draw letters of the alphabet. Right now I am just using Apple’s PaintView demo code and applying an ...
Nathan Clark's user avatar
0 votes
3 answers
668 views

How can I ensure I still get correct touch inputs when my scene is offset?

How can I accept touch input beyond the scene's bounds, so that no matter what I set self.position to, touches can still be detected? I'm creating a tile based ...
Pavan's user avatar
  • 101

1
2 3 4 5
7