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) and after ...
I'm not used to Cocos2D engine, but I can suggest this solution for you to apply to your game.
The simplest way to implement a train wagon can be making an object which follows a given path, whose angle rotates according to the path direction. Given a path (as an open line or closed polygon) consisting of a finite number of points, the ...
Lua is a pretty well developed scripting engine that is flexible and easy to integrate to your games, and is already supported in many game engines, for instance:
Agen (Lua; Windows)
Blitwizard (Lua; Windows, Linux, Mac)
Corona (Lua; Windows, Mac; iOS/Android)
EGSL (Pascal/Lua; Windows, Linux, Mac, Haiku)
Grail Adventure Game Engine (C++/Lua; Windows, ...
There is no option about dp in cocos2dx and in fact we don't need it.
But cocos2D-x 2.x and 3.x have very easy solution for multi-resolution problem ( either iDevices or Android devices) As you saw in Multi-resolution support document.
In fact you just need to set your DesignResolution and then just imagine your target device will has this resolution.
EDIT : Multi-resolution bug fixed.
Here is my solution for you:
First of all Let's sync some assumption:
We have a layer ( Let's say MapLayer ) that includes game map background ( Let's name it map) and its content( map-related objects, e.g. towers and enemies).
I didn't use CCCamera. I tried to scale and move MapLayer instead.
bottom-left and top-right ...
You don't speed up the engine, you speed up your units and their actions. For example, when you update an enemy, you usually do something like enemyDirection * enemySpeed * timePassed to get their new position. Now, if you want to double or halve the speed of gameplay, you just add this in as a factor: enemyDirection * enemySpeed * timePassed * ...
In new version of CoCos2dx (2.1.1) you can use (it's working)
CCSpriteFrameCache* cache = CCSpriteFrameCache::sharedSpriteFrameCache();
CCSprite* sprite = CCSprite::createWithSpriteFrame(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("slice2_0_0.png"));
Implement your own Point class. That's good design if UI Point is seperate from logic Point.
Point different to cocos2d::Point.
In Projectile class, you include and use it.
Then render class, include the ...
ngoaho91 is basically hinting in the right direction but is not spelling it out explicitly, so I will try to make it more explicit.
So you took the framework and started implementing the logic within the separate framework classes. The problem why you can't simply test the game logic in isolation, is because it is not isolated.
You write that you ...
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 ...
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 target is ...
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 ...
I'll answer my question, but @akg is the answer that guided me. I've made the code in cocos2d-x, and I didn't used boundingBox() method. Hope this helps someone, :) I didn't found something like this in other site, so I hope not be doing something wrong...
bool SceneGame::ccTouchBegan(CCTouch* touch, CCEvent* event)
CCPoint touchPoint = CCDirector::...
Your actual view of the ball or playing field shouldn't really matter in this.
First of all, you'd mostly want a constant/fixed horizontal velocity for the ball. You can add air resistance to this, but it wouldn't really change anything, as you'll just have to add it to the equation.
Ignore the actual height of the shot for now.
Having a target distance as ...
There are a number of things to ask, but if you understand the basics you should be able to not just determine the speed your sprite is moving but dictate it.
Unless you are overtaxing the processor, or you schedule a routine to "update" less often, the game "loop" is going to execute 60 times per second. Assuming the routine that moves your sprite is ...
Follow the steps in this video for setup.
After you do all the steps in the video (you may need to restart here) run this command from the command line to create a new Cocos2d-x project:
cocos new GameNameHere -p com.MyCompany.GameNameHere -l cpp -d path/to/project
It's better not to use spaces in the names that you choose.
Go to the project directory ...
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.
This post from Jesús bosch may give extra information about the topic.
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 ...
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 ...
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 ...
On the collision, simply reference the relative positions of the two objects. If the ball is above the block, it struck the top. You really only have to check the y coordinate if you're sure a collision is happening. Something like the following:
Simply check to ensure the y coordinate of the circle is within a tolerance of the box half-height + the radius ...
Without ever having implemented this...
First you will have to control every step of the new gems on their way to their final place. Or in other words, move your sprites only on field on your grid and then calculate their next field.
Now generate new gems and drop them into that column. On each step you check if the gem can fall further down. If not check ...
Here is some math
Circ = radius * 2 * 3.14
dx = ball_speed * dt
to get deltaAngle a lets solve a/dx=(2*3.14)/circ
a = (2*3.14*dx)/circ
sobstituting circ = radius * 2 * 3.14
a = dx/radius
so delta angle belongs to speed , dt and radius
putting this stuff into love2d we get
local dx = ent.speed*dt
If you don't want to use a .plist file and want to continue with the Ef Es's answer with the current version of cocos2d-x, just change some lines as below:
CCSprite * sprite = CCSprite::create("bear1.png"); // NEW - create a sprite here
CCAnimation * anim = CCAnimation::animation();
// There are other several ways of storing + adding frames,
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 ...
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 ...
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 ...