Tag Info

Hot answers tagged

10

I found the implementation description from the author of this effect: It surely was a lot of work to create the depth illusion in a 2D plane. The principle is very easy though: circles start in the middle of the screen with scale 0. Then the first circle of the tunnel starts scaling proportionally to the time elapsed (linear scaling doesn't work) ...


5

Sprite animation is pretty simple. You just create a CCAnimation node, add the images to loop, then create an action using CCAnimate::actionWithDuration(float,CCAnimation,bool) and make the sprite run it. Code snippet: CCAnimation * anim = CCAnimation::animation(); // There are other several ways of storing + adding frames, // this is the most basic using ...


4

It really depends on your art style. Does the game look fine scaled down halfway? Would making new, lower-res artwork push you over the current OTA download size? If so, then keep the larger graphics. There are not a lot of people with 3GSs and 3rd gen iPod touches out there (the only currently supported non-retina small devices), and with iOS 6 the 3rd ...


4

In new version of CoCos2dx you can use (it's working) CCSpriteFrameCache* cache = CCSpriteFrameCache::sharedSpriteFrameCache(); cache->addSpriteFramesWithFile("numbers.plist","numbers.png"); CCSprite* sprite = CCSprite::createWithSpriteFrame(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("slice2_0_0.png")); ...


3

My second question is that my actual game scene uses bound camera and I perform scrolling on that camera but my other scene uses the normal camera. So in this situation what to do? how to use multiple camera for single engine? or how to reset available current camera? Our 3d game engine allows us to create as many render targets we wish. A render ...


3

You need to ask for the device's resolution, and then, set the viewport to fit it. I assume that you are using Cocos2d X, they call it Multi Resolution, hope this helps. Edit: This post from Jesús bosch may give extra information about the topic.


3

You could create a Bézier curve that matches a sine (read this article for an example). Creating a Bézier curve from a sine, just to feed into CCBezierTo seems like a very counter-intuitive way of doing things though. I would skip CCBezierTo entirely and update the position of your sprite yourself. You could do so in your update method or implement a ...


3

You can use CCTMXTiledMap: http://www.cocos2d-x.org/reference/native-cpp/da/d68/classcocos2d_1_1_c_c_t_m_x_tiled_map.html It supports isometric, hexagonal and orthogonal tiles.


3

You are probably updating the velocity twice, since this is usually done in the integration step itself. I expect you implemented the RK4 integration from http://gafferongames.com/game-physics/integration-basics/. The author defines Derivative.dv as the acceleration (derivative of velocity) and State.v as as the velocity In the evaluate function you can ...


2

you can't set a callback function for CCLabelTTF or any other Label class, yet there is CCMenuItemLabel you can use. you first need to create an instance of CCMenu class. then you need to allocate CCMenuItemLabel instance, using CCMenuItem::initWithLabel (CCNode *label, CCObject *target, SEL_MenuHandler selector). just check how helloworld sample handled ...


2

You could use something that someone has already created. http://ak.net84.net/iphone/creating-a-repeating-backgroundinfinite-parallax-effect-in-cocos2d/ It looks like the developer who wrote that ran into some troubles using the out of the box object as well and as such he decided to write a custom solution and subsequently share it with the world! Good ...


2

I think you've got the right idea, but the execution is going to be immensely challenging. I'm presuming when you say 'in an SVG file' you mean that the shape is defined by one (or more — your sample figure has an internal hole!) stroke paths. Unfortunately, SVG paths can be remarkably complicated, with both quadratic and cubic Bezier curves and ...


2

It's called 2D skeletal animation. Essentially you're animating a skeleton that has sprites for the body parts placed on top of it. This allows you to reuse animations for different characters and characters can have multiple sets of armor, weapons, etc. There are a number of questions on the site already about it: Tools for 2D skeletal animation How ...


2

I found out the problem! :) In "credits.js" you need to change: onEnter:function() { }, onExit: function() { }, to onEnter:function() { this._super(); }, onExit: function() { this._super(); }, Hope this works for you! -Edit- The reason actions were not running is because 1) the engine was not being notified of any of the objects ...


2

It depends what you mean by tile-based. Most 2D games that involve a level that you view from the top-down are tile based. In this way different tiles usually have different properties, and pathfinding such as A* is easy to implement. A lot of level editors use a tile-based sprite-sheet to define all of the aspects of a level, but then use them in a tiled ...


2

Gordonk was absolutely spot on. It now appears that I have silky smooth movement at 60fps. If I cap the frame rate at anything less than 60 I start to see serious stuttering, but I guess that's a separate issue to explore. So here is the code I am using right now. It hasn't been optimized in any way, it was just to implement a fixed time step. I'm using the ...


1

I found my solution by creating subclass of PhysicsConnector. public class CustomPhysicsConnector extends PhysicsConnector { private float flagDisplacement; public CustomPhysicsConnector(IShape pShape, Body pBody, boolean pUdatePosition, boolean pUpdateRotation, float flagDisplacement) { ...


1

You can use GLES_Render class in TestCpp, which is located in ./samples/TestCpp/Classes/Box2DTestBed/GLES-Render.cpp ./samples/TestCpp/Classes/Box2DTestBed/GLES-Render.h of the download package. To implement the debug draw, you can draw the debug renderer with your world data after CLayer::draw(); as demonstrated in ...


1

Here is the subclass that I used to avoid the issue of jerky-ness with a CCSpeed, CCRepeatForever, and CCAnimate as described above. // SHAnimate.h #include "cocos2d.h" #include "cocos-ext.h" USING_NS_CC; class CC_DLL SHAnimate : public CCAnimate { public: virtual void update(float t); static SHAnimate* create(CCAnimation *pAnimation); }; // ...


1

I dont think steam will bother in what you use for engine, as long as your product are stable, correct and worthy. if they find your game filld with bugs and crashes, they are probably not going to release it. Just take a look at What happend with warZ. they did use a pretty well known engine, but the game was filled with bugs and had promises it dident held ...


1

From my understanding of the virtual keyboard, you can't get the height. What you can do is set your window to re-size mode and handle the re-size. For more information see this question on SO and this discussion on Google groups.


1

Well, you should start by checking the error code returned by sqlite3_open. Different codes are there for a reason to suggest what the error might be. I for one guess that the file was not found. Very often the current directory is not what you expect, and is oftent different on different platforms.


1

You're almost there with having multiple ring sprites of decreasing Z value and scale. Just don't center them all. You need to keep track of the point where you want the tunnel to hit the far away event horizon. You can move that point around over time however you like. Then, as you place each new sprite, place it at that point, scale it small, set it's ...


1

I have this code working in cocos2dx 2.0.3, also make sure that you've added the plist and png file to your project, sometimes visual studio can be a bit funny about resources. CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("AnimBear.plist" ); CCSpriteBatchNode *spreetsheet = CCSpriteBatchNode::create("AnimBear.png"); ...


1

You would use both. Lua can be used for: Exporting code to a mobile device Making a UI (You should try first make an addon for a MMORPG if you want to get a better idea how you can use Lua) C++ is the core code of the videogame, so maybe you can program a game without Lua but it might help you to do better UI for your games


1

Well, it depends on your artists and how they are designing, if you use Adobe Illustrator, which is vector based, that means you can scale to whatever size you need. My process is to draw the image I want out on paper, scan it in, make a version in of the drawing in Adobe Illustrator (using the drawing as a template), then rasterize in Adobe Photoshop and ...


1

you should use two sets of graphics, this might help you reduce memory usage too as its already built into the framework of cocos2d. You need to add a suffix on your images, apple uses the ”@2x” suffix, but cocos2d doesn't use that extension because of some incompatibilities. Instead, cocos2d has its own suffix: ”-hd”. You'll need to enable retina mode ...


1

Twitter has a developer portal, where you'll probably want to check out the REST API. Specifically the POST statuses/update endpoint. Because this API is HTTP-based, you'll need a way to make such requests from your game. This question on SO addresses that subject, with suggestions such as curlpp. Facebook has a similar set of APIs available, described on ...


1

The steps are as follows: Generate the project for Android using cocos2d-x template Add project to NVPack's Eclipse Fix make files, IDE configuration and whatnots Compile the libraries with Cygwin and build_native.sh script, they will be automatically added to the obj folder of the project Execute/debug like an Android application Those are the windows ...


1

The problem was in the Android manifest. My main class inheriting from Application was not added as the main application class in the description. Once added, the app called a new object and the OnCreate method where I could initialize OpenFeint. As OpenFeint is open you can now statically call the OpenFeint functions to open the different views.



Only top voted, non community-wiki answers of a minimum length are eligible