Questions tagged [cocos2d]

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

Filter by
Sorted by
Tagged with
8
votes
1answer
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 ...
0
votes
0answers
14 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 ...
2
votes
0answers
19 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. ...
1
vote
2answers
315 views

Cocos2d JS - Getting vector reflection

I'm working on a small Breakout clone using Cocos2D-JS, without the use of a physics engine. One of the things that baffles me was how the ball bounces. My friend came up with this: inputVector - ...
4
votes
1answer
173 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 ...
1
vote
1answer
403 views

Scrolling effect after touch

i'm making map for a game and need to make scrolling of map, so the main thing what i need is to calculate speed and move layer after player remove finger from screen. I make it my own, but i think ...
8
votes
1answer
413 views

Do SpriteBuilder's Smart Sprite Sheet need to be loaded to memory?

When I create an Smart Sprite Sheet Folder using SpriteBuilder and publish it, must I load that SpriteSheet into memory "FrameCache" with code or does SpriteBuilder do this automatically (so I just ...
0
votes
0answers
14 views

Loading resources on OnLoad function

I am trying to load a json file using the cc.loader.load function in onLoad() function as shown below, I also have used some console.log() functions to see the order of execution. ...
0
votes
0answers
68 views

Slot Game inquiry. How to set the limit times of auto play?

I'm building a slot game, one line with three reel, using CocosCreator and Typescript. There is an already built auto-spin function once start, it will spin the reel infinite times. The spin will ...
3
votes
1answer
288 views

Exporting spritesheet for Cocos2d

I would like to know how people usually save the animations in order to load them easily in Cocos2d with as few hard-code as possible. E.G. The solution I thought of is to have one plist file ...
2
votes
1answer
2k views

Cocos2D - Fill a Sprite with a pattern

I have a CCSprite with a certain shape in Cocos2D and I would like to fill it with a pattern, as seen here: I've seen a lot of examples where they fill a rectangle with a pattern, or even a ...
0
votes
0answers
13 views

What is the best way to create a level shortcut for menu with cocos2d-x?

I have a PageView and I want on every page to have an array of MxN items. Each item is a level icon. What if I want to make not ...
1
vote
2answers
694 views

How can I cleanly separate the UI from the game logic in my Cocos2d game?

I've been working on a little game for the last few months, trying to approach it as a software engineer and employ best patterns and practices in my coding. I have gotten to the point where I have to ...
4
votes
2answers
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: ...
7
votes
1answer
963 views

Puzzle game: clipping of non-convex polygons on the figures

I have an original figure in the SVG file. I need to break it randomly on parts, an example of which is specified below: I have an idea, to use for partitioning Voronoi diagram (Fortune's algorithm). ...
3
votes
0answers
224 views

Batch z-ordering problem in Cocos2d (Python)

I have a weird problem with my hexmap drawing code. My code uses "squished" hexagons to achieve a pseudo-isometric view. Because of that, the order of drawing them on screen matters a lot. ...
6
votes
2answers
3k views

Creating an isometric map with hexagonal tiles for iPad

I'm new to game development, so I need a little help. I have to write down a little game which has a floor with hexagonal tiles, but it must be seen in an isometric view like The Sims. Ignoring the ...
0
votes
1answer
56 views

Adjusting arms of character while moving

I'm working on a test game in Cocos2d for Python (code is a little dirty). I'm trying to run and shoot at the same time without having my character's (running) legs go back to the beginning position ...
1
vote
0answers
193 views

Given the size of far and near plane, find other parameters of a frustum

I am trying to find the correct parameters for setting up my perspective camera. But I don't know the mathematics involved in that. Can somebody point me to the right direction? My near plane should ...
1
vote
1answer
56 views

Help understanding the parkour tutorial in Cocos2d

I was practicing the parkour tutorial for chapter 7, but I failed to understand why we should move the same delta movement of this.gameLayer, which contains the ...
0
votes
2answers
335 views

Cocos2dx - Create the friction of the ground

I'm writing a game, it a pool game. I've read about cocos2dx + physics library, however the document is really poor to understand. Material has 3 attributes (http://www.cocos2d-x.org/wiki/Physics#) : ...
-1
votes
1answer
688 views

How can I solve these errors when using SimpleAudioEngine?

I want to use SimpleAudioEngine for the music in a cocos2d game I'm working on. When I import SimpleAudioEngine.h in my game layer I get syntax errors in CVPixelBuffer.h and CMFormatDescription.h. I'...
0
votes
1answer
106 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 ...
4
votes
1answer
313 views

Cocos-2D asteroids style movement (iOS)

So I have a CCSprite subclass, well call this Spaceship. Spaceship needs to move on a loop, until I say othersise by calling a method. The method should look ...
-1
votes
1answer
267 views

How to set building in sequence like COC game using tiles map in cocos2d-x V3.9?

i am developing game in cocos2d-x V3.9. i want to create base like COC game. set all buildings in sequence and it can't be overlap with each others. i want also make boundary for develop city view. ...
2
votes
2answers
597 views

Importance of scripting engine at Cocos2d Game Engine

Each Game Engine is different and solves different problems in different ways, so the engine design does vary greatly from engine to engine (even though a lot of principles are shared from engine to ...
3
votes
1answer
422 views

How can I provide a mechanism for users to increase the gameplay speed?

I am developing a tower-defense game and I want to permit user to change game engine speed ,for example rotation speed of towers,rockets speed ,enemies moving speed ,counters and etc proportionally. ...
2
votes
2answers
766 views

How do mobile games create simple UI components? [closed]

How are simple UI inputs typically handled in 2D mobile games? For example, text input boxes and keyboards. It seems that many game engines do always have simple UI components. There are obvious ...
20
votes
5answers
7k views

When should you roll your own game engine? [closed]

I've been a software developer for 5 years, now, and I am wanting to get into iOS game development. I've played around with the iOS SDK for about 2 years, attending cocoaheads meetings, and I feel I ...
0
votes
1answer
402 views

How useful would it be to know a scripting language when developing an iOS game? [duplicate]

Possible Duplicate: Why do we use scripts in development? I just starting learning iOS game development. I plan to make games using the cocos2d framework. While reading game dev related articles, ...
3
votes
4answers
553 views

How to achieve 'forward' movement (into the screen) using Cocos2D?

I'm interested in creating a 2.5D first-person shooter (like Doom) and I currently don't understand how to implement the player moving forward. The player will also be able to browse around the world (...
0
votes
2answers
95 views

Make something move when no key is pressed

I am new to game programming and I have a question about my game logic. In my game there is a balloon that is supposed to collect some stars. the balloon moves with the keyboard. When the balloon ...
0
votes
1answer
906 views

How do I publish a game for the web, using Cocos Creator?

I am new to Cocos Creator and web game programming. I have build a simple game for the web, but I don't know how can I publish it. In the documentation files, it says: You only need to .zip scripts ...
2
votes
2answers
335 views

Finding diagonal objects of an object in 3d space

Using Unity3d, I have a array which is having 8 GameObjects in grid and one object (which is already known) is in center like this where K is already known object. ...
0
votes
1answer
74 views

Cocos2dx launcher - how do I set a newer engine version?

Why doesn't Cocos(V3.10) detect my newer engine version (3.14) which I downloaded and placed into the engine folder? ( I mean the launcher, the all-in-one version where you can create your project ...
1
vote
0answers
29 views

Socket.io emit textfield

Hello everyone I learned how to emit from socket.io website guides but I was wondering how does the chat example receive its input? For example in my cocos2dx app how do I pass a text field over to ...
3
votes
1answer
241 views

How can I use CCClippingNode to trim the top and bottom from a CCTableView?

I'm fairly new to Cocos2d and struggling with sizing a CCTableView. How can its height be controlled so that I have space at the top and the bottom? I'm trying to ...
4
votes
2answers
2k views

Converting data file of Sprite Atlas from JSON to Cocos 2D

I have an existing Sprite Atlas with its data file in JSON format. How do I convert it for use with Cocos 2D and other frameworks ? I tried poking around in Texture Packer which supports publishing ...
1
vote
2answers
682 views

Opengles 2.0, Replace the black region in the image to make it transparent

I have two textures, Source image A and Overlay B, B is drawed on top of A, I want to replace the black color in B, then make the region of A visible, what should I do? This is my shader language: <...
-1
votes
2answers
559 views

Unity equivalent to cocos2D (and Sprite Kit) Actions?

Does Unity have an equivalent to the Actions feature/functionality of cocos2D and Sprite Kit; if so, what is it? cocos2D Actions: http://python.cocos2d.org/doc/programming_guide/actions.html http://...
1
vote
1answer
1k views

How to use Cocos2dJS to connect to a Socket.IO server?

How can I connect to a nodejs socket.io server from a cocos2djs game? I've google all the way to no avail. I tried this but it ...
0
votes
1answer
3k views

Minimum hardware requirements for developing for iOS and Android with Unity, Cocos2d-x and GameSalad on a Mac

I intend to create iOS and Android games. My main priority is to create 2D games. The software that I’m planing to use are Unity, Cocos2d-x and GameSalad. I am a bit interest in the Mac Mini, ...
0
votes
1answer
244 views

How to detect collision during a cocos2d::Action

I spent a day trying to hack my own Action class, but given the hurdles I've hit trying to do so, I'm hoping there's some way to work around my problem while still using the built-in (and admittedly ...
7
votes
0answers
180 views

How to use a mask texture with Kobold2D

I am an iOS developer but I'm new to cocos2d. I'm working on new game, I use Kobold2D, have cocos2d installed too, and I want to make this effect: I know how is done with Flash, but can't make it ...
1
vote
0answers
161 views

Black border all around simulation / viewport in iOS using Xamarin + CocosSharp

I'm just getting started with Xamarin and CocosSharp so it's possible I've missed something basic here.. but whatever it is I can't seem to figure it out. I'm trying to get my app/game to be ...
1
vote
0answers
139 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 ...
1
vote
1answer
557 views

Cocos2d/Cocos2d-x Attaching an arrow (sprite) to another body sprite (person)

I am trying to set up a simple bow and arrow game. When the arrow hits the enemy body, the arrow's body is deleted and the arrow sprite continues to update, keeping the position correct in relation to ...
0
votes
0answers
1k views

Cocos2d Vertical Doodle-Jump Like Scrolling [duplicate]

Good afternoon, For the past few days I've been making a game very similar to DoodleJump in the sense that it involves a main character, things to jump on, certain powerups and some monsters. I've ...
0
votes
2answers
679 views

How is the environment moved in endless runner games like Tiny Wings

I've always wondered how the background scene is scrolled endlessly as the main player is moving (usually to the right). With Tiny Wings I suspect that it's somehow drawn dynamically because when ...
6
votes
2answers
4k views

Rendering shadow sprites in cocos2d-x

I am writing a 2D game with cocos2d-x. I want to put a "shadow" sprite on a background sprite using the equation: MAX(0, Cd * 1 - Cs * S) where Cd is the ...

1 2 3 4 5 6