Tag Info

Hot answers tagged

3

This is a simple mixing of two different steering behaviors. Following and wandering. You can find information about implementing both in this GDC paper from '99. Start with implementing both independently. Then apply both at the same time, with a blending factor. You'll have to modify the blending value depending on how much you want to wander vs how ...


3

Bresenham's algorithm is specifically built to draw circles with fixed-point mathematics; that is, to rasterize circles. For what you're doing you're almost certainly better off with a much more abstract representation of your circular motion — that is, you want to keep track of your character's angular velocity and to simply move it with constant ...


2

Demonstration: Crude but functional collision detection and response Video: https://vimeo.com/64923588 The idea is that the player controlled sprite (actually a 32x32 pixels red box) can raise the speed of its next move, but it cannot go back to original speed except if it collide with something. Also if speed is enough the green wall can be "damaged" ...


2

Here in the following link I post my code that I used to create ninja swipe effect. http://www.andengine.org/forums/gles1/draw-gl10-gl-triangle-strip-fruit-ninja-swipe-effect-t7257.html This link contains whole discussion about this topic but at last I post my code and image so any user can immediately create this effect.


2

I might do it this way... I wrote a game that had a throwing mechanic using the mouse, and its similar. I'm also assuming you are using touch primarily. Get the time when your finger touches the screen. On the touch move callback, see how much time has passed and how far you have gone from the original point. You can get the distance using Pythagoreaus' ...


2

For the cutting-line drawing, I could think of a simple logic that tracks user input with a short interval and draws lines from the tracked points like this -> If the user is cutting ( touching the screen / mouse down + move ) you could check the cursor position point in a desired interval, and draw a line from the last point to the current point until user ...


2

You should check out this tutorial by Ray Wenderlich. It uses Cocos2d + Box2d to show how to write a game like Tiny Wings. The first part of the tutorial explains how to create dynamic textures: http://www.raywenderlich.com/3888/how-to-create-a-game-like-tiny-wings-part-1 Second part is how to use Box2d for the gameplay: ...


2

What you want to do is seperate your actual input from your input processing. The game logic shouldn't care about where the event came from, only that it happened. The easiest thing for you to do is to record the player's input and timestamp it. For example, let's say you store it as JSON: "InputEvents": [ "KeyPressed": { "Timestamp": 1230, ...


1

For the specific case in the question I see two options: Override the time step when you're getting close to a jump location, so that at the end of that time step the player is in the correct position for the jump. Use a fixed timestep so it can't go wrong in that way. Note that there's also other ways for it to fail. For example, anything that's ...


1

This can easily be done just with the bounds of the screen and the position of the sprite. The screen bounds can be stored in two variables, screenMin and screenMax, where screenMin contains the minimum X position of the screen and the minimum Y position of the screen, screenMax does likewise with the maximums. leftDistance = spritePos.x - screenMin.x; ...


1

Checking for next tile being water is not going to hurt your performance in any way. It takes very little computing power. Modern games operate with thousandfold amounts of data at 60 times per second, and your occasional checking of next tile is nothing. You can implement state machine in different ways. For example having a variable "isFirstPlayerTurn = ...


1

Blame me for never having played any of these games, so I can just assume you want your character to turn around while walking rather than turning instantly (e.g. like in The Legend of Zelda games or most JRPGs). If so, I'd simplify the whole thing using "steering": Store the current direction the player is facing as an integer. You can either use 4 or 8 ...


1

Here's a different algorithm; instead of stepping the player forward and moving him back if he's colliding, check where the next collision will occur: Get the position of a corner of the object. Shoot a line down (or up, or to the right/left, depending on your movement direction) from that position. Figure out the first place that line intersects a ...



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