10

Well, you'll have to use a little bit of physics, but you don't need to simulate any physics. There are formulas for pendulum motion you can easily use to set the rotation of your pendulum. For small swings, the motion can be approximated with simple harmonic motion. The angular displacement at a specific time can be approximated with: This is most ...


5

Given the options in your question, separate timers would be the best approach. I'm not sure what your implementation of the "timers" is but you can get a major performance increase and simplify things by using a different approach. Rather than using timers (as in stop-watch type timing) you could use time stamps that represent the expiration of a cooldown ...


4

Here is a no-trig calculation, derived from straight-forward Grade 11 Trig and Physics. It assumes that the origin is the lowest point of the pendulum bob's suspension, that L is the length of the pendulum, and that the normal graphics convention of y increasing down, and x increasing to the right is adopted: Update: I messed up yAcceleration initially; ...


4

If the enemy waves only effect one player (the one that plays the game), then I really see no need to put this logic on an external server. Having a server would also require an internet connection which can't be taken for granted (especially on iPods and iPads). You could simply store the time when your game exits or goes to the background. Upon relaunch ...


3

Good points from NauticalMile. You could download one of many free textures that are already set up to tile nicely, or create one yourself using Photoshop or similar. To make the scaling match use the length of the wood pieces as the tiling factor. Alternately if you are strongly against visible repetition you could use a pixel shader instead of a texture. ...


3

There's a special class available in cocos2d that renders a ribbon of quads for you. At one point it was named CCRibbon, but I think it has been changed to CCMotionStreak (docs). It's designed to render trails or ribbons. I think using that class would be the most efficient way to create such an effect.


3

Add a new Layer and put there a Menu object with the buttons you need. Make the layer visible when the game is over.


3

I think you're getting your pixel coordinates and tilemap coordinates confused. Tile coordinates count tiles. Pixel coordinates count pixels. To convert from a pixel coordinate to a tile coordinate, divide the click_x by the tile width and the click_y by the and tile height, to get the tile coordinates x and y. (Discard the remainders to get an integer.) ...


3

The difficulty of an endless runner is dependent on a few things, first of all the size of the obstacles and different types of obstacles, typically it's best to just hardcode when different obstacles can appear and use a formula for sizes (especially when you can only use a given dodge ability for a certain amount of time). A good formula for the size of ...


3

One option is to overlay a texture that has a blend mode of Multiply set to it over your tiles. The overlay texture would be almost black (dark shades of grey) all around, except for the area you want to be fully visible, which would be white. Multiply blend mode will darken all the black areas and the white areas would remain unaffected. Here is a sample ...


2

The catch of Game salad is "write games without coding...". However it doesn't mean write games without programming! Just because you aren't coding doesn't relieve you from knowing the math and logic real programmers have to go through when developing apps!


2

I assume you want to view the scene from the side? Pretty easy to be done. Just create two circles that are connected to each others with some space in between: O O You just draw the actual ring (the part not colliding) over the "empty" space.


2

I'll share my design as of current implementation I did for my game. ObjectPool & Managers For objects whether it's enemy objects, collectable items, powers-up, effect (more like particle), etc, I managed them through my own implementation of ObjectPool as you will know roughly number of instances you would need in the game for certain time, so it will ...


2

This question is several weeks old, but I thought I would answer in the event you were still looking for assistance, or too perhaps help someone else down the line. Please note that the way you are loading the spritesheet using CCSpriteFrameCache is correct, but it does nothing more than add the contents of the spritesheet to memory. You then need to ...


2

Do as ryrich said, however the actual code on Objective-C would be something like this: (Assuming your CCNode class is called "Seal") int sealCounter = 0; for (id *node in self.children) { if ([node isKindOfClass:[Seal class]]) { sealCounter++; } }


2

Let's speak radians. Your angle is clamped to a real range and from what I can see from your video I would say between −π/2 and 3π/2. Now you can also view angles in different ways, for example as points on a circle. This is clearly the intuitive way to see your problem : in your case the tip of your ship is the considered “angle point” on the circle. ...


2

Regarding the info found here, currently there is no official way to achieve this but they are working on it. Meanwhile you can download the "standalone template" found in the same link.


1

int Width = 2500; int Height = 1500; CCLayerPanZoom *Zooming = [[CCLayerPanZoom alloc] init]; self.Zooming.mode = kCCLayerPanZoomModeSheet; self.Zooming.panBoundsRect = CGRectMake( 0, 0, mapWidth, mapHeight ); // zooming level self.Zooming.minScale = 1.0f; self.Zooming.maxScale = 8.0f; self.Zooming.rubberEffectRatio = 0.0f; // center in the view ...


1

I have not come across a way to define the type of axis that you're talking about, however I can offer a method that I've used to overcome this issue. The best method, and most easily explained to the artists on the project, is to make all the sprite frames for all animations for a particular character the exact same sizes. For example, if your character ...


1

Solved the problem finally. Had to use custom openGL shaders for coloring one of the objects completely RED and the other completely BLUE and then looping through all the pixel data collected using glReadPixels to find if a pixel has both RED and BLUE colors. In depth information and source code can be found in my blog post - http://blog.muditjaju....


1

I think it's a matter of preference. Depending on the type of game, the MVC architecture might be a good fit, sometimes/mostly it will feel out of place though. I have used it for puzzle games before (eg. your board is the model, the controller handles user input and makes the changes on the board and a view that renders these changes). Another architecture ...


1

First, are you running on the simulator or a real iOS device? The device runs many times faster than the simulator. The simulator doesn't do hardware vertex processing. So the simulator slows down quite a bit with only a little load. If its slowing down on the simulator, that's not really an indication that it will be slow on an actual device at all. ...


1

I just put my logic. You have updateRunning method, in this method you have a logic of move coin at right to left. Here you need to use CCMoveTo Action, // move the coin until it leaves the left edge of the screen if (coin.position.x > (coin.contentSize.width * (-1))) { [coin runAction: [CCSequence actions: // Here set MoveDuration as you need ,...


1

I'd probably try to do something like the following: Store all your vertices as well as the edges connecting them. When an explosion happens, do the following: Remove all vertices within the explosion radius. Remove all edges within the explosion radius. Flag all vertices with removed edges as "dirty". After an explosion, iterate over all "dirty" vertices ...


1

You can build two different types of motion functions that are called if the positions are off the screen or within the screen. //within the SpaceShip Class void Move(){ if(InScreen) asteroidLikeMotion(); else if(OffScreen) loopMotion(); } I am guessing that you already have the mechanism for asteroid like motion. For looping behavior ...


1

Many individual timers can cause race conditions. Set one timer to 50 ms, 10 ms later set another timer to 40 ms. Which one will fire first? Often there is no way of knowing, and the result may be different from one run to another due to minor performance variations. Often it is not an issue, but bugs caused by race conditions can be really hard to track. ...


1

It's simple z_order = position_y Where axis origin is top left corner of screen(in cocos2d, it's bottom left). Player has origin at right between his foot. tree has origin at it's root..... If the map has size of 100x100, and player are at map's limit, his z_order must be 100. If 2 character are at the same y position, their z_order are equal too.


1

In general, the best way is to make your object dynamic and add a force to it in every frame, to the left or to the right. What I mean is that you can determine your path and calculate the force by considering the weight and gravity, which is why you apply the force to the bird. I think it's the best way, and also the most realistic.


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